
var selectcount=0;

function CheckAll()
{
	var a = document.getElementsByTagName("input");
	
	for (var i=0; i<a.length; i++)
	if ( (a[i].type == "checkbox") && (!(a[i].disabled)) )
	{ var bSelect = a[i].checked; break;}

	if(bSelect)
	{
	selectcount=0;
	for (var i=0; i<a.length; i++)
	if ( (a[i].type == "checkbox") && (!(a[i].disabled)) ) {a[i].checked = false;}
	}
	else
	{
	selectcount=0;
	for (var i=0; i<a.length; i++)
	if ( (a[i].type == "checkbox") && (!(a[i].disabled)) ) {a[i].checked = true;++selectcount;}
	}
	event.srcElement.value=(bSelect==true)?"全 选":"取 消";
}

function pop(url,width,height) 
{
    var winwidth = (window.screen.availWidth-width)/2;
    var winheight = (window.screen.availHeight-height)/2;
    if(width == undefined && height == undefined)
        var news=window.open (url, "", "top=50,left=100,menubar=yes,toolbar=auto,location=no,directories=no, status=yes,scrollbars=yes,resizable=yes, width=600,height=400");  
    else
        var news=window.open (url, "", "top="+ winheight +",left="+ winwidth +",menubar=yes,toolbar=auto,location=no,directories=no, status=yes,scrollbars=yes,resizable=yes, width="+width+",height="+height+"");  
    news.focus();
    return false;
}

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 focus(pics, links, texts)
{
    var focus_width = 259;	// 图片宽度
    var focus_height= 205;	// 图片高度
    var text_height = 42;	// 显示的文字高度
    if( navigator.userAgent.indexOf("MSIE 6.0") != -1)
    {
        focus_height= 185;
        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="images/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="images/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 MyMar=setInterval(Marquee,speed);
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=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;
    }
}