function openpopup() {
    url = arguments[0];
    if (arguments[1]) w=arguments[1]; else w=300;
    if (arguments[2]) h=arguments[2]; else h=300; 
    if (arguments[3]) idd=arguments[3]; else idd='popup'; 
    popup=window.open(url,idd,"width="+w+",height="+h+",top=0,left=0,titlebar=no,toolbar=no,location=no,status=no,statusbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

///////


function getElementsByClassName(node, classname)
{
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    if (node.getElementsByTagName) {
        var els = node.getElementsByTagName("*");
    } else {
        var els = document.all;
    }
    for(var i=0,j=els.length; i<j; i++) {
        if(re.test(els[i].className)) {
            a[a.length] = els[i];
        }
    }
    return a;
} 

function SimpleSwap(el, which){ 
    el.src=el.getAttribute(which || "origsrc"); 
    var className = el.getAttribute('linked');
    if (className) {
        var els = getElementsByClassName(document, className);
        for(var i=0;i<els.length;i++) {
            if (els[i]!=el) {
                els[i].src=els[i].getAttribute(which || "origsrc");
            }
        }       
    }
    
} 
function SimpleSwapSetup(){ 
    var x = document.getElementsByTagName("img"); 

    for (var i=0;i<x.length;i++){ 
        var oversrc = x[i].getAttribute("oversrc"); 

        if (!oversrc) continue; 

        // preload image 
        // comment the next two lines to disable image pre-loading 
        x[i].oversrc_img = new Image(); 
        x[i].oversrc_img.src=oversrc; 
        

        // set event handlers 
        x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');"); 
        x[i].onmouseout = new Function("SimpleSwap(this);"); 
        // save original src 
        x[i].setAttribute("origsrc",x[i].src); 
    } 
} 
var PreSimpleSwapOnload =(window.onload)? window.onload : function(){}; 
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();} 

////////////////////


var id=-1,tm=-1;
function cs(i) {
    cc(i);
    if  (id!=-1) document.getElementById('sub'+id).style.display='none';
    if (document.getElementById('sub'+i)) {
        document.getElementById('sub'+i).style.display='block';
    id=i;
    }


}

function leave(i) {

    if (document.getElementById('sub'+i))
    tm=setTimeout("document.getElementById('sub"+i+"').style.display='none';",100);
}

function cc(j) {
    if (tm!=-1) clearTimeout(tm);
}


function cal(){
    for(j=0; j<7; j++) {
        if (document.getElementById('sub'+j).className == 'sub') {
            document.getElementById('sub'+j).className='unsub';
            document.getElementById('sub'+j).className='sub';
        }
    }
}



//browser check
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
    browser = "Konqueror";
    OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
    browser = "Netscape Navigator"
    version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
    if (checkIt('linux')) OS = "Linux";
    else if (checkIt('x11')) OS = "Unix";
    else if (checkIt('mac')) OS = "Mac"
    else if (checkIt('win')) OS = "Windows"
    else OS = "an unknown operating system";
}

function checkIt(string)
{
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
}
//browser check end


