function ProductObject(name, price, pageURL, orderURL, picURL, captionURL, captionbackURL, liststyle, backcolor){
	this.name=name;
	this.price=price;
	this.pageURL=pageURL;
	this.orderURL=orderURL;
	this.picURL=picURL;
	this.captionURL=captionURL;
	this.captionbackURL=captionbackURL;
	this.liststyle=liststyle;
	this.backcolor=backcolor;
}

ejigsaw=new ProductObject("Everyday Jigsaw", "$9.95", "/puzzle-games/everyday-jigsaw", "http://kraisoft.com/store/order.htm?product=ejigsaw&calendar=1", "../images/ejigsaw/ejigsawpic.jpg", "../images/ejigsaw/ejigsawcaption.gif", "../images/ejigsaw/ejigsawback.gif", "ejigsawlist", "#4D3F85");
atom2=new ProductObject("Atomaders 2", "$19.95", "/arcade-games/atomaders-2", "http://kraisoft.com/store/order.htm?activation=full&product=atom2", "../images/atom2/atom2pic.jpg", "../images/atom2/atom2caption.gif", "../images/atom2/atom2back.gif", "atom2list", "#DBCBC8");
boom=new ProductObject("Boom Voyage", "$19.95", "/arcade-games/boom-voyage", "http://kraisoft.com/store/order.htm?activation=full&product=boom", "../images/boom/boompic.jpg", "../images/boom/boomcaption.gif", "../images/boom/boomback.gif", "boomlist", "#FEF4A0");
fluff=new ProductObject("Fluff 'em Up", "$19.95", "/puzzle-games/fluff-em-up", "http://kraisoft.com/store/order.htm?activation=full&product=fluff", "../images/fluff/fluffpic.jpg", "../images/fluff/fluffcaption.gif", "../images/fluff/fluffback.gif", "flufflist", "#A0F894");
rjp=new ProductObject("Real Jigsaw Puzzle", "$19.95", "/puzzle-games/real-jigsaw-puzzle", "http://kraisoft.com/store/order.htm?activation=full&product=rjp", "../images/rjp/rjppic.jpg", "../images/rjp/rjpcaption.gif", "../images/rjp/rjpback.gif", "rjplist", "#D7ABA2");
asea=new ProductObject("Asea", "$19.95", "/puzzle-games/asea", "http://kraisoft.com/store/order.htm?activation=full&product=asea", "../images/asea/aseapic.jpg", "../images/asea/aseacaption.gif", "../images/asea/aseaback.gif", "asealist", "#BDE8AE");
aqua=new ProductObject("Aquacade", "$19.95", "/puzzle-games/aquacade", "http://kraisoft.com/store/order.htm?activation=full&product=aqua", "../images/aqua/aquapic.jpg", "../images/aqua/aquacaption.gif", "../images/aqua/aquaback.gif", "aqualist", "#98E8FC");
asia=new ProductObject("Asianata", "$19.95", "/puzzle-games/asianata", "http://kraisoft.com/store/order.htm?activation=full&product=asia", "../images/asia/asiapic.jpg", "../images/asia/asiacaption.gif", "../images/asia/asiaback.gif", "asialist", "#FFEB9B");
isle=new ProductObject("ABC Island", "$19.95", "/puzzle-games/abcisland", "http://kraisoft.com/store/order.htm?activation=full&product=isle", "../images/aend/aendpic.jpg", "../images/isle/islecaption.gif", "../images/isle/isleback.gif", "aendlist", "#D9AEAE");
aend=new ProductObject("After The End", "$19.95", "/action-games/aftertheend", "http://kraisoft.com/store/order.htm?activation=full&product=aend", "../images/aend/aendpic.jpg", "../images/aend/aendcaption.gif", "../images/aend/aendback.gif", "aendlist", "#CBC5B4");
asky=new ProductObject("Alien Sky", "$19.95", "/action-games/asky", "http://kraisoft.com/store/order.htm?activation=full&product=asky", "../images/asky/askypic.jpg", "../images/asky/askycaption.gif", "../images/asky/askyback.gif", "askytrianglelist", "#84A6BD");
atom=new ProductObject("Atomaders", "$19.95", "/arcade-games/atomaders", "http://kraisoft.com/store/order.htm?activation=full&product=atom", "../images/atompic.jpg", "../images/atomaders/atomcaption.gif", "../images/atomaders/atomback.gif", "atomlist", "#FF9860");
batics=new ProductObject("Astrobatics", "$19.95", "/action-games/batics", "http://kraisoft.com/store/order.htm?activation=full&product=batics", "../images/baticspic.jpg", "../images/batics/baticscaption.gif", "../images/batics/baticsback.gif", "baticslist", "#A0E8FC");
wark=new ProductObject("Warkanoid", "$19.95", "/arcade-games/warkanoid1", "http://kraisoft.com/store/order.htm?activation=full&product=wark1", "../images/wark1pic.jpg", "../images/wark1/wark1caption.gif", "../images/wark1/wark1back.gif", "wark1list", "#A8D8E8");
wark1=new ProductObject("Warkanoid", "$19.95", "/arcade-games/warkanoid1", "http://kraisoft.com/store/order.htm?activation=full&product=wark1", "../images/wark1pic.jpg", "../images/wark1/wark1caption.gif", "../images/wark1/wark1back.gif", "wark1list", "#A8D8E8");
wark2=new ProductObject("Warkanoid II: WildLife", "$19.95", "/arcade-games/warkanoid2", "http://kraisoft.com/store/order.htm?activation=full&product=wark2", "../images/wark2pic.jpg", "../images/wark2/wark2caption.gif", "../images/wark2/wark2back.gif", "wark2list", "#B8FF40");
wark3=new ProductObject("Warkanoid 3: Story-book", "$19.95", "/arcade-games/warkanoid3", "http://kraisoft.com/store/order.htm?activation=full&product=wark3", "../images/wark3pic.jpg", "../images/wark3/wark3caption.gif", "../images/wark3/wark3back.gif", "wark3list", "#FFD52B");
other=new ProductObject("KraiSoft games", "$19.95", "../games", "/store", "../images/baticspic.jpg", "../images/storecaption.gif", "../images/storeback.gif", "storelist", "#C6EAC8");

asky_softonic=new ProductObject("Alien Sky", "$19.95", "/action-games/asky", "https://comercio.softonic.com/pv/546", "../images/asky/askypic.jpg", "../images/asky/askycaption.gif", "../images/asky/askyback.gif", "askytrianglelist", "#84A6BD");


function getProductObject(){
  var args=parseQueryString();
  product=other;
  product_field=args["product"]=="wark" ? "wark1" : args["product"];
  product=product_field.length>0 ? eval(product_field) : other;
  if(args["rnaffid"]){product.orderURL+="&rnaffid="+args["rnaffid"];}
}

function storePreselect(){
  productsSelected=0;
  var args=parseQueryString();
  selectedProduct=args["product"]=="wark" ? "wark1" : args["product"];
  selectedProduct=selectedProduct ? eval("document.product_selection.product_"+selectedProduct) : "";
  
  for(j=0;j<product_selection.length;j++){
    product=product_selection[j];
	if(product.type=="checkbox"){
		if((product.checked==true)||(product.id==selectedProduct.id)){
		  product.checked=true;
		  setDiscount(product)
		}
	}
  }
  
  if(args["rnaffid"]){document.product_selection.affid.value=args["rnaffid"]}
}

function setProductDiscount(product, state){
	if (state==true){
		eval("price_"+product+".style.fontWeight='normal'");
		eval("price_"+product+".style.textDecoration='line-through'");
		eval("disc_"+product+".style.visibility='visible'");
		eval("result_"+product+".style.visibility='visible'");
	}
	else{
		eval("price_"+product+".style.fontWeight='bold'");
		eval("price_"+product+".style.textDecoration='none'");
		eval("disc_"+product+".style.visibility='hidden'");
		eval("result_"+product+".style.visibility='hidden'");
	}
}

function setDiscount(checkedProduct){
	if(checkedProduct.checked==true){
		productsSelected++;
		if (productsSelected>1){document.product_selection.stored.value="3792"}
		for(i=0;i<product_selection.length;i++){
			if(product_selection[i].type=="checkbox"){
				product=product_selection[i].id;
				if(product!=checkedProduct.id){setProductDiscount(product, true)}
			}
		}
	}
	else{
		productsSelected--;
		if (productsSelected<2){document.product_selection.stored.value="1"}
		if(productsSelected<1){
			for(i=0;i<product_selection.length;i++){
				if(product_selection[i].type=="checkbox"){
					product=product_selection[i].id;
					setProductDiscount(product, false)
				}
			}
		}
		if(productsSelected==1){
		 	for(i=0;i<product_selection.length;i++){
				if((product_selection[i].type=="checkbox")&&(product_selection[i].checked)){
					product=product_selection[i].id;
					setProductDiscount(product, false)
				}
			}
		}
	}	
}


