jQuery(document).ready( function() {



	//Default Action
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("ul.tabs li:last").addClass("active").show(); //Activate last tab
	jQuery(".tab_content:last").show(); //Show last tab content
	
	
	//On Click Event
	jQuery("ul.tabs li").click( function() {
		jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	jQuery(".toggle_container").hide();
	jQuery("h2#prodColor").toggleClass("active").next().slideToggle("slow");
	jQuery("h2#quantityA").toggleClass("active").next().slideToggle("slow");
	jQuery("h2#frontDesigns").toggleClass("active").next().slideToggle("slow");
	jQuery("h2.trigger").click(function(){
	jQuery(this).toggleClass("active").next().slideToggle("slow");
	
	
	
	
});
	
	
	
jQuery(function () {
"use strict";
jQuery('.colorSwatch').tipTip();
});
	
	
	jQuery(".colorSwatch").click( function() {
		var shirtFile = jQuery(this).attr("alt");
		var shirtCol = jQuery("img", this).attr("alt");
      jQuery(".article-shirt").attr("src", shirtFile);
	  jQuery('#ShirtFile_field').val(shirtFile);	  
	  jQuery('#ShirtFile_fieldq').val(shirtFile);	  
	  jQuery('#Shirt_Color_field').val(shirtCol);	  
	  jQuery('#Shirt_Color_fieldq').val(shirtCol);	  
});
	
	
	
jQuery(function(){
    jQuery('.fadein img:gt(0)').hide(9000);
    setInterval(function(){
      jQuery('.fadein :first-child').fadeOut()
         .next('img').fadeIn()
         .end().appendTo('.fadein');}, 
      9000);
	  
});
	
jQuery('.fadein img').click(function() {
   var disUrl = jQuery(this).attr('alt');
   window.open(disUrl).attr("target", "_self"); 
});
	
	

//---------------------------------------------------  on/off default text values ----------------------------------

function check_text_onfocus(obj)
{
    if(obj.value == obj.defaultValue)
        obj.value = '';
}
function check_text_onblur(obj)
{
    if(obj.value=='')
        obj.value = obj.defaultValue;
}


//---------------------------------------------------my GET-SET Design Code ----------------------------------


jQuery("#ChronoContact_quote").submit(function() {
    if ( !jQuery(".required").val()){
	jQuery(".required").toggleClass('LV_invalid_field');
	var er1 = jQuery(".required").siblings(".LV_invalid");
	if (!er1) {
		jQuery(".required").parent().append('<span style="font-size:10px;" class="LV_validation_message LV_invalid">This field is required</span>');
		} else {
		jQuery(".required").toggleClass('LV_invalid_field');
    }
	return false;		
	}
	if (jQuery(".required").val() && jQuery(".required").attr("class", 'LV_invalid_field')) { 
	jQuery(this).toggleClass('LV_invalid_field'); 
	jQuery(this).parent("div.form_element cf_textbox").remove('<span class="LV_validation_message LV_invalid">This field is required</span>');
	}
});






jQuery(".frontdesignChoice").bind("click", function() {
		var thisdesign  = jQuery(this).attr("src");
      jQuery("#frontDesign").attr("src", thisdesign);
      jQuery(".frontFullDesign").attr("src", thisdesign);
});

jQuery(".backdesignChoice").bind("click", function() {
		var thisdesign  = jQuery(this).attr("src");
      jQuery("#backDesign").attr("src", thisdesign);
	  jQuery(".backDesign").attr("src", thisdesign);
});

//---------------------------floating social box ----------------------------------------


//this is the floating content
	var jQueryfloatingbox = jQuery('#socialbox');
 
	if(jQuery('#bd').length > 0){
 
	  var bodyY = parseInt(jQuery('#bd').offset().top) - 20;
	  var originalX = jQuery("#socialbox").css('margin-left');
 
	  jQuery("html").scroll(function () { 
 
	   var scrollY = jQuery("html").scrollTop();
	   var isfixed = jQuery("#socialbox").css('position') == 'fixed';
 
	   if(jQuery("#socialbox").length > 0){
 
	      jQuery("#socialbox").html("srollY : " + scrollY + ", bodyY : " 
                                    + bodyY + ", isfixed : " + isfixed);
 
	      if ( scrollY > bodyY && !isfixed ) {
			jQuery("#socialbox").stop().css({
			  position: 'fixed',
			  left: '50%',
			  top: 20,
			  marginLeft: -500
			});
		} else if ( scrollY < bodyY && isfixed ) {
		 	  jQuery("#socialbox").css({
			  position: 'relative',
			  left: 0,
			  top: 0,
			  marginLeft: originalX
		});
	     }		
	   }
       });
	   }


//----------------------------------------------------cehckout stuff for VM code ----------------------------------
jQuery('input[name=ship_to_info_id]:radio').change(function() {
			var shipx = jQuery(this).val();
			var pgswitch = jQuery("#adminForm :input[name='page']").val();
			var pageswitch = pgswitch.replace("thankyou","index");
			jQuery('input[class=selectShip]:first').attr('checked', true);
			jQuery("#adminForm :input[name='page']").val(pageswitch);
			jQuery("#adminForm :input[name='ship_to_rate_id']").val(shipx);
			jQuery('#adminForm').attr('action', 'index.php?page=checkout.index&option=com_virtuemart&redirected=1&Itemid=20&addChange=true');
			jQuery('#adminForm').submit();
			//alert(shipx);
	});

jQuery('#formSubmitVM').click(function() {
		if (!jQuery("input[class='selectShip']:checked").val()) {
			   //alert('Please select a shipping method');
			   jQuery('#mygetshipping').focus()
			   jQuery('#shipMethodTitle').css("background-color", "red");
			   jQuery('#shipMethodTitle').css("color", "white");
			   return false;
			} else {
			jQuery('#shipMethodTitle').css("background-color", "transparent");
			jQuery('#shipMethodTitle').css("color", "black");
			}
			
		if (jQuery("input[name='payment_method_id']:checked").val()=='20' && jQuery("input[name='order_payment_name']").val()=='')	{
			jQuery('#order_payment_name').focus()
			jQuery('#paymentMethodTitle').css("background-color", "red");
			jQuery('#paymentMethodTitle').css("color", "white");
			jQuery('#order_payment_name').css("border", "1px solid red");
			return false;
		} else {
			jQuery('#paymentMethodTitle').css("background-color", "transparent");
			jQuery('#paymentMethodTitle').css("color", "black");
			jQuery('#order_payment_name').css("border", "none");
			}
		if (jQuery("#order_payment_number").val().length > 0 && jQuery("input[name='order_payment_name']").val()=='')	{
			 jQuery('#order_payment_number').focus()
			jQuery('#paymentMethodTitle').css("background-color", "red");
			jQuery('#paymentMethodTitle').css("color", "white");
			jQuery('#order_payment_number').css("border", "1px solid red");
			return false;
		}	else {
			jQuery('#paymentMethodTitle').css("background-color", "transparent");
			jQuery('#paymentMethodTitle').css("color", "black");
			jQuery('#order_payment_number').css("border", "none");
			}
			
		  //return false;
			
	});

//---------------------------------------------------display only relevant designs ----------------------------------


jQuery("#mascotThumb").bind("click", function() {
		var thisMascot  = jQuery(this).attr('alt');
		alert(thisMascot);
	  jQuery('[class=' +thisMascot+']').addClass("activated");
});



	
	jQuery("a#drinkware").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
	
		jQuery("a#athletics").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
	
		jQuery("a#uniforms").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
		jQuery("a#promoitems").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
		jQuery("a#hats").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
	
		jQuery("a#hoodies").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
	
	
		jQuery("a#bags").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	800,
		'height'		:	600
	});
	
		jQuery("a#fancyshopcam").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	450,
		'height'		:	275
	});


	
	jQuery("a#dontseemascot").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	500,
		'height'		:	400
	});



	/* This is basic - uses default settings */
	
	jQuery("a#single_image").fancybox();
	
	/* Using custom settings */
	
	jQuery("a#inlinepricetable").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	'940px',
		'height'		:	'600px'
	});

	/* Apply fancybox to multiple items */
	
	jQuery("a.moreVariationsBtn").attr('rel', 'variationgallery').fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	'640px',
		'height'		:	'480px'
	});
	
	
		jQuery("a#quoteNowBtn").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'width'			:	'500px',
		'height'		:	'480px',
		 'onStart' : function(){
						var defaultval = jQuery("#SchoolName_field").val();
						if (defaultval == '')
							{
								alert('Please Enter Your School Name ( just a little info ) - Thank You');
								jQuery("#schoolName").focus();
								jQuery("#schoolName").css('border', '1px solid red');
								return false;

							}
						if (jQuery("#totalSum").val() < 6) {
								alert('You must add at least 6 shirts to your order ( you can estimate ) - Thank You');
								jQuery("#YouthQXS").focus();
								jQuery(".sizeInput").css('border', '1px solid red');
								  return false;
							}
						}

		
	});
	
	
	

		/* Apply fancybox to signature shirt forms */
	
jQuery("#moresiglink").fancybox({
	'scrolling'		: 'no',
	'titleShow'		: false,
	'transitionIn'	:	'fade',
	'transitionOut'	:	'fade',
	'speedIn'		:	400, 
	'speedOut'		:	200, 
	'overlayShow'	:	true,
	'width'			:	'300px',
	'height'		:	'300px'
	});
	
	jQuery("#moresiglink2").fancybox({
	'scrolling'		: 'no',
	'titleShow'		: false,
	'transitionIn'	:	'fade',
	'transitionOut'	:	'fade',
	'speedIn'		:	400, 
	'speedOut'		:	200, 
	'overlayShow'	:	true,
	'width'			:	'300px',
	'height'		:	'300px'
	});
	
	
 

jQuery("#YouthQL").focus();

jQuery("#schoolName").bind("keyup", setSchoolName);
jQuery("#primaryColor").bind("keyup", setSchoolColor1);
jQuery("#secondaryColor").bind("keyup", setSchoolColor2);

jQuery("#YouthQXS").bind("keyup", setYouthQXS);
jQuery("#YouthQS").bind("keyup", setYouthQS);
jQuery("#YouthQM").bind("keyup", setYouthQM);
jQuery("#YouthQL").bind("keyup", setYouthQL);
jQuery("#YouthQXL").bind("keyup", setYouthQXL);


jQuery("#AdultQS").bind("keyup", setAdultQS);
jQuery("#AdultQM").bind("keyup", setAdultQM);
jQuery("#AdultQL").bind("keyup", setAdultQL);
jQuery("#AdultQXL").bind("keyup", setAdultQXL);
jQuery("#AdultQ2XL").bind("blur", setAdultQ2XL);
jQuery("#AdultQ2XL").bind("keydown", fix2XLPricing);

jQuery("textarea#cust_notes").bind("keyup", setNotes);


jQuery('.sizeInput').trigger('keyup');



jQuery('#YouthQXL').trigger('keyup');
jQuery("#quoteNowBtn").click(function () {
jQuery("#AdultQL").trigger('keyup');
});


var operators = {
    '+': function(a, b) { return a + b },
    '*': function(a, b) { return a * b }
};





/* recalculate the price */
	function recalc(){
		jQuery("[id^=total_item]").calc(
			// the equation to use for the calculation
			"qty * price",
			// define the variables used in the equation, these can be a jQuery object
			{
				qty: jQuery("id^=totalSum"),
				price: jQuery("[id^=price_item_]")
			},
			
			// define the formatting callback, the results of the calculation are passed to this function
			function (s){
				// return the number as a dollar amount
				return "$" + s.toFixed(2);
			},
			
			// define the finish callback, this runs after the calculation has been complete
			function ($this){
				// sum the total of the $("[id^=total_item]") selector
				var sum = $this.sum();
				
				jQuery("#grandTotal").val(
					// round the results to 2 digits
					"$" + sum.toFixed(2)
				);
				jQuery("#CalculatedPrice_field").val(
					// round the results to 2 digits
					sum.toFixed(2)-1
				);
				jQuery("#CalculatedPrice_fieldd").val(
					// round the results to 2 digits
					sum.toFixed(2)-1
				);
				jQuery("#CalculatedPrice_fieldda").val(
					// round the results to 2 digits
					sum.toFixed(2)-1
				);
				
			}
			
		);
		
	}



jQuery('form[name=addtocart]').submit(function() {
	var defaultval = jQuery("#SchoolName_field").val();
	if (defaultval == '')
		{
			alert('Please Enter Your School Name');
			jQuery("#schoolName").focus();
			jQuery("#schoolName").css('border', '1px solid red');
		return false;
		}
	if (jQuery("#totalSum").val() < 36) {
			alert('You must add at least 36 shirts to your order');
			jQuery("#YouthQXS").focus();
			jQuery(".sizeInput").css('border', '1px solid red');
		return false;
		}
});






	
	function fix2XLPricing() {
			var xtra = parseInt(jQuery("#AdultQ2XL").val());
			if (xtra > 0) {
			var xtraCost = parseFloat(xtra)*1.5;
			var oldTotal = jQuery("#grandTotal").val();
			var fixd = parseFloat(oldTotal)+ parseFloat(xtraCost); 
                        jQuery("#CalculatedPrice_field").val(fixd);
		}
	}
	
	
	

function calcNewWeight() {
	var quantitySum = jQuery("#totalSum").val();
	var prod_weight = jQuery("#calcWeight").val();
	var op = '*';
	var newTotalWeight = operators[op](prod_weight, quantitySum);
	jQuery('#new_weight').val(newTotalWeight);

	
}
    

// this calculates the sum for quantities
		function pleaseTotal()
		{
		jQuery(".sizeInput").sum("keyup", "#totalSum");	
		}


jQuery(".sizeInput").bind("keyup", pleaseTotal);
jQuery(".sizeInput").bind("blur", calcNewWeight);



	
	/* find tier pricing */
function tierPrice(){	
		if (jQuery("#totalSum").val()>6 && jQuery("#totalSum").val()<12) {
			var tierprice = parseInt(jQuery("#qPrice_6").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>12 && jQuery("#totalSum").val()<24) {
			var tierprice = parseInt(jQuery("#qPrice_12").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=24 && jQuery("#totalSum").val()<37) {
			var tierprice = parseFloat(jQuery("#qPrice_24").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=36 && jQuery("#totalSum").val()<49) {
			var tierprice = parseFloat(jQuery("#qPrice_36").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=48 && jQuery("#totalSum").val()<73) {
			var tierprice = parseFloat(jQuery("#qPrice_48").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=72 && jQuery("#totalSum").val()<101) {
			var tierprice = parseFloat(jQuery("#qPrice_72").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=100 && jQuery("#totalSum").val()<145) {
			var tierprice = parseFloat(jQuery("#qPrice_100").html());
			jQuery("#price_item_1").val(tierprice);
		};
		if (jQuery("#totalSum").val()>=144 && jQuery("#totalSum").val()<289) {
			var tierprice = parseFloat(jQuery("#qPrice_144").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=288 && jQuery("#totalSum").val()<501) {
			var tierprice = parseFloat(jQuery("#qPrice_288").html());
			jQuery("#price_item_1").val(tierprice);
			
		};
		if (jQuery("#totalSum").val()>=500 && jQuery("#totalSum").val()<1001) {
			var tierprice = parseFloat(jQuery("#qPrice_500").html());
			jQuery("#price_item_1").val(tierprice);
		};
		if (jQuery("#totalSum").val()>=1000) {
			var tierprice = parseFloat(jQuery("#qPrice_1000").html());
			jQuery("#price_item_1").val(tierprice);
		};
			var mysum = jQuery("#totalSum").val();
			var op = '*';
			var grndtotal = operators[op](mysum, tierprice);
			jQuery("#grandTotal").val(grndtotal);
			jQuery("#CalculatedPrice_field").val(grndtotal);
			
		
}


	// automatically update the "#totalSum" field every time
	// the values are changes via the keyup event
			jQuery("input[name^=sum]").sum("keyup", "#totalSum");
			jQuery("input[name^=sum]").bind("keyup", recalc);
			jQuery("input[name^=sum]").bind("keyup", tierPrice);
			recalc();
			tierPrice();
			
	
});



//---------------------------------------------------  on/off default text values ----------------------------------

function check_text_onfocus(obj)
{
    if(obj.value == obj.defaultValue)
        obj.value = '';
}
function check_text_onblur(obj)
{
    if(obj.value=='')
        obj.value = obj.defaultValue;
}
//--------------------------------------------------------my awesome Form data -----------------------------------------

function setSchoolName() {
	var sName = jQuery('#schoolName').val();
	//alert(sName);
	sName = sName.replace(';', '');
	sName = sName.replace(':', '');
	jQuery('#SchoolName_field').val(sName);
	jQuery('SchoolName1').val(sName);
	jQuery('#SchoolName_fieldq').val(sName);
	jQuery('#SchoolName_fieldd').val(sName);
}


	
function setSchoolColor1() {	
	var sColor1 = jQuery('#primaryColor').val();
	sColor1 = sColor1.replace(';', '');
	sColor1 = sColor1.replace(':', '');
	//alert(sColor1);
	jQuery('#PrimaryColor_field').val(sColor1);
	jQuery('PrimaryColor1').val(sColor1);
	jQuery('#PrimaryColor_fieldq').val(sColor1);
	jQuery('#PrimaryColor_fieldd').val(sColor1);
}	

function setSchoolColor2() {	
	var sColor2 = jQuery('#secondaryColor').val();
	sColor2 = sColor2.replace(';', '');
	sColor2 = sColor2.replace(':', '');
	//alert(sColor2);
	jQuery('#SecondaryColor_field').val(sColor2);
	jQuery('SecondaryColor1').val(sColor2);
	jQuery('#SecondaryColor_fieldq').val(sColor2);
	jQuery('#SecondaryColor_fieldd').val(sColor2);
}
function setYouthQXS() {	
	var sYouthQXS = jQuery('#YouthQXS').val();
	//alert(sYouthQXS);
	jQuery('#Quantity_Youth_XS_field').val(sYouthQXS);
	jQuery('#Quantity_Youth_XS_fieldq').val(sYouthQXS);
	jQuery('#Quantity_Youth_XS_fieldd').val(sYouthQXS);
}

function setYouthQS() {	
	var sYouthQS = jQuery('#YouthQS').val();
	//alert(sYouthQS);
	jQuery('#Quantity_Youth_S_field').val(sYouthQS);	
	jQuery('#Quantity_Youth_S_fieldq').val(sYouthQS);	
	jQuery('#Quantity_Youth_S_fieldd').val(sYouthQS);	
}
function setYouthQM() {	
	var sYouthQM = jQuery('#YouthQM').val();
	//alert(sYouthQM);
	jQuery('#Quantity_Youth_M_field').val(sYouthQM);	
	jQuery('#Quantity_Youth_M_fieldq').val(sYouthQM);	
	jQuery('#Quantity_Youth_M_fieldd').val(sYouthQM);	
}
function setYouthQL() {	
	var sYouthQL = jQuery('#YouthQL').val();
	//alert(sYouthQL);
	jQuery('#Quantity_Youth_L_field').val(sYouthQL);	
	jQuery('#Quantity_Youth_L_fieldq').val(sYouthQL);	
	jQuery('#Quantity_Youth_L_fieldd').val(sYouthQL);	
}
function setYouthQXL() {	
	var sYouthQXL = jQuery('#YouthQXL').val();
	//alert(sYouthQL);
	jQuery('#Quantity_Youth_XL_field').val(sYouthQXL);	
	jQuery('#Quantity_Youth_XL_fieldq').val(sYouthQXL);	
	jQuery('#Quantity_Youth_XL_fieldd').val(sYouthQXL);	
}


function setAdultQS() {	
	var sAdultQS = jQuery('#AdultQS').val();
	//alert(sAdultQS);
	jQuery('#Quantity_Adult_S_field').val(sAdultQS);	
	jQuery('#Quantity_Adult_S_fieldq').val(sAdultQS);	
	jQuery('#Quantity_Adult_S_fieldd').val(sAdultQS);	
}
function setAdultQM() {	
	var sAdultQM = jQuery('#AdultQM').val();
	//alert(sAdultQM);
	jQuery('#Quantity_Adult_M_field').val(sAdultQM);	
	jQuery('#Quantity_Adult_M_fieldq').val(sAdultQM);	
	jQuery('#Quantity_Adult_M_fieldd').val(sAdultQM);	
}
function setAdultQL() {	
	var sAdultQL = jQuery('#AdultQL').val();
	//alert(sAdultQL);
	jQuery('#Quantity_Adult_L_field').val(sAdultQL);	
	jQuery('#Quantity_Adult_L_fieldq').val(sAdultQL);	
	jQuery('#Quantity_Adult_L_fieldd').val(sAdultQL);	
}
function setAdultQXL() {	
	var sAdultQXL = jQuery('#AdultQXL').val();
	//alert(sAdultQL);
	jQuery('#Quantity_Adult_XL_field').val(sAdultQXL);	
	jQuery('#Quantity_Adult_XL_fieldq').val(sAdultQXL);	
	jQuery('#Quantity_Adult_XL_fieldd').val(sAdultQXL);	
}
function setAdultQ2XL() {	
	var sAdultQ2XL = jQuery('#AdultQ2XL').val();
	//alert(sAdultQL);
	jQuery('#Quantity_Adult_2XL_field').val(sAdultQ2XL);	
	jQuery('#Quantity_Adult_2XL_fieldq').val(sAdultQ2XL);	
	jQuery('#Quantity_Adult_2XL_fieldd').val(sAdultQ2XL);	
}

function setNotes() {	
	var cst_notes = jQuery("textarea#cust_notes").val();
	//alert(cst_notes);
	jQuery("textarea#cst_notes").text(cst_notes);	
	//alert(jQuery("textarea#cst_notes").text());
}

jQuery(".orderNowBtn").click(function() {
//school info
	jQuery('#SchoolName_field').val(jQuery('#schoolName').val());
	jQuery('#PrimaryColor_field').val(jQuery('#primaryColor').val())
	jQuery('#SecondaryColor_field').val(jQuery('#secondaryColor').val())
// these are for the quantity fields
//adult
	jQuery('#Quantity_Adult_2XL_field').val(jQuery('#AdultQ2XL').val());
	jQuery('#Quantity_Adult_XL_field').val(jQuery('#AdultQXL').val());	
	jQuery('#Quantity_Adult_L_field').val(jQuery('#AdultQL').val());
	jQuery('#Quantity_Adult_M_field').val(jQuery('#AdultQM').val());
	jQuery('#Quantity_Adult_S_fieldd').val(jQuery('#AdultQS').val());
//youth
	jQuery('#Quantity_Youth_XL_field').val(jQuery('#YouthQXL').val());	
	jQuery('#Quantity_Youth_L_field').val(jQuery('#YouthQL').val());
	jQuery('#Quantity_Youth_M_field').val(jQuery('#YouthQM').val());
	jQuery('#Quantity_Youth_S_fieldd').val(jQuery('#YouthQS').val());
	jQuery('#Quantity_Youth_XS_field').val(jQuery('#YouthQXS').val());
//notes
	jQuery('#cst_notes').val(jQuery('#cust_notes').val());
	
 });

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}


//----------------------------------------------------slider page code ----------------------------------


jQuery().ready( function() {
				jQuery('#coda-slider-1').codaSlider( {
				autoHeight: false,
				firstPanelToLoad: 1,
				dynamicArrows: false,
				dynamicTabs: false				
				});
				
			});

//----------------------------------------------------flip div code ----------------------------------
		
	var theInt = null;
		var jQuerycrosslink, jQuerynavthumb;
		var curclicked = 0;
		
		theInterval = function(cur){
			clearInterval(theInt);
			
			if( typeof cur != 'undefined' )
				curclicked = cur;
			
			jQuerycrosslink.removeClass("active-thumb");
			jQuerynavthumb.eq(curclicked).parent().addClass("active-thumb");
				jQuery(".stripNav ul li a").eq(curclicked).trigger('click');
			
			theInt = setInterval(function(){
				jQuerycrosslink.removeClass("active-thumb");
				jQuerynavthumb.eq(curclicked).parent().addClass("active-thumb");
				jQuery(".stripNav ul li a").eq(curclicked).trigger('click');
				curclicked++;
				if( 6 == curclicked )
					curclicked = 0;
				
			}, 5000);
		};
		
		jQuery(function(){
			
			jQuery("#main-photo-slider").codaSlider();
			
			jQuerynavthumb = jQuery(".nav-thumb");
			jQuerycrosslink = jQuery(".cross-link");
			
			jQuerynavthumb
			.click(function() {
				var jQuerythis = jQuery(this);
				theInterval(jQuerythis.parent().attr('href').slice(1) - 1);
				return false;
			});
			
			theInterval();
		});
		
		
