
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);
    }
    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;
    var MyMar=setInterval(Marquee,speed);
    function demoStop() {clearInterval(MyMar)}
    function demoStart(){MyMar=setInterval(Marquee,speed)}
    function Marquee(){
        if(demo2.offsetTop-demo.scrollTop<=0){
            demo.scrollTop-=demo1.offsetHeight;
        }
        else{
            demo.scrollTop++;
        }
    }    
    demo.onmouseover=demoStop;
    demo.onmouseout=demoStart;
}

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;
       }
    }
}