<!--
var ssmid_old="";
var ssid_old="";
var co_menuClassID_old="";
var grNumber="start";
var grNumberMax="";
var co_menuID_old="";

function SetLayer(LName,funct,wert){
	if (document.getElementById){
		var newLayer = document.getElementById(LName).style;
		newLayer[funct]=wert;
	}
}

function showSSMenu(ssmid,smid){
	ssmid=ssmid;
	smid=smid;
	if (ssmid_old!="" && ssmid_old!=ssmid){
		SetLayer(ssmid_old,"display","none");
		if (smid_old!="" && smid_old!=smid){
			document.getElementById(smid_old).className="";
		}
	}
	SetLayer(ssmid,"display","block");
	document.getElementById(smid).className="act";
	ssmid_old=ssmid;
	smid_old=smid;
}

function ShowPic(grName,grNumber2){
	grNumber=grNumber2;
	//alert(grNumber);
	document.content_gr.src=grName;
}

function SetgrNumberMax(grNumberMax2){
	grNumberMax=grNumberMax2;
	//alert(grNumberMax);
}


function WriteText(textContent){
	//document.getElementById("co_text").innerHTML=textContent+'<br/><input name="B1" value="Find out More" type="button" class="zinButton" onMouseOver="this.style.background-color:#FF7777;" onMouseOut="this.style.background-color:#EE7777;" onclick="window.open(\'http://www.zinhome.com/alatin/mail_form.php?item_info=\'+\''+textContent+'\',\'mywindow\',\'width=600,height=450\');">';
	document.getElementById("co_text").innerHTML=textContent+'<br/><input name="B1" value="Find out More" type="button" class="zinButton" onclick="window.open(\'http://www.zinhome.com/alatin/mail_form.php?item_info=\'+\''+textContent+'\',\'mywindow\',\'width=600,height=450\');">';

}

function WriteContent(coID,coTEXT){
	if (document.getElementById){
		document.getElementById(coID).innerHTML=coTEXT;
		comenu="";
	}
}

function WriteCO_MENU(co_menuID,co_menuClassID){
	SetgrNumberMax(eval(co_menuID).length);
	if (co_menuID_old!="" && co_menuID_old!=co_menuID){
		grNumber="start";
		classID_old="";
	}
	
	comenu='<div id="arrow_left"><a href="#" onclick="PrevPic(\''+co_menuID+'\');"><b>-</b></a></div>';
	
	for (i=1; i<eval(co_menuID).length+1; i++){
		comenu+='<div id="n'+i+'" class="number"><a href="#" onclick="ShowPic(\''+eval(co_menuID)[i-1]+'\','+(i-1)+','+(eval(co_menuID).length)+');WriteText(\''+eval(co_menuID+"_text")[i-1]+'\');ChangeClass(\'n'+i+'\');return false;"><b>'+i+'</b></a></div>';
	}
	comenu+='<div id="arrow_right"><a href="#" onclick="NextPic(\''+co_menuID+'\');"><b>+</b></a></div>';
	WriteContent("co_menu",comenu);
	
	co_menuClassID=co_menuClassID;
	if (co_menuClassID_old!="" && co_menuClassID_old!=co_menuClassID){
		document.getElementById(co_menuClassID_old).className="ssm";
	}
	document.getElementById(co_menuClassID).className="ssm act";
	co_menuClassID_old=co_menuClassID;
	
	// added by Jay, this will make the first click change to the first image.
	NextPic(co_menuID);

	co_menuID_old=co_menuID;
}

function PrevPic(co_menuID){
	if (grNumber=="" || grNumber==0){
	
	}
	else {
		ShowPic(eval(co_menuID)[grNumber-1],grNumber-1);
		WriteText(eval(co_menuID+"_text")[grNumber]);
		ChangeClass('n'+eval(grNumber+1));
	}
}

function NextPic(co_menuID){
	if (grNumber+1>=grNumberMax){
	
	}
	else
	if (grNumber=="start"){
		ShowPic(eval(co_menuID)[0],eval(0));
		WriteText(eval(co_menuID+"_text")[0]);
		ChangeClass('n1');
	}
	else {
		ShowPic(eval(co_menuID)[grNumber+1],grNumber+1);
		WriteText(eval(co_menuID+"_text")[eval(grNumber)]);
		ChangeClass('n'+eval(grNumber+1));
	}
}

classID_old="";

function ChangeClass(classID){
	if (classID_old!="" && classID_old!=classID){
		document.getElementById(classID_old).className="number";
	}
	document.getElementById(classID).className="number_act";
	classID_old=classID;
}
//-->
