﻿function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
    
function settype(type)
{
	document.all.selectvalue.value=type;
}

function search()
{
	var keyword = document.all.txtSearch.value;
	
	if(keyword.length < 2)
	{
		alert("输入的关键字至少需要2个字符！");
	}
	else
	{
		keyword=encodeURI(keyword);
		var type;	
		type = document.all.selectvalue.value;			
		if(keyword!="")
		{
			if(type=="1")
			{
				window.open("/sub/web/Enterprise/Search.aspx?keyword="+keyword);
			}
			if(type=="2")
			{
				window.open("/sub/web/Product/Search.aspx?keyword="+keyword);
			}
			if(type=="3")
			{
				window.open("/sub/web/Ware/Search.aspx?keyword="+keyword);
			}
		}
		else
		{
			alert("请输入查询关键字！");
		}
	}
	
}

function check()
{
	if(!ch(document.all.username,"请填写用户名!")) return false;
	if(!isHaveHtmlScript(document.all.username,"用户名中含有网页脚本!")) return false;
	if(!nonlicetchar(document.all.username,"用户名含有半角的非法字符(＇),请将其删除或用全用角的字符(＇)代替!")) return false;
	
	if(!ch(document.all.password,"请填写密码!")) return false;
	if(!isHaveHtmlScript(document.all.password,"密码中含有网页脚本!")) return false;
	if(!nonlicetchar(document.all.password,"密码含有半角的非法字符(＇),请将其删除或用全用角的字符(＇)代替!")) return false;
	
}

function trim(value)
{
	return  value.replace(/(^\s*)  |(\s*$)/g,  "");
}

function ch(control,mess)
{	

	if(trim(control.value)=="")
	{
		alert(mess);
		control.focus();
		control.select();
		return false;
	}
	return true;
	
}

function nonlicetchar(control,mess)
{
     var re = "'";
     var i;
     var str = control.value;
     for(i=0;i<str.length;i++)
     {
         var c = str.charAt(i);
         if(re.indexOf(c) >= 0)         
         {  
             alert(mess);
             control.focus();
             control.select();
             return false;              
         }         
     }
     
	return true;
}

function isHaveHtmlScript(control,mess)
{
	var re = /(<(.)+>)/i;
	var str = control.value.toLowerCase();
	if(re.test(str))
	{
		alert(mess);
		control.focus();
		control.select();
		return false;
	}
	return true;
}

function reg()
{
	var reg = "/subsite_old/register/free.asp";
    if (document.all.ProductType.value=="0101")
    {
        reg = "/jyt/web/free.asp";
    }
    else
    {   
        reg = "/street/web/shop/Register.aspx";
    }
    window.open(reg);
}
function Marquee(){
 if(demo2.offsetWidth-demo.scrollLeft<=0)
 demo.scrollLeft-=demo1.offsetWidth
 else{
 demo.scrollLeft++
 }
}

function gaojie()
{
    
    gaojie1('15',1);
    gaojie3('01',1);
    gaojie21();
    gaojie23();
    gaojie5();
    gaojie6(); 
    //gaojie7();
    gaojie16();
    //gaojie8();
    gaojie20();
    gaojie9();
   // gaojie17();
    gaojie18();
   // gaojie19();
    gaojie12();
    gaojie10();
    gaojie11();
    gaojie15();
    //gaojiead('adhor','01010017');
    gaojiead('ad3','01010003');
    gaojiead('ad4','01010006');
    gaojiead('ad5','01010007');
    gaojiead('ad7','01010008');
    gaojiead('ad8','01010009');
    gaojiead('ad11','01010011');
    gaojiead('ad12','01010012');
    gaojiead('ad13','01010013');
    gaojiead('ad14','01010014');
    gaojiead('ad15','01010015');
    gaojiead('ad16','01010016');
}