
function window_onload() 
{
	window.moveTo(0,0);
	window.resizeTo(window.screen.width,window.screen.height-25);
}    

function window_open(url, width, height ,isbars) 
{
     var input_news=window.open(url,"",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars='+ isbars + ',status=no,toolbar=no,menubar=no,location=no ');
	 input_news.focus();
}    

function Request(strName) 
{ 
    var strHref = window.document.location.href; 
    var did; 
    var intPos = strHref.indexOf("?"); 
    var strRight = strHref.substr(intPos + 1); 

    var arrTmp = strRight.split("&"); 
    for(var i = 0; i < arrTmp.length; i++) 
    { 
        var arrTemp = arrTmp[i].split("="); 
        if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1]; 
    } 
    return ""; 
}

function AddFavorite(url,title,desc){
    if (navigator.userAgent.indexOf("MSIE") != -1)//IE
    {
        //window.external.AddFavorite(url,title);
        if(navigator.appVersion.match(/8./i)=='8.')
        {   
            window.external.addToFavoritesBar(url, title);
        }
        else
        {
             window.external.addFavorite(url, title); 
        }
        
    }
    else//IE
    {
        window.sidebar.addPanel(title,url,desc);
    }
}

function focus(pics, links, texts)
{
    var focus_width = 259;	// 图片宽度
    var focus_height= 215;	// 图片高度
    var text_height = 42;	// 显示的文字高度
    if( navigator.userAgent.indexOf("MSIE") != -1)
    {
        focus_height= 190;
        text_height = 21;
    }
    var swf_height = focus_height + text_height;
    var result = '';    
            	
    result += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
    result += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
    result += 'width="'+ focus_width +'" ';
    result += 'height="'+ swf_height +'">';
    result += '<param name="allowScriptAccess" value="sameDomain">';
    result += '<param name="movie" value="img/flash/focus.swf">';
    result += '<param name="quality" value="high">';
    result += '<param name="bgcolor" value="#ffffff">';
    result += '<param name="menu" value="false">';
    result += '<param name=wmode value="opaque">';
    result += '<param name="FlashVars" ';
    result += 'value="pics='+pics;
    result += 		'&links='+links;
    result += 		'&texts='+texts;
    result += 		'&borderwidth='+focus_width;
    result += 		'&borderheight='+focus_height;
    result += 		'&textheight='+text_height+'">';
    result += '<embed src="img/flash/focus.swf" ';
    result += 'wmode="opaque" ';
    result += 'FlashVars="pics='+pics;
    result += 		'&links='+links;
    result += 		'&texts='+texts;
    result += 		'&borderwidth='+focus_width;
    result += 		'&borderheight='+focus_height;
    result += 		'&textheight='+text_height+'" ';
    result += 'menu="false" ';
    result += 'bgcolor="#ffffff" ';
    result += 'quality="high" ';
    result += 'width="'+ focus_width +'" ';
    result += 'height="'+ focus_height +'" ';
    result += 'allowScriptAccess="sameDomain" ';
    result += 'type="application/x-shockwave-flash" ';
    result += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    result += '</object>'; 
    
    document.getElementById("flash").innerHTML = result;
}
function scroll(speed,demo2,demo1,demo)
{
    demo2.innerHTML=demo1.innerHTML;
    function Marquee(){
        if(demo2.offsetTop-demo.scrollTop<=0)
            demo.scrollTop-=demo1.offsetHeight;
        else
            demo.scrollTop++;
    }
    var MyMar1=setInterval(Marquee,speed);
    demo.onmouseover=function() {clearInterval(MyMar1)}
    demo.onmouseout=function() {MyMar1=setInterval(Marquee,speed)}
}

function scroll2(speed,demo2,demo1,demo)
{       
    demo2.innerHTML=demo1.innerHTML; 
    function Marquee(){
        if(demo2.offsetWidth/2-demo.scrollLeft<=0)
            demo.scrollLeft-=demo1.offsetWidth/2;
        else
            demo.scrollLeft++;
    }    
    var MyMar2=setInterval(Marquee,speed);
    demo.onmouseover=function() {clearInterval(MyMar2)}
    demo.onmouseout=function() {MyMar2=setInterval(Marquee,speed)}
}

function scroll3(speed,demo2,demo1,demo)
{
    demo2.innerHTML=demo1.innerHTML;
    function Marquee(){
        if(demo2.offsetWidth/2-demo.scrollLeft<=0){
            demo.scrollLeft-=demo1.offsetWidth/2;
        }
        else{
            demo.scrollLeft++;
        }
    }
    var MyMar2=setInterval(Marquee,speed);
    demo.onmouseover=function() {clearInterval(MyMar2)}
    demo.onmouseout=function() {MyMar2=setInterval(Marquee,speed)}
}

var Url = function(){
    this.syspath = location.href;    
    this.host=function(){ 
        return this.syspath.host;
    }; 
      
    this.path=function(){
        var strPath = this.syspath;
        var intPosition = strPath.lastIndexOf("/");
        strPath = strPath.toLowerCase();      
        strPath = strPath.substring(0,parseInt(intPosition)+1); 
        strPath = strPath.replace("file:///","");   
        strPath = strPath.replace(new RegExp("%20","gm")," ");    
        return strPath;
    };
    
    this.reverse=function(srcString){ 
        var temp = [];
        for(var i=srcString.length-1;i>-1;i--)
        { 
            temp.push(srcString.charAt(i)); 
        } 
        return temp.join("").toString();
    };
    
    this.checkPath=function(host){
        if(host=="")
            host = this.host;
        host = host.toLowerCase();
        if(this.reverse(this.path().toString()).indexOf(this.reverse(host)) == 1)
            return true;
        else
            return false;
    }
}

/// <summary>
/// 判断一个数据输入的数据只能是数字。
/// </summary>
function numberkeypress() 
{
    if ((event.keyCode<48 || event.keyCode>57))
    {
       if(event.keyCode!=46||event.keyCode!=110||event.keyCode!=190)
       {
          event.keyCode = 0;
       }
    }
}

function fontZoomA(){
document.getElementById('lbContent').style.fontSize='12px';
document.getElementById('lbContent').style.lineHeight='20px';
}

function fontZoomB(){
document.getElementById('news_lbContent').style.fontSize='14px';
document.getElementById('news_lbContent').style.lineHeight='24px';
}

function fontZoomC(){
document.getElementById('news_lbContent').style.fontSize='16px';
document.getElementById('news_lbContent').style.lineHeight='28px';
}

function checkform3()
{
 var lsh = document.getElementById("lsh");
 //验证整数的正则表达式
 var num = /^(-?[0-9][0-9]*|0)$/;

 if(lsh.value == "")
 {
    alert("注意：请输入11位流水号！");
    lsh.focus();
    return false;
 }
 
  if(!num.test(lsh.value))
 {
    alert("注意：流水号只能输入数字！");
    lsh.focus();
    return false;
 }
 
 if(lsh.value.length != 11)
 {
    alert("注意：请输入11位流水号！");
    lsh.focus();
    return false;
 }
 document.form1.submit();
 return true;
}

function checkform2()
{
     document.formSeach.submit();
     return true;
}

//var   imagepath= "../images/zpqs.jpg";//图片的URL 
//var   imagewidth=300;//图片的大小 
//var   imageheight=300;//图片的大小 
//var   speed=3;   //图片漂浮速度 
//var   imageclick= "#";//点击图片连接到的地址   
//var   hideafter=0   
//var   isie=0;
//if(window.navigator.appName== "Microsoft   Internet   Explorer "&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf( "MSIE ")+5,window.navigator.appVersion.indexOf( "MSIE ")+8)> =5.5)   {   
//    isie=1;
//}
//else{
//    isie=0;
//}
//if(isie){
//    var   preloadit=new   Image();
//    preloadit.src=imagepath;
//}
//function   pop()   {   
//    if(isie){
//        x=x+dx;y=y+dy;   
//        oPopup.show(x,y,imagewidth,imageheight);
//        if(x+imagewidth+5> screen.width)   dx=-dx;
//        if(y+imageheight+5> screen.height)   dy=-dy;
//        if(x <0)   dx=-dx;
//        if(y <0)   dy=-dy;
//        startani=setTimeout( "pop(); ",50);
//    }
//}
//function   dismisspopup(){   
//    clearTimeout(startani);
//    oPopup.hide();
//}   
//function   dowhat(){   
//    if   (imageclick== "dismiss ")   
//        dismisspopup(); 
//    else   
//        window.open(imageclick);
//}   
//if(isie)   {
//    var   x=0,y=0,dx=speed,dy=speed;   
//    var   oPopup   =   window.createPopup();   
//    var   oPopupBody   =   oPopup.document.body;   
//    oPopupBody.style.cursor="hand ";
//    oPopupBody.innerHTML   ='<IMG   SRC= " '+preloadit.src+ ' "> ';   
//    oPopup.document.body.onmouseover=new   Function( "clearTimeout(startani) ");
//    oPopup.document.body.onmouseout=pop;
//    oPopup.document.body.onclick=dowhat;
//    pop();   
//    if(hideafter> 0)
//        setTimeout( "dismisspopup() ",hideafter*1000)   
//}   
