function isdate(datestr)
{
	monday=new Array(31,0,31,30,31,30,31,31,30,31,30,31);
	if(datestr.length>11 || datestr.length<8)
	{
		return false;
	}
	if(datestr.substring(4,5)!="/" && datestr.substring(4,5)!="-")
	{
		return false;
	}
	if(datestr.substring(7,8)!="/" && datestr.substring(7,8)!="-")
	{
		return false;
	}
	year=datestr.substring(0,4);
	month=datestr.substring(5,7);
	day=datestr.substring(8,10);
	if(year*1!=year || month*1!=month || day*1!=day)
	{
		return false;
	}
	if(year<=0 || month<=0 || day<=0)
	{
		return false;
	}
	if(month>12)
	{
		return false;
	}
	if(year%4==0)
	{
		monday[1]=29;
	}
	else
	{
		monday[1]=28;
	}
	mond=month-1;
	if(day>monday[mond])
	{
		return false;
	}	
	return true;
}

function isemail(emailstr)
{
	var addfin;
	addfin=false;
	indx=emailstr.indexOf("@");
	if(indx<=0)
	{
		return false;
	}
	indu=emailstr.indexOf(".",indx);
	if(indu<=0)
	{
		return false;
	}
	str=emailstr.substring(indx+1,indu);
	if(str.length<3)
	{
		return false;
	}
	emailadd=new Array("com","net","edu","gov");
	str=emailstr.substring(indu+1,emailstr.length);
	for(i=0;i<emailadd.length;i++)
	{
		if(str.substring(0,3)==emailadd[i])
		{
			addfin=true;
			break;
		}
	}
	if(addfin==false)
	{
		return false;
	}
	indx=str.indexOf(".");
	if(indx==0)
	{
		return false;
	}
	if(indx>0)
	{
		str2=str.substring(indx+1,str.length);
		if(str2.length>3)
		{
			return false;
		}
	}
	return true;
}
function istime(datestr)
{
	hour=datestr.substring(0,2);
	minute=datestr.substring(3,5);
	second=datestr.substring(6,8)
	if(hour>23 || minute>59 || second>59)
	{
		return false;
	}
	if(hour<0 || minute<0 || second<0)
	{
		return false;
	}
	if(hour*1!=hour || minute*1!=minute || second*1!=second)
	{
		return false;
	}
	return true;
}
function isdatetime(datestr)
{
	if(datestr.length<10 || datestr.length>19)
	{
		return false;
	}
	date=datestr.substring(0,10);
	time=datestr.substring(11,19);
	cdate=isdate(date);
	ctime=istime(time);
	if(cdate==false || ctime==false)
	{
		return false;
	}
	return true;
}

function dateadd(intv,num,datestr)
{
	if(datestr.length>10)
	{
		date=datestr.substring(0,10);
		time=datestr.substring(11,19);
	}
	else
	{
		date=datestr;
		time="00:00:00";
	}
	if(isdate(date)==false || istime(time)==false)
	{
		return "0000-00-00 00:00:00";
	}
	year=datestr.substring(0,4);
	month=datestr.substring(5,7);
	day=datestr.substring(8,10);
	hour=datestr.substring(11,13);
	minute=datestr.substring(14,16);
	second=datestr.substring(17,19);
	date1=new Date(year,month, day, hour, minute, second,0);
	date2=new Date();
	switch(intv)
	{
		case "y":
			inv=31536000000;
			break;
		case "m":
			inv=2592000000;
			break;
		case "d":
			inv=86400000;
			break;
		case "h":
			inv=3600000;
			break;
		case "i":
			inv=60000;
			break;
		case "s":
			inv=1000;
			break;
	}
	num=num*1;
	sens=date1.getTime() + inv * num;
	date2.setTime(sens);
	year=date2.getYear();
	month=date2.getMonth();
	day=date2.getDate();
	hour=date2.getHours();
	minute=date2.getMinutes();
	second=date2.getSeconds();
	if(month<10)
	{
		month="0"+month;
	}
	if(day<10)
	{
		day="0"+day;
	}
	if(hour<10)
	{
		hour="0"+hour;
	}
	if(minute<10)
	{
		minute="0"+minute;
	}
	if(second<10)
	{
		second="0"+second;
	}
	retstr=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
	window.alert(retstr);
	return retstr;
}
function datediff()
{
	return false;
}
function sendwin(url,type)
{
		nwin=window.open(url,type,'Height=270px,Width= 400px,left=250, top=200, center=Yes, help=No, scrollbars=yes,resizable=No,status=No;');
		nwin.focus();
}

function newwin(url)
{
		nwin=window.open(url,'curve','Height=360px,Width= 520px,left=250, top=200, center=Yes, help=No, scrollbars=yes,resizable=No,status=No;');
		nwin.focus();
}

function isnull(str)
{
	str=str.replace(" ","");
	if(str=="")
	{
		return true;
	}
	else
	{
		return false;
	}
}
function trim(str)
{
	var start_ind;
	var end_ind;
	var strlen;
	var i;
	start_ind=0;
	end_ind=0;
	strlen=str.length;
	for(i=0;i<strlen;i++)
	{
		if(str.substr(i,1)!=" " && start_ind==0)
		{
			start_ind=i;
		}
		if(str.substr(i,1)!=" ")
		{
			end_ind=i+1;
		}
	}
	return str.substring(start_ind-1,end_ind);
}

function viewimage(image,w,h)
{
	vvvv=new Image();
	vvvv.src=image;
	if(w==null)w=500;
	if(h==null)h=w;
	if(image==null)image="null.gif";
	end=image.length;
	type=image.substring(end-6,end-4);
	type=type.toLowerCase();
	var ap=window.open("about:blank","_blank","toolbar=no;width=500;height=500;");
	ap.document.open("text/html","replace");
	ap.document.write(
	"<!--HuiWei Group Copyright 2002-->\n"
	+"<html>\n<head>\n<title>zoom</title>\n"
	+"<scr"+"ipt language=javascript>\n"
	+"function vvvimg(){"
	+" nimg=new Image();\n"
	+" nimg.src='"+image+"';\n"
	+" w=nimg.width;\n"
	+" h=nimg.height;\n"
	+" if(w>100){\n"
	+" w=w*1.2;h=h*1.2;\n"
	+" window.resizeTo(w,h);\n"
	+" }\nsetTimeout(\"vvvimg()\",5000);\n}"
	+"</scr"+"ipt>\n"
	+"</head>"
	+"<style type=text/css>\n"
	+"body{margin:10;\nfont-size:12px}\n</style>\n"
	+"<body bgcolor=#FFFFFF onload=\"vvvimg()\">\n<center>\n"
	+"<img src='' id='image_'>\n"
	+"</body>\n</html>\n"
	+"<scr"+"ipt language=javascript>\n"
	+" var img=document.all['image_'];\n"
	+" img.src='"+image+"';\n"
	+"</scr"+"ipt>\n"
	+"<!--HuiWei Group Copyright 2002-->\n"
	);
	ap.document.close();
	return;
}

function viewimg(image,w,h)
	{
	vvvv=new Image();
	vvvv.src=image;
	if(w==null)w=500;
	if(h==null)h=w;
	if(image==null)image="null.gif";
	end=image.length;
	type=image.substring(end-6,end-4);
	type=type.toLowerCase();
	var ap=window.open("about:blank","_blank","toolbar=no;width=500;height=500;");
	ap.document.open("text/html","replace");
	ap.document.write(
	"<!--HuiWei Group Copyright 2002-->\n"
	+"<html>\n<head>\n<title>·Å´ó²é¿´</title>\n"
	+"<scr"+"ipt language=javascript>\n"
	+"function vvvimg(){"
	+" nimg=new Image();\n"
	+" nimg.src='"+image+"';\n"
	+" w=nimg.width;\n"
	+" h=nimg.height;\n"
	+" if(w>100){\n"
	+" w=w*1.2;h=h*1.2;\n"
	+" window.resizeTo(w,h);\n"
	+" }\nsetTimeout(\"vvvimg()\",5000);\n}"
	+"</scr"+"ipt>\n"
	+"</head>"
	+"<style type=text/css>\n"
	+"body{margin:10;\nfont-size:12px}\n</style>\n"
	+"<body bgcolor=#FFFFFF onload=\"vvvimg()\">\n<center>\n"
	+"<img src='' id='image_'>\n"
	+"</body>\n</html>\n"
	+"<scr"+"ipt language=javascript>\n"
	+" var img=document.all['image_'];\n"
	+" img.src='"+image+"';\n"
	+"</scr"+"ipt>\n"
	+"<!--HuiWei Group Copyright 2002-->\n"
	);
	ap.document.close();
	return;
	}

function addtocart(id)
{
	nwin=window.open('/cgi/onlineshop/cart.php?type=add&id='+id,'cart','Height=230px,Width= 600px, center=Yes, help=No, scrollbars=yes,resizable=No,status=No;');
	nwin.focus();
}

function cartview()
{
	nwin=window.open('/cgi/onlineshop/overshopping.php','cart','Height=230px,Width= 600px, center=Yes, help=No, scrollbars=yes,resizable=No,status=No;');
	nwin.focus();
}

function edit_sort(id,rank,etype)
{
	document.all('ht').innerHTML="<iframe src=\"/product/htm/prosort.php?id="+id+"&rank="+rank+"&etype="+etype+"\" frameborder=0 width=0 height=0 framespacing=0 name=\"downloadframe\"></iframe>";
	setTimeout("window.location.reload()",2000);
}
function showleague(id)
{
	var wwidth=500;
	var wheight=230;
	var wleft;
	var wtop;
	browsname=navigator.appName;
	fg=browsname.indexOf("Microsoft",browsname.length-1);
	
	if(fg)
	{
		screen_width=screen.width;
		screen_height=screen.height;
		wleft=(screen_width-wwidth)/2;
		wtop=(screen_height-wheight)/2;
		nwin=window.open('/sellnet/htm/league.php?id='+id,'league','Height='+wheight+'px,Width= '+wwidth+'px,left='+wleft+'px,top='+wtop+',center=Yes, help=No, scrollbars=no,resizable=No,status=No;');
		nwin.focus();
	}
}
function showleague_en(id)
{
	var wwidth=500;
	var wheight=230;
	var wleft;
	var wtop;
	browsname=navigator.appName;
	fg=browsname.indexOf("Microsoft",browsname.length-1);
	
	if(fg)
	{
		screen_width=screen.width;
		screen_height=screen.height;
		wleft=(screen_width-wwidth)/2;
		wtop=(screen_height-wheight)/2;
		nwin=window.open('/en/showleague.php?id='+id,'league','Height='+wheight+'px,Width= '+wwidth+'px,left='+wleft+'px,top='+wtop+',center=Yes, help=No, scrollbars=no,resizable=No,status=No;');
		nwin.focus();
	}
}
function adminlogin()
{
	if(logform.uid.value=="")
	{
		logform.uid.focus();
		return false;
	}
	if(logform.pwd.value=="")
	{
		logform.pwd.focus();
		return false;
	}
	document.all["ht"].innerHTML="<iframe width='0' name='logframe' height='0' frameborder='0' scrolling='no'></iframe>";
	setTimeout("window.location.reload()",300);
	logform.target="logframe";
	return true;
}
function adminlogout()
{
	document.all["ht"].innerHTML="<iframe width='0' name='logframe' height='0' frameborder='0' scrolling='no'></iframe>";
	setTimeout("window.location.reload()",300);
	logform.target="logframe";
	return true;
}

function getscreenwidth()
{
	return 	screen.width;
}
function getscreenheight()
{
	return screen.height;	
}
function showmessage(id)
{
	var wwidth=500;
	var wheight=350;
	var wleft;
	var wtop;
	browsname=navigator.appName;
	fg=browsname.indexOf("Microsoft",browsname.length-1);
	
	if(fg)
	{
		screen_width=screen.width;
		screen_height=screen.height;
		wleft=(screen_width-wwidth)/2;
		wtop=(screen_height-wheight)/2;
		//nwin=window.open('/sellnet/htm/message.php?id='+id,'league','Height='+wheight+'px,Width= '+wwidth+'px,left='+wleft+'px,top='+wtop+',center=Yes, help=No, scrollbars=no,resizable=No,status=No;');
		nwin=window.open('/sellnet/htm/message.php?id='+id,'league','Height='+wheight+'px,Width= '+wwidth+'px,left='+wleft+'px,top='+wtop+',center=Yes, help=No, scrollbars=Yes,resizable=No,status=No;');
		nwin.focus();
	}
}

function Pro_jump(id)
{
	if(id){
		nwin=window.open('/product/en/view.php?id='+id);
		nwin.focus();
		}
	}