function scMultiAdd(which, thisel){
var value = parseInt(thisel.value);
	if(which == 'focus'){
		if(value == 0){
			thisel.value = '';
		}
	}
	if(which == 'blur'){
		if(value < 0 || isNaN(value) || value == ''){
			thisel.value = '0';
		}
	}
}

sfHover = function() {	
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(/sfhover/g, "")
		}
	}
}

try{
	document.execCommand('BackgroundImageCache', false, true);
}catch(e){}

function containsTestimonial(tmp, newid) {
	for(x=0;x<tmp.length;x++){
		if(tmp[x]==newid){
			return true;
		}
	}
	return false;
}

function scTestimonials(){
var testimonialsContainer = document.getElementById('testimonialsContainer');
var testimonialsContainerDivs = testimonialsContainer.getElementsByTagName('div');
var testimonialsContainerDivsLen = testimonialsContainerDivs.length;
var divPos = 0;
var divCnt = 0;
var testimonialsToShowLocal = ((window.testimonialsToShow) ? testimonialsToShow : 1)
var newid = new Array();
	while(divPos < testimonialsContainerDivsLen){
		if(testimonialsContainerDivs[divPos].id.indexOf('scTestimonials') > -1){
			divCnt += 1;
		}
		divPos++;
	}
	if(divCnt > 0){
		if(testimonialsToShowLocal == 1){
			var c = Math.floor(Math.random()*divCnt);
			if(document.getElementById('scTestimonials'+c)){
				document.getElementById('scTestimonials'+c).style.display = 'block'
			}
		}else{
			var tPos = 0;
			while(tPos < divCnt){
				var c = Math.floor(Math.random()*divCnt);
				if(!containsTestimonial(newid, c)){
					newid.push(c);
					if(document.getElementById('scTestimonials'+c)){
						document.getElementById('scTestimonials'+c).style.display = 'block'
					}
					if(newid.length == testimonialsToShowLocal){
						break;
					}
				}
				tPos++;
			}
		}
	}
}

function messageBgRotate(){
var messageDiv = document.getElementById('messageBgRotate');
	if(messageDiv){
		var img0 = '/lib/thetoyhunt/monkey-bg.gif';
		var img1 = '/lib/thetoyhunt/elephant-bg.gif';
		var img2 = '/lib/thetoyhunt/zebra-bg.gif';
		var c = Math.floor(Math.random()*3);
		messageDiv.style.backgroundImage = 'url('+eval('img'+c)+')';
	}
}

// JavaScript Document
/*Start Modifiable*/
//Currently script shows the follwing contents ("Name","Image","Price","Saleprice") add and remove as required 
//For any extra contents You will have to add thsoe properties
//If you have image seperator then assign it to variable bgColImag and bgRowImage
var showContents = new Array("Image","Name","Price","Saleprice");
/*var regpriceTxt = "Sug. Retail";
var salepriceTxt = "Your Price";*/
var showSeperatorRow = false;
var showSeperatorColumn = false;
var seperatorRowBgColor = "#FFF";
var seperatorColBgColor = "#FFF";
/*End Modifiable*/
//Dont Modify the code below unless needed
var uniquearr = new Array();
var y,z;
var duplicate=false;
var namecell, pricecell, salepricecell, imgcell;
var itemsArr = new Array();

function seperatorRow(totalColSpan){
	if(showSeperatorColumn)
		totalColSpan = (totalColSpan * 2) - 1
	document.write("<tr><td colspan='" + totalColSpan + "' bgcolor='" + seperatorRowBgColor + "'>");
	document.write("<img src=http://us.st1.yimg.com/store1.yimg.com/Img/trans_1x1.gif width=1 height=1>");
	document.write("</td></tr>");
}

function seperatorColumn(totalRowSpan){
	document.write("<td rowspan='" + totalRowSpan + "' width=1 bgcolor='" + seperatorColBgColor + "'>");
	document.write("<img src=http://us.st1.yimg.com/store1.yimg.com/Img/trans_1x1.gif width=1 height=1>");
	document.write("</td>");
}

function itemObj(id, name, img, price, saleprice) {
	this.id=id.toLowerCase();
	this.name=name;
	this.img=img;
	this.price=price;
	this.saleprice=saleprice;
	itemsArr[itemsArr.length] = this;
}
function writeImage(obj,colWidth){
var imgcell = ''
	if(obj.img != "-@NULL@-")
		imgcell += '<div id="rotateImg"><a href="' + obj.id + '.html"><img alt="' + obj.name.replace(/\"/g, "'") + '" src="' + obj.img + '" border="0"></a></div>';
	document.write(imgcell);
}
function writeName(obj,colWidth){
var namecell = ''		
	if(obj.name != "-@NULL@-")
		namecell += '<div id="rotateName"><a href="' + obj.id +'.html">' + obj.name + "</a></div>";
		
	if(obj.price != "-@NULL@-")
		namecell += '<div id="'+((obj.saleprice != "-@NULL@-") ? 'rotateRegPrice' : 'rotatePrice')+'">' + ((obj.saleprice != "-@NULL@-") ? rotatePriceTxt : 'Price') + ": " + obj.price + "</div>";
		
	if(obj.saleprice != "-@NULL@-")
		namecell += '<div id="rotateSaleprice">' + ((obj.price != "-@NULL@-") ? rotateSalePriceTxt : 'Price') + ": " + obj.saleprice + "</div>";
		
	document.write(namecell);
}
if(window.decrypt){
	var disp = decrypt("	G0wcIG2nCOd HDa_BZD0426yTG~hxJzccC DN-2eF0rlFKr~dy1N2yeFGt~D`~~Ldt.nn~e~~UM	~CvNZa 1FFJy~YtDDw2 j032]JrBOwJ?~~LUC8ArBZD04n;rnFBDaS2T0~e420McH~g~~WrNPLwe~Cor~V~JtxJzccC DN?~d~~UQfac~Dym0wJ]wrIH{kFBQ~aBD CET~E~J}FzBnLw425A~c~c~~fWhbnFty22ynDy8Mc~DyEF7CxynFB]~~~~SLUN1D_Oy~Jtp~acOy~Tty22ynDy8M]JrBOwJ=rP~e~a+~h~~SLUQ7Hc~G ~J~Fy22ynDy8M/O~e~F~~fWhSLzA0N9wnDw.FwCr~c~~fWh~W~~~~QfW9Ly~EvvB6Otw  n;~DyDBv2?~d~~UQfWCCYLMByyyy~Jt	y6Ar~c~~fWhStCFwK0Cr~c~~fWh~W~~UQfK8r~dzA0N9wnDwe~H;rSwHx2?~d~~UQfWxDPAA yw ~fEF7CxynFB=NBDRDL;n;r ~c~~fWhSG~e~Fo~a~~SLU~Y~~W^~~LDGwy69ZaCe~HcgnDL=0BOU~EC8ArBZD04~d EU wyDzc~c~c~~f20xiCCe~H,Z~F~~QBA66Pz 8n;r9w 8~c yPL~Iocn~htCH02w Za~J]~~hLZF~I7n;rF~ct7n&rcC DNOEBG~geK'~c~c~f~~fWvBnF OAvr~gpw21MEdp~aed=~~LUw21MEdp~Fe20xiCCe~gcwZLD DwEB~c~~fWhxZ2A320B~DaB7FB~G~'~T y~W~'~H~F~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