function AddToCrate(name,val) {
obj=document.forms[name];
obj.vwquantity.value=val;
obj.submit();
}
function enlarge(url,imgw,imgh) {
var leftPos = (screen.availWidth-900) / 2;
var topPos = (screen.availHeight-600) / 2;
window.open(url, 'EnlargePicture','width='+imgw+',height='+imgh+',scrollbars=no,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function makePoUp(url,imgw,imgh) {
var leftPos = (screen.availWidth-900) / 2;
var topPos = (screen.availHeight-600) / 2;
window.open(url, 'EnlargePicture','width='+imgw+',height='+imgh+',scrollbars=1,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function calcPer() {
price=price.split('$')[1];
price=eval(price);
saleprice=saleprice.split('$')[1];
saleprice=eval(saleprice);
x=100-((saleprice*100)/price);
document.write(Math.round(x)+'%');
}
function calcdoubles(prval) {
prval=prval.split('$')[1];
prval=eval(prval);
document.write('$'+prval*2);
}
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if (!GetCookie('rotate')) {
SetCookie('rotate', 1, expdate);
}
curr=eval(GetCookie('rotate'));
var curr1;
var curr2;
function getMod(x,y) {
return x-(Math.floor(x/y)*y);
}
function PasteItems() {
setval=curr;
curr1=curr+1;
if (Items[curr]) {
document.write(Items[curr]);
((Items[curr1])?(''):(curr1=1));
document.write(Items[curr1]);
curr2=curr1+1;
((Items[curr2])?(''):(curr2=1));
document.write(Items[curr2]);
curr=eval(curr);
curr=curr2+1;
SetCookie('rotate', curr, expdate);
}
else {
document.write(Items[1]);
((Items[2])?(document.write(Items[2])):(''));
((Items[3])?(document.write(Items[3])):(''));
SetCookie('rotate', 4, expdate);
}
}
function PasteItem(num) {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
cookievar='rotator'+num;
if (!GetCookie(cookievar)) {
	SetCookie(cookievar, 1, expdate);
	}
cur=eval(GetCookie(cookievar));
Items=eval('Items'+num);
if (Items[cur]) {
	document.write(Items[cur]);
	cur=cur+1;
	SetCookie(cookievar, cur, expdate);
	}
	else {
		if (Items[1]) {
		document.write(Items[1]);
		SetCookie(cookievar, 2, expdate);
		}
	}
}



