function resizeimg(obj){
	if(obj.width > 600){
		obj.width = 600;
	}
}

function SetCookie(name,value){
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (7 * 24 * 60 * 60 * 1000 * 30));
	document.cookie = name + "=" + value + "; expires=" + expdate.toGMTString();
}

function LoadCookie(name,defaultValue){
	var cookieString = new String(document.cookie);
	var cookieHeader=name+'=';
	var i=cookieString.indexOf(cookieHeader);
	var strCookie='';
	if(i==-1){
		strCookie=defaultValue;	
	}
	else{
			var strCookie=cookieString.substring(i+ cookieHeader.length);
			if(strCookie.indexOf(';')!=-1)
				strCookie=strCookie.substring(0,strCookie.indexOf(';'));
			if(strCookie=='undefined')
				strCookie=defaultValue;		  
		}
	return strCookie
}
function Set(){
	if(document.getElementById("play").alt == "停止循环播放"){
		document.getElementById("play").src = "images/start_w.gif";
		document.getElementById("play").alt = "开始循环播放";
		SetCookie("playcookie","0");
		clearTimeout(IsPlay);
	}
	else{
		document.getElementById("play").src = "images/stop_w.gif";
		document.getElementById("play").alt = "停止循环播放";
		IsPlay = setTimeout("GoNextImage()",16000);
		SetCookie("playcookie","1");
	}
}
function GoNextImage(){
	if(NextUrl != ""){
		location.href = NextUrl;
	}
}
function CycPlay(){
	if(document.getElementById("play").alt == "停止循环播放"){
		IsPlay = setTimeout("GoNextImage()",16000);
	}
}
function GoNext(){
	if(NextUrl != ""){
		location.href = NextUrl;
	}
}
function Key_Down(e){
	var key = e.which ? e.which : e.keyCode;//获取按键值
	if(key == 33){
		if(GoUrl != ""){
			location.href = GoUrl;
		}
	}
	else if(key == 34){
		if(NextUrl != ""){
			location.href = NextUrl;
		}
	}
	else if(key == 37){
		if(GoUrl != ""){
			location.href = GoUrl;
		}
	}
	else if(key == 39){
		if(NextUrl != ""){
			location.href = NextUrl;
		}
	}
}
function On_KeyDown(){
	return Key_Down(event);
}