var num=1;

function perLoadImages() {
	var myImages = new Array();
	for (var i=0; i < total; i++) {
		var j = i+1;
		myImages[i] = new Image();
		myImages[i].src = "image/"+directory+"/"+j+".jpg";
	}
}
function clickNum(current) {
	document.getElementById('img12').src = "image/"+directory+"/"+current+".jpg";
	for (var i=0; i< total; i++) {
			var j = i+1;
			var id = 'num'+j;
			if (j == current) {
				document.getElementById(id).style.background = '#5c5c5c';
			}else{
				document.getElementById(id).style.background = 'none';
			}
	}
	
	num = current;
}
/*
function switch_bgcolor1(urls)
{
	switchoff_bgimage("num2");
	switchoff_bgimage("num3");
	switchoff_bgimage("num1");
	switchoff_bgimage("num4");
	switchoff_bgimage("num5");
	obj4=document.getElementById("img12");
	obj4.src="image/yaoshang/"+urls+".jpg";
	obj3=document.getElementById("num"+urls);
	obj3.style.background="#5c5c5c";
	num = urls;
}
function switchoff_bgimage(id)
{
	
	obj3=document.getElementById(id);
	obj3.style.background='none';
}
*/

function nextframe(){

	if(num<total)	{
		num++;
		clickNum(num);
	}
}
function prevframe(){

	if(num>1)	{
		num--;
		clickNum(num);
	}
}
function openwind(url,w ,h) {
window.open(url,"_blank","scrollbar=no,toolbar=no,location=no,width="+w+",height="+h+",status=no,menubar=no,resizable=yes,scrollbars=no");
}
function openwindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function switch_menu(text) {
	document.getElementById("menutext").innerHTML=text;

}
