﻿var pic_indext=1;
    	
function changeallt(h,j)
{
    for (i=h;i<j+h;i++)
    {
        eval("tbt"+i).style.display="none";
        eval("new"+i).src="/Skin/Default/images/GIF/"+i+"_1.gif";
    }
}
function changet(a,b,c)
{
    changeallt(b,c);
    pic_indext=a;
    eval("tbt"+a).style.display="";
    eval("new"+a).src="/Skin/Default/images/GIF/"+a+"_2.gif";
}

//更改字体大小
var status0='';
var curfontsize=10;
var curlineheight=18;
function fontZoomA(){
if(curfontsize>8){
	document.getElementById('fontzoom').style.fontSize=(--curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(--curlineheight)+'pt';
}
}
function fontZoomB(){
if(curfontsize<64){
	document.getElementById('fontzoom').style.fontSize=(++curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(++curlineheight)+'pt';
}
}

function checkStarLevel(value,spanid) 
{
    if (value == '1') {
	    str = ' 太差劲了！'
    }
    else if (value == '2') {
	    str = ' 实在不怎么样！'
    }
    else if (value == '3') {
	    str = ' 还可以，凑合！'
    }
    else if (value == '4') {
	    str = ' 真不错！'
    }
    else if (value == '5') {
	    str = ' 太棒了！'
    }
    else {
	    str = ''
    }
    if (value != '') {
	    document.getElementById(spanid).innerHTML = '<img src="/images/Review/stars-'+ value +'.gif" align="absmiddle" />'+ str
    }
    else {
	    document.getElementById(spanid).innerHTML = ''
    }
}

/*防止被人frame*/
if(top.location != self.location)top.location=self.location;

/*全屏显示*/
//self.moveTo(0,0)
//self.resizeTo(screen.availWidth,screen.availHeight)

/*双击鼠标滚动屏幕的代码*/
var currentpos,timer;
function initialize()
{
    timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
    clearInterval(timer);
}
function scrollwindow()
{
    currentpos=document.body.scrollTop;
    window.scroll(0,++currentpos);
    if (currentpos !=document.body.scrollTop)
    sc();
}
document.onmousedown=sc
document.ondblclick=initialize

/*防注入*/
var url = location.search;
var re=/^\?(.*)(select%20|insert%20|delete%20from%20|count\(|drop%20table|update%20truncate%20|asc\(|mid\(|char\(|xp_cmdshell|exec%20master|net%20localgroup%20administrators|\"|:|net%20user|\'|%20or%20)(.*)$/gi;
var e = re.test(url);
if(e)
{
    alert("很抱歉，由于您提交的内容中含有危险的SQL注入代码，致使本次操作无效！");
    history.go(-1);
}

/*脚本永不出错*/
function killErrors()
{
   return true;
}
window.onerror = killErrors;


document.body.oncopy = function () { 
	setTimeout( function () { 
		var text = clipboardData.getData("text");
		if (text) { 
			text = text + "\r\n本文来自网络，详细请参考："+location.href; clipboardData.setData("text", text);
		} 
				}, 100 ) 
}

function formSubmit()
{
	if(!GetInfo('1'))
	{
	    return false;
	}
	if(!GetInfo('2'))
	{
	    return false;
	}
	if(!GetInfo('3'))
	{
	    return false;
	}
	if(!GetInfo('4'))
	{
	    return false;
	}
	if(!GetInfo('5'))
	{
	    return false;
	}
	return true;
}

function GetInfo(str)
{
    //document.getElementById('lblsave').innerHTML = '<img src="/images/Loading2.gif" />';        
    WebService.GetAll(document.getElementById('username').value+","+document.getElementById('userpwd').value+","+document.getElementById('checkcode').value+","+document.getElementById('select1').options[document.getElementById('select1').selectedIndex].value, OnRequestComplete);
    //alert(document.getElementById('username').value+","+document.getElementById('password').value+","+document.getElementById('checkcode').value+","+document.getElementById('select1').options[document.getElementById('select1').selectedIndex].value);
    return true;
}

function OnRequestComplete(result)
{
    if(result == 'true')
    {
        document.getElementById('lblall').innerHTML = '<img src="/images/check_error.gif" /><span style="font-size:12px;color:gray;"> 登陆出错！</span>';
        return false;
    }
    else
    {
        document.getElementById('lblall').innerHTML = '<img src="/images/check_right.gif" />';
        closeLayer();
        
        window.location.reload();
    }
}