_uacct="UA-899753-1";
if (typeof(urchinTracker) == 'function') urchinTracker();

function openpopup(an) {
	
	var href = an.href;
	var title = an.title;
	
	popup = window.open(href,title, "menubar=no,width=350,height=500,toolbar=no");
	popup.moveTo(20,50);
	popup.focus();
	
} function swap_out_image(argthis, target_id, iwidth, iheight) {                // argthis is passed the calling html item (an img)                // iwidth is the incoming set width to scale the image to                // iheight is the incoming set height to scale the image to                // Function determines the restraining dimension and scales the image to the correct size                // Function then switches out the target image for the source img via the src                var target_image = document.getElementById(target_id);                var source_image = argthis;                //target_width = target_image.getAttribute("width");                //target_height = target_image.getAttribute("height");                target_width = iwidth;                target_height = iheight;                source_width = source_image.getAttribute("width");                source_height = source_image.getAttribute("height");                height_scale = target_height/source_height;                width_scale = target_width/source_width;                myscale = Math.min(height_scale, width_scale);                final_height = source_height * myscale;                final_width = source_width * myscale;                target_image.setAttribute("src", source_image.getAttribute("src"));                target_image.setAttribute("alt", source_image.getAttribute("alt"));                target_image.setAttribute("width", final_width);                target_image.setAttribute("height", final_height);        //alert ("tw" + target_width + "/n" +        //"th" + target_height + "/n" +        //"sw" + source_width + "/n" +        //"sh" + source_height + "/n" +        //"hs" + height_scale + "/n" +        //"ws" + width_scale + "/n" +        //"cs" + myscale + "/n" +        //"fh" + final_height + "/n" +        //"fw" + final_width); }

/* jQuery Based Code Below here only please */

$(document).ready(function(){
						   
	$("input#keywords").focus(function(){
		if (this.value == this.defaultValue) {
			this.value = "";
		}
	});
	
});


var gal = {
    init : function() {
        if (!document.getElementById || !document.createElement || !document.appendChild) return false;
        if (document.getElementById('gallery')) document.getElementById('gallery').id = 'jgal';
        var li = document.getElementById('jgal').getElementsByTagName('li');
        li[0].className = 'active';
        for (i=0; i<li.length; i++) {
            li[i].style.backgroundImage = 'url(' + li[i].getElementsByTagName('img')[0].src + ')';
            li[i].style.backgroundRepeat = 'no-repeat';
            li[i].title = li[i].getElementsByTagName('img')[0].alt;
            gal.addEvent(li[i],'click',function() {
                var im = document.getElementById('jgal').getElementsByTagName('li');
                for (j=0; j<im.length; j++) {
                    im[j].className = '';
                }
                this.className = 'active';
            });
        }
    },
    addEvent : function(obj, type, fn) {
        if (obj.addEventListener) {
            obj.addEventListener(type, fn, false);
        }
        else if (obj.attachEvent) {
            obj["e"+type+fn] = fn;
            obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
            obj.attachEvent("on"+type, obj[type+fn]);
        }
    }
}

gal.addEvent(window,'load', function() {
    gal.init();
});



