google.load("jquery","1.4.2");

google.setOnLoadCallback(function(){
	
	$.ajaxSetup({async: false});
	$.getScript("inc/curvycorners.js");
	$.ajaxSetup({async: true});
	
	$.ajaxSetup({async: false});
	$.getScript("inc/jquery.colorbox.js");
	$.ajaxSetup({async: true});
	
    curvyCorners({
	  tl: { radius: 20 },
      tr: { radius: 20 },
      bl: { radius: 20 },
      br: { radius: 20 },
      antiAlias: true}, document.getElementById("leftSide"));	
	
	curvyCorners({
	  tl: { radius: 20 },
      tr: { radius: 20 },
      bl: { radius: 20 },
      br: { radius: 20 },
      antiAlias: true}, document.getElementById("rightSide"));
	
	$("#sideBar .container").height($("#content").height());
	
	modelNum="";
	productPrice="";
	brochureLink="";
	productIMG="";
	urlSend="";
	
	$("#productList li").colorbox({
								  
		onOpen:function(){
			
				modelNum=$(this).children(".modelNum").html();
				productName=$(this).children("h4").html();
				productPrice=$(this).children(".price").html();
				brochureLink=$(this).children(".brochureLink").html();
				productIMG=$(this).children("img").attr("src");
				
				escapedName=escape(productName);
				productSku=modelNum.substr(1,modelNum.length);
				prodPrice=productPrice.substr(1,productPrice.length);
				
				urlSend=('productdisplay.html?modelNum='+modelNum+'&productPrice='+productPrice+'&brochureLink='+brochureLink+'&productIMG='+productIMG);
				
				$("#productInfo").html('<div id="productDetails"><table border="0" cellspacing="0" cellpadding="0" width="100%" height="200"><tr><td valign="middle" align="center"><img src="'+productIMG+'" class="productImage"></td><td valign="top" align="center"><div class="sideInfo"><span>'+productPrice+'</span><p>'+modelNum+'</p><p><a href="'+brochureLink+'">Download Brochure</a></p></div></td></tr></table><h4>'+productName+'</h4><a href="http://www.rvpoweroutlet.com/cgi-bin/commerce.cgi?add=action&key='+escape(modelNum)+'" target="_blank" class="buyNowButton"><img src="images/buynow.png" border="0"></a></div>');
			
			},

		inline:true,
		href:"#productInfo",
		opacity: 0.7,
		width: "50%",
		height: "400px"
		
	});
	
	
	/*$(".example9").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});*/
	
	if($("body").height()<$(window).height()) { $("body").height($(window).height()); }
	
	
});
