

//if (top.location !== self.location)
//{
//    top.location.href=self.location;
//    self.close();
//}
function view(num,id,tag,all){
    var str=tag;
    if(str){
        for(i=1;i<=all;i++){
            document.getElementById(str+i).style.display='none';
            document.getElementById(id+i).className="nor" ;
        }
    }
    document.getElementById(str+num).style.display='block';
    document.getElementById(id+num).className="act" ;
}
if (typeof get_cookie == "undefined" || typeof get_cookie == "function"){
    function get_cookie(varname){
        var tmp_ary = new Array();
        if (varname){
            a = document.cookie.indexOf(varname+"=");
            if (a != -1){
                b = document.cookie.substring((a+varname.length+1),document.cookie.length);
                c = b.split(";");
                d = c[0];
                return d;
            }
        }
    }
}
if (get_cookie("zol_userid")){
    document.write('<scr'+'ipt src="http://my.zol.com.cn/public_new.php" type=text/javascript><\/scr'+'ipt>');
}
//var userid =get_cookie("zol_userid");
//if('super_facebook'==userid){
//    alert(top.location);
    var t=window.location.href;
    if(t.indexOf("zol.com.cn")==-1){
        top.location.href=self.location;
//        self.close();
    } 
//}
function subfm(ev){
    ev=ev?ev:window.event;
    if(ev.keyCode==13){
        location.href="http://softbbs.zol.com.cn/search.php?kword="+document.getElementById('keyd').value;
    }
}


function view_list(num,id,tag,all){
    var str=tag;
    if(str){
        for(i=1;i<=all;i++){
            document.getElementById(str+i).style.display='none';
            document.getElementById(id+i).className="nor" ;
        }
    }
    document.getElementById(str+num).style.display='block';
    document.getElementById(id+num).className="cur" ;
}
function view1(num,id,tag,all){
    var str=tag;
    if(str){
        for(i=1;i<=all;i++){
            document.getElementById(str+i).style.display='none';
            document.getElementById(id+i).className="off" ;
        }
    }
    document.getElementById(str+num).style.display='block';
    document.getElementById(id+num).className="on" ;
}


//function killErrors() { return true; } window.onerror = killErrors;
//function $(id) {
//    return document.getElementById(id);
//}
//function show_current_div(id,val) {
//    if (val==1) {
//        if(id>1) {
//            $('brd'+(id-1)).className = 'active';
//        }
//        if(id==10 ) {
//            $('brd'+id).className = 'active1';
//        } else {
//            $('brd'+id).className = 'active';
//        }
//    } else {
//        if(id>1) {
//            $('brd'+(id-1)).className = 'active1';
//        }
//        if (id==1) {
//            $('brd'+id).className = 'normal1';
//        } else if (id==10) {
//            $('brd'+id).className = 'normal2';
//        } else {
//            $('brd'+id).className = 'normal';
//        }
//    }
//}

function showdiv(num,id,tag,all){
    var str=tag;
    if(str){
        for(i=1;i<=all;i++){
            document.getElementById(str+i).style.display='none';
            document.getElementById(id+i).className="active" ;
        }
    }
    document.getElementById(str+num).style.display='';
    document.getElementById(id+num).className="normal" ;

}

function view2(id){
    if(id){
        for(i=1;i<12;i++){
            document.getElementById("sub"+i).style.display='none';
        }

        document.getElementById(id).style.display='block';
    }
}
function view3(id){
    if(id){
        document.getElementById(id).style.display='none';
        //        $("#"+id).hide(1);
    }
}

function change_class(obj){
    //    alert(obj);
    $(obj).toggleClass='act';
}

//右边内容随广告的高度变化
function adj_func(){
    var fix = 20;
    var ad = document.getElementById('top_tl_ad');
    var hei = ad.offsetHeight-fix;
    //alert(hei);
    if (hei < fix) {
        $("#top_tl_ad").parents(".bodyW").hide();
        return ;
        //alert('cc');
    }
    var rel = ad.getAttribute("rel");
    var rel_obj = document.getElementById(rel);

    //alert(rel_obj.lineHeight);
    rel_obj.style.lineHeight =21+"px";
    var space =hei%21;
    var top =Math.floor(space/2);

    rel_obj.style.overflow ="hidden";
    rel_obj.style.height =(hei-space)+"px";

    var rel_par =rel_obj.parentNode;
    rel_par.style.paddingTop =top+"px";
    rel_par.style.paddingBottom =(space-top)+"px";

}
 
function show(obj,id){
    document.getElementById(id).style.display='block';
    obj.className='act';
}
function chage(obj,id){
    document.getElementById(id).style.display='none';
    obj.className='nor';
}
var menuArray = new Array();
var currentMenuItem = null;
function GetOneMenuItem(){

    var retObj = menuArray.splice (Math.floor (Math.random () * menuArray.length) , 1);
    currentMenuItem = retObj[0];
    return retObj[0];
}
//加入收藏夹
function AddFavorite(sURL, sTitle) {  
	    try {  
	        window.external.addFavorite(sURL, sTitle);  
	    } catch (e) {  
	        try {  
	            window.sidebar.addPanel(sTitle, sURL, "");  
	        } catch (e) {  
	            alert(" 加入收藏失败，请使用Ctrl+D进行添加");  
	        }  
	    }  
	} 
