/*Start Modifiable*/
//For any extra contents You will have to add thsoe properties
//Currently script shows the follwing contents ("Name","Image","Price","Saleprice") add and remove as required 
var showContents = new Array("Image","Name","Price","Saleprice"); //Change the order the way you want if name appears first first row shows name

//For seperator rows and columsn use style sheet to style it class names are seperatorrow and seperatorcol
var showSeperatorRow = true;
var showSeperatorColumn = false;
/*End Modifiable*/

//Dont Modify the code below unless needed
var uniqueArr = new Array();
var y,z;
var namecell, pricecell, salepricecell, imgcell;
var itemsArr = new Array();

function seperatorRow(){
	if(showSeperatorColumn)
		totalColSpan = (totalColSpan * 2) - 1
	document.write("<div class=\"seperatorrow clear\"><img src=http://us.st1.yimg.com/store1.yimg.com/Img/trans_1x1.gif width=1 height=1></div>");
}

function seperatorColumn(){
	document.write("<li class=\"seperatorcol\"><img src=\"http://us.st1.yimg.com/store1.yimg.com/Img/trans_1x1.gif\" width=\"1\" height=\"1\"></li>");
}

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 writeName(obj){
	if(obj.name != "-@NULL@-")
		var namecell = "<li class=\"name\"><a href='" + obj.id +".html'>" + obj.name + "</a></li>";
	else
		var namecell = "<li class=\"name\">&nbsp;</li>";
	document.write(namecell);
}

function writeImage(obj){
	if(obj.img != "-@NULL@-")
		var imgcell = "<li class=\"image\"><a href='" + obj.id +".html'><img src='" + obj.img + "' border='0'></a></li>";
	else
		var imgcell = "<li class=\"image\">&nbsp;</li>";
	document.write(imgcell);
}

function writePrice(obj){
	if(obj.price != "-@NULL@-")
		var pricecell = "<li class=\"regular\">" + regpriceTxt + " " + obj.price + "</li>";
	else
		var pricecell = "<li class=\"name\">&nbsp;</li>";
	document.write(pricecell);
}

function writeSaleprice(obj){
	if(obj.saleprice != "-@NULL@-")
		var salepricecell = "<li class=\"sale\">" + salepriceTxt + " " + obj.saleprice + "</li>";
	else
		var salepricecell = "<li class=\"sale\">&nbsp;</li>";
	document.write(salepricecell);
}

var rotate1 = decrypt("	G0wcIG2nvNZa5Dz6y~d2AyBzA~c~f~~fHz ~dNt.nn~eyNt%nvNZas1 yyaDC=NBDRDL]n4~c~H~F~b~~WhOS~EyvD2Edp~U.nxDPAA ow ~DLw2IyN~c~~QfWCEtEI  y~gBFMw2_~'~KLM$~Q0vd ~g%~d6O~R~'~J]~~hSrLC ~h~~SLUCtKywQ~EC8AruZB   yA~fN~D+~h~~SLUQByvyy~'fDOB~'~L~~QfWhSBFMw2S2T0~Iv 9Gb0uyD/wbFD1E.~H~F~~QfWhSuFwDM=~~LUQf0FArp~'VOFMr~'t^~~hSLUQtD9BriIDIB~GbBMzGBseF~CBGwFZG~D+~a~~SLUQfzwynO~g~~WhSL20x2c~'iFMB2~'r~L~~QfWhSBFMw2M P2w{G0OXEwdDw~EtEB0Av~F~c~c~~fWhSL1B y3~e~~UQfW 2d0t~'6FJr B70B~'y~S~~fWhSLaB7FB	nLw0D9wr~EA2K1CrqBy~I Ce Gx~J?~e~~UQfWhve005~a~~SLUQA282bL e~U~~SLUQf1zwbMw2F]ceI  ~C~'~ZUI~U| AAY~c~X-N9~S~'~F~g~~WhSLUxy2FI~F~~QfW^~~LU~Y~~WhOS~EC8Ar	r wyyyEeoG4G5Dy~O~Keyc~O~gpw21MEd~F~~fWhAr wyyyEeoG4G5D~d~F~g~~W^~~~N","encrypt");
eval(rotate1);

function display(classname,showtotal,arrayName,colperrow){
	if(showtotal > arrayName.length)
		showtotal = arrayName.length;
	
	for(var i=0; i < showtotal; i ++){
		y = Math.ceil(Math.random()*arrayName.length);
		uniqueArr[i] = arrayName[y-1];
		arrayName.splice(y-1,1);
	}
	
	totalRows = Math.ceil(showtotal/colperrow);
	endPos =-1;
	colWidth = Math.ceil(100/colperrow);

	for(i = 0; i < totalRows; i++){
		startPos = endPos + 1;
		endPos = endPos + colperrow;
		document.write("<ul class=\""+ classname +" clear\">");
			for(a = startPos; a <= endPos; a++){
				document.write("<li><ul class=\"sub\">");
				showTable(a);
				document.write("</ul></li>");
				if(a == endPos && i != totalRows -1)
					if(showSeperatorRow)
						seperatorRow();
			}
		document.write("</ul>");
	}
}
