// frameblock;
if (self != top){
    top.location.href = self.location.href;
}

//subwindow;
function subwindow(sub,name,w,h){
    window.name="subwindow";
    if(sub.indexOf("list")!=-1) w=490;
    adoptWindow=window.open(sub,name,"location=no,directories=no,scrollbars=auto,resizable=no,width="+w+",height="+h+",left=5,top=5");
}

var formWindow;
function openForm(strurl) {
    formWindow=window.open(strurl,"form","width=540,height=600,toolbar=0,location=0,directries=0,status=1,menubar=0,scrollbars=1,resizable=1");
    formWindow.focus();
}

function openwindow(strurl) {
    var navWindow=window.open(strurl,"profile","width=600,height=800,toolbar=0,location=0,directries=0,status=1,menubar=0,scrollbars=1,resizable=1");
    navWindow.focus();
}

//pulldownmenu;
function menulink(linkLoc){
    if(linkloc!="") window.location=linkloc;
}

function initMenu() {
    var obj=document.getElementById("global").getElementsByTagName("img");
    for(var i=0;i<obj.length;i++) {
        obj[i].onmouseover=function(){ this.style.backgroundColor="red";   };
        obj[i].onmouseout =function(){ this.style.backgroundColor="white"; };
    }
}

//window.onload=initMenu;

function disableStyles() {
    for(var i in document.styleSheets) {
        document.styleSheets[i].disabled=true;
    }
    window.scrollTo(0,0);
}

function enableStyles() {
    location.reload();
}

window.onload=setStyle;

function setStyle() {
    //with(navigator.userAgent) { if((indexOf("Mac_PowerPC")!=-1)||(indexOf("MSIE 4")!=-1)) return; }
    if(!document.styleSheets) return;
    var strSheetName="basic";
    var arrCookieItem=document.cookie.split(";");
    for(var i=0;i<arrCookieItem.length;i++) {
        if(arrCookieItem[i].split("=")[0]="sheet") strSheetName=arrCookieItem[i].split("=")[1];
    }
    if((!strSheetName)||(strSheetName=="")) strSheetName="basic";
    for(i=0;i<document.styleSheets.length;i++) {
        with(document.styleSheets[i]) {
            if(strSheetName==title) disabled=false; else disabled=true;
            if((!title)||(title=="")) disabled=false;
        }
    }
    if(!document.form1) return;
    if(!document.form1.styletype) return;
    for(i=0;i<document.form1.styletype.length;i++) {
        with(document.form1.styletype[i]){ if(value==strSheetName) checked=true; }
    }
}

function changeStyle(obj) {
    for(var i=0;i<obj.length;i++) {
        if(!obj[i].checked) continue;
        document.cookie=("sheet="+obj[i].value+";path=/;'");
        location.reload();
        break;
    }
}


