//去掉空格
function ds(sstr)
{
	var dstr="";

	for (i=0;i<sstr.length;i++)
	{   
		if (sstr.charAt(i)!=' ') dstr+=sstr.charAt(i);
	}
	return dstr;
}

//提交表单
function checkuser()
{
	document.loggin.username.value=ds(document.loggin.username.value);
	document.loggin.password.value=ds(document.loggin.password.value);
	if ((document.loggin.username.value=="")||(document.loggin.password.value==""))
	{
		alert("用户名或密码不能为空！");
		if (document.loggin.username.value=="")
			document.loggin.username.focus();
		else
			document.loggin.password.focus();
	}
	else
	{
		alert("用户名或密码不正确或者没有开通！");
		//openwin_1();
		//document.check_user.submit();
		document.loggin.password.value="";
	}
}
//表单按回车直接提交
function CheckKeyCode() 
{
	var keyCode = event.keyCode;
	if(keyCode==13)
	{
		checkuser();
		event.keyCode = null;
	}
}
//提交查询英文域名表单
function searchen()
{
	document.search.ensearch.value=ds(document.search.ensearch.value);
	if (document.search.ensearch.value=="")
	{
		alert("英文域名不能为空！");
	}
	else
	{
		document.search.submit();
	}
}
//表单按回车直接提交
function CheckSearchCode() 
{
	var keyCode = event.keyCode;
	if(keyCode==13)
	{
		searchen();
		event.keyCode = null;
	}
}
//禁止右键
/*
function click() 
{
	if (event.button==2) 
	{
		alert('你想干什么？别想了，是不可能的。')
	}
}
document.onmousedown=click
*/

//用户进入全屏窗口
function openwin_1() 
{
	var win;
	win = window.open("","cneye","fullscreen=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=0,top=0");
	win.resizeTo(screen.width,screen.height);
	win.focus();
	return true;
}
/*
function openwin_1(name,pass) 
{
	var newwin;
	var url="check_user.php?username="+name+"&password="+pass;
	newwin = window.open(url,"jnjt","fullscreen=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=0,top=0");
	newwin.resizeTo(screen.width,screen.height);
	newwin.focus();
	return true;
}
*/

//两边广告---------------------------------------------------------------------
function left(layername,settop,setleft)
{	
	var a
	a=parseInt(document.body.offsetWidth);
	if(a>=1024)
	{
		document.all[layername].style.visibility='visible';

		therealtop=parseInt(document.body.scrollTop);
		thetruetop=settop+therealtop;
		document.all[layername].style.posTop=thetruetop;

		therealleft=parseInt(document.body.offsetWidth);
		thetrueleft=setleft;
		document.all[layername].style.posLeft=thetrueleft;

		setTimeout('left("left",50,5)',100);
	}
}
function right(layername,settop,setright)
{	
	var a
	a=parseInt(document.body.offsetWidth);
	if(a>=1024)
	{
		document.all[layername].style.visibility='visible';

		therealtop=parseInt(document.body.scrollTop);
		thetruetop=settop+therealtop;
		document.all[layername].style.posTop=thetruetop;

		therealright=parseInt(document.body.offsetWidth);
		thetrueright=therealright-setright-130;
		document.all[layername].style.posLeft=thetrueright;

		setTimeout('right("right",50,5)',100);
	}
}
function all()
{
	left('left',50,5);
	right('right',50,5);
}
//-----------------------------------------------------------------------------
