//****************************************************************************************************************
//** Page Name		: scripts.js
//** Description	: Client side scripting functions
//** Comment			: 
//** Author				: Jason Sammon
//** Last Revised	: 08/11/2005
//****************************************************************************************************************
function addToCart(returnurl, contentpageid, categoryid, productid, variationid, quantity, price, description)
{	
	var url = 'cart.aspx?cp='+contentpageid+'&action=addtocart&ru='+returnurl+'&catid='+categoryid+'&itemname=&quantity='+quantity+'&price='+price+'&itemid='+productid+'&itemvar1id='+variationid;
	//alert(url);
	
	location.href = url;	
}

function openPopup(url) 
{
	var myWin=open(url,"popup","top=100,left=200,width=720,height=388,status=no,toolbar=no,menubar=no,scrollbars=yes"); 
        return 1;
} 

function openWindow(url, options, width, height) 
{
	var nLeft = ((screen.width / 2) - (width / 2));	
	var nTop = ((screen.height / 2) - (height / 2));	
	var myWin=open(url,"popup",options + ",width="+width+",height="+height+",left="+nLeft+",top="+nTop); 
   return 1;
} 
 
function onUpdatePrices()
{
	document.mainform.submit();
}

//this is an email enkoder from Hiveware http://www.hiveware.com
function emailEnquiries(){var i,j,x,y,x=
"x=\"1Yx'7=\\\"f'23=6f,cyi6;64(4\\\\r7\\\"\\\\ct\\\\ys6799b;xu6641s.l.670dx" +
"e6+62x2'(7%2fnc'i6(59mde.6p3ch6at6c69a5sM6e60=\\\\\\\"j3\\\\\\\\b(nur3=x9o" +
"0\\\\f2\\\"=2{x\\\\)2\\\\\\\\e1\\\\\\\\43\\\"\\\\1=\\\\3+66\\\\fi\\\\\\\\;" +
"2\\\\bchf6t33\\\\bg\\\"\\\\n6\\\\4c.x\\\\x6\\\\\\\\9=\\\\;+6=\\\\2y\\\"\\\\"+
"{6\\\\yf)=\\\\;6\\\\\\\\di\\\\2=6''0>6fj4;71-6d-750e;60)62951414674e+7ei3y" +
"}2,65h2;)ct6ag5)i4nc3e6;hcl22.stgbu82s.nex=56x;l.))470(x<tA96rai;hc27.x0=(" +
"l77avi(e=e2j;ro\\\\\\\"47;yf;=+e6}}''y{56;)=y67d6j(;\\\\79\\\\\\\\tA\\\\57" +
"47hra7379;ihc61of+=};64)283,i7e(r){ts6fbufos.63x=r(+y42{)j=4=2c+iMa;h5dtgt" +
"hne35l..mx<27i;in0=86i(()ro02f;2=''16=y+r;)741(Atrt76;)(jj(\\\\\\\\rt\\\\\\"+
"\\sb\\\\\\\\us\\\\\\\\.y);=y\\\\\\\"};\\\\\\\\)2\\\\\\\\,i\\\\\\\\(r}}ts=x" +
"bufos.79x=r(+y6c{)i=4=69+i0;;h62tgi<ne6fl.x.x<6di;le2=40i(ngr\\\"24;ytn='2" +
"2';gtfo2cr(h,i=5b0;i+i<65x.83le7eng);th2f;i--+=6356j>){6efo=ir(24j=;)Ma6ct" +
"h{y.m62in+=(x7f.lx.en67gtchh,79i+a6565e);l7--e.j>x2=if<;)i6{y3;+=06x.e=chi" +
"2ar4(Atr6(jco);f6}}2;y;\";j=eval(x.charAt(0));x=x.substr(1);y='';for(i=0;i" +
"<x.length;i+=4){y+=x.substr(i,2);}for(i=2;i<x.length;i+=4){y+=x.substr(i,2" +
");}y=y.substr(j);";
while(x=eval(x));}


function doPriceMatch(productUrl)
{
    var url = './PriceMatch.aspx?producturl=' + productUrl;
    openWindow(url, 'status=no,toolbar=no,menubar=no,scrollbars=yes', 770, 580);
}