	// JavaScript Document

	drop_on = 0;
	
	function drop_nav(action) {
		obj = document.getElementById('project_nav_items');
		if (action=='toggle') {
			if (drop_on==0) {
				if (obj.style.display) obj.style.display = '';
				else obj.className = 'show';
				drop_on = 1;
			} else if (drop_on==1) {
				if (obj.style.display) obj.style.display = 'none';
				else obj.className = 'hide';
				drop_on = 0;
			}
		}	
		if (action=='show') {
			if (obj.style.display) obj.style.display = '';
			else obj.className = 'show';
			drop_on = 1;
		}	
		if (action=='hide') {
			if (obj.style.display) obj.style.display = 'none';
			else obj.className = 'hide';
			drop_on = 0;
		}
	}
	

	function flip(img,zimg,w,h,l) {

		o = document.getElementById('keyimage');
		o.removeAttribute('style');
		o.setAttribute('src',"/assets/blank.gif");
		o.setAttribute('src',img);
		o.setAttribute('height',h);
		o.setAttribute('width',w);
		o.setAttribute('alt',l);
	
		if(w<220) {
			leftnum = ((220-w)/2) | 0;
			leftpos = "left: " + leftnum + "px;" ;
			o.setAttribute('style',leftpos);
			// IE6 needs the following - stoopid IE
			o.style.left = leftnum + "px";
		}

		o = document.getElementById('keylink');
		o.setAttribute('href',zimg);
		o.setAttribute('title',l);
		setupZoom();

	}
		
	
	function viewmovie() {
	  popup = 'view_animation.php';
	  winname = window.open(popup,'myname','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=250,height=250');
	  windowstatus = 1;
	  if (window.focus) { winname.focus(); }
	}

	function popup(url,n,h,w) {
		hp = 0;
		vp = 0;
		if(screen){
			hp = (screen.width-w) / 2;
			vp = (screen.height-h) / 2;
		}
		winname=window.open(url, n,'width='+w+',height='+h+',left='+hp+',top='+vp+',scrollbars=yes,toolbar=no,menubar=no,resizable=no,statusbar=yes');
		windowstatus = 1;
		if (window.focus) { winname.focus(); }
	}

	function zoom(pid) {
		pagename = '/zoomimage.php?pid=' + pid;
		winname = window.open(pagename,'myname','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=980,height=900');
	}


	function fillshipping() {
		
		document.getElementById('shipping_address1').value = document.getElementById('billing_address1').value; 	
		document.getElementById('shipping_address2').value = document.getElementById('billing_address2').value; 	
		document.getElementById('shipping_city').value = document.getElementById('billing_city').value; 	
		document.getElementById('shipping_zippostalcode').value = document.getElementById('billing_zippostalcode').value; 	
		
		document.getElementById('shipping_stateprovince').selectedIndex = document.getElementById('billing_stateprovince').selectedIndex;
		document.getElementById('shipping_country').selectedIndex = document.getElementById('billing_country').selectedIndex;
		
	}
	
	function toggleshipping(chk) {
		
		o = document.getElementById('shipping_fieldset');
		if (chk.checked) {
			o.setAttribute('style','display:none;');
			// IE6 needs the following - stoopid IE
			o.style.display = "none";
		} else {
			o.setAttribute('style','display:block;clear:left;');
			// IE6 needs the following - stoopid IE
			o.style.display = "block";
			o.style.clear = "left";
		}

		
	}
