
function PopUp(url, windowWidth, windowHeight)
		{
			var popWind;
			
				if (popWind && (navigator.appName == "Microsoft Internet Explorer")) {
					popWind.close();
				}
					
				popWind=window.open(url,'Ad','width=' + windowWidth + ',height=' + windowHeight + ',toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=no,top=5,left=5');
			
			if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3" || "4") )
				popWind.focus();
		}

		
function pageload() {
				Listener.add( 'product_select_button', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/browse_garments_over.png';
				} );
				Listener.add( 'product_select_button', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/browse_garments.png';
				} );
				
				Listener.add( 'facebook_header', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/facebook_over.png';
				} );
				Listener.add( 'facebook_header', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/facebook.png';
				} );
				
				Listener.add( 'fb_button', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/join_our_group_over.png';
				} );
				Listener.add( 'fb_button', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/join_our_group.png';
				} );
				
				Listener.add( 'twitter_header', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/tweet_over.png';
				} );
				Listener.add( 'twitter_header', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/tweet.png';
				} );
				
				Listener.add( 'tweet_button', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/follow_us_over.png';
				} );
				Listener.add( 'tweet_button', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/follow_us.png';
				} );
				
				Listener.add( 'c_p_button', 'mouseover', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/start_designing_over.png';
				} );
				Listener.add( 'c_p_button', 'mouseout', function() {
					this.getElementsByTagName('img')[0].src = 'images/buttons/start_designing.png';
				} );
}

function dropin()
{

	var e = document.getElementById("coverX");
	var e1 = document.getElementById("popupX");

	e.style.display="";
	//e1.style.display="";
	new Effect.SlideDown(e1);

}

function hide()
{
	var e = document.getElementById("coverX");
	e.style.display="none";

	
}

function hide1()
{
	var e1 = document.getElementById("popupX");
	new Effect.SlideUp(e1);
	
	var e = document.getElementById("coverX");
	e.style.display="none";

	
}


	function buildAjaxRequest( id ) { 
		var ajaxRequest;  // The variable that makes Ajax possible!
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
				
			} catch (e) {
				
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					//alert("Your browser broke!");
					return false;
				}
			}
		}
		
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			
			if(ajaxRequest.readyState == 4){
				
				
				var ajaxDisplay = document.getElementById(id);
				//document.getElementById('garment127').innerHTML = ajaxDisplay;
				
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
			}
			
		}
		
		return ajaxRequest;
	}
	
	function change_price( clipid ) {
		
		var ajaxRequest = buildAjaxRequest(clipid);				
		var tid = clipid.substring(7);	
		
		var ajaxQ = document.getElementById('garmentQuantity');
		var ajaxF = document.getElementById('frontQuantity');
		var ajaxB = document.getElementById('backQuantity');
		var ajaxT = document.getElementById('quickpricetype');
		
		if(ajaxQ.value < 6)
		{
			//alert("Screen printing requires a miminum order of 6 garments.");
			ajaxQ.value = 7;
		}
		
		var buildstring = "&whitebool=1";
		if( ajaxT ) buildstring = buildstring + "&pricetype=" + ajaxT.value;
		if( ajaxQ ) buildstring = buildstring + "&quant=" + ajaxQ.value;
		if( ajaxF ) buildstring = buildstring + "&front=" + ajaxF.value;
		if( ajaxB ) buildstring = buildstring + "&back=" + ajaxB.value;
		
		ajaxRequest.open("GET", "quickprice.cgi?target=" + tid + buildstring, true);
		ajaxRequest.send(null); 
		
		
	}
	
	function change_priceColor( clipid ) {
		
		var ajaxRequest = buildAjaxRequest(clipid);				
		var tid = clipid.substring(12);	
		
		var ajaxQ = document.getElementById('garmentQuantity');
		var ajaxF = document.getElementById('frontQuantity');
		var ajaxB = document.getElementById('backQuantity');
		var ajaxT = document.getElementById('quickpricetype');
		
		if(ajaxQ.value < 6)
		{
			//alert("Screen printing requires a miminum order of 6 garments.");
			ajaxQ.value = 7;
		}
		
		var buildstring = "&whitebool=0";
		if( ajaxT ) buildstring = buildstring + "&pricetype=" + ajaxT.value;
		if( ajaxQ ) buildstring = buildstring + "&quant=" + ajaxQ.value;
		if( ajaxF ) buildstring = buildstring + "&front=" + ajaxF.value;
		if( ajaxB ) buildstring = buildstring + "&back=" + ajaxB.value;
		
		ajaxRequest.open("GET", "quickprice.cgi?target=" + tid + buildstring, true);
		ajaxRequest.send(null); 
		
		
	}
	
	function redirectColorSelect(url)
	{
		window.location(url);
	}
	
	
	function click_disable() {
	
		document.getElementById('order_submit').disabled = true;
		
		return true;
	
	}
	
	
function hide_div(object)
{
	document.getElementById(object).style.display = "none";
}

function show_div(object)
{
	document.getElementById(object).style.display = "block";
}
	
function change_src(obj,src)
{
	document.getElementById(obj).src = src;
}	
