// JavaScript Document

function ViewImg(img){
	NewWin=window.open('#','','width=100,height=100,scrollbars=yes');
	str='<link href="css/css.css" rel="stylesheet" type="text/css">'
	str+='<title>查看图片</title><body leftmargin="3" topmargin="3">';
	str+='<center><img id="img" src="'+img+'" onload="if(this.offsetHeight>600)this.Height=(this.offsetHeight)/2;if(this.offsetWidth>800)this.width=(this.offsetWidth)/2;self.resizeTo(this.offsetWidth+36,this.offsetHeight+60)">';
	str+='<br>--<a href="JavaScript:window.close();">关 闭</a>--</center>'
	str+='<meta http-equiv="refresh" content="2">';
	NewWin.document.write(str)
}

function ViewImgNew(){
	var img=event.srcElement;
	//alert(img)
	NewWin=window.open('#','','width=100,height=100,scrollbars=yes');
	str='<link href="style/style.css" rel="stylesheet" type="text/css">'
	str+='<title>查看图片</title><body leftmargin="3" topmargin="3">';
	str+='<img id="img" src="'+img+'" onload="this.width=(this.offsetWidth)/2,self.resizeTo(this.offsetWidth+36,this.offsetHeight+82)">';
	str+='<br><br><center><input type="button" value="放 大" onClick="img.width=(img.width)+50;img.height=(img.height)+50;self.resizeTo((img.width)+36,(img.height)+82);" class="button"><input type="button" value="缩 小" onClick="img.width=(img.width)-50;img.height=(img.height)-50;self.resizeTo((img.width)+36,(img.height)+82);" class="button"><input type="button" value="关 闭" onClick="window.close()" class="button"></center>'
	str+='<meta http-equiv="refresh" content="2">';
	NewWin.document.write(str)
}

function TableFocus(){
	return false;
}
var CoolSite
function Other_Preview(path)
{
	try{
	if (path=='') { return false; }
  /* if (CoolSite && !CoolSite.closed){
	   CoolSite.close()
	 }	*/
	 var swidth,sheight
	 if(swidth!='')swidth=screen.availWidth;
	 if(sheight!='')sheight=screen.availHeight;
	//CoolSite = window.open(path,'Preview','left=0,top=0,width='+(parseInt(swidth)-10)+',height='+(parseInt(sheight)-(screen.width-(screen.width-sheight)))+',toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	CoolSite = window.open(path,'Preview','left=0,top=0,width='+(parseInt(swidth)-10)+',height='+(parseInt(sheight)-168)+',toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	CoolSite.focus();
	}
	catch(e)
	{
		//alert(e.description)
	}
}

var nwin
function PreviewWin(path)
{
	if (path=='') { return false; }
   if (nwin && !nwin.closed){
	   nwin.close()
	 }
	 var swidth,sheight
	 if(swidth!='')swidth=screen.availWidth;
	 if(sheight!='')sheight=screen.availHeight;
	nwin = window.open(path,'','left=0,top=0,width='+(parseInt(swidth)-10)+',height='+(parseInt(sheight)-168)+',toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=no');
	nwin.focus();
}
var w_win
function resizeWin(path,swidth,sheight)
{
	if (path=='') { return false; }
   if (w_win && !w_win.closed){
	   w_win.close()
	 }
	 /*var swidth,sheight
	 if(swidth!='')swidth=screen.availWidth;
	 if(sheight!='')sheight=screen.availHeight;*/
	w_win = window.open(path,'','left='+((screen.availWidth-swidth)/2)+',top='+((screen.availHeight-sheight)/2)+',width='+swidth+',height='+sheight+',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	w_win.focus();
}
function MemberLogin(){
	if(frmLogin.txtLogin.value==''){
			alert('对不起！请输入登录帐号！');
			frmLogin.txtLogin.focus();
			return false;
		}	
	if(frmLogin.LoginPwd.value==''){
			alert('对不起！请输入登录密码！');
			frmLogin.txtPwd.focus();
			return false;
		}
	frmLogin.action='CheckLogin.asp';
	frmLogin.submit();
}
/**************************************************
*				跳转选择框
* SelectAll(chks,btn)
* 调用方法参数说明：
* chks代表多选框ID;
* btn代触发事件的按钮
***************************************************/
function SelJumpMenu(path){
	if(path.value!=''){
		location.href=path.value;
		}
}
