function clearTextfield(){
    if (document.siteSearch.searchField.value == "search..."){
        document.siteSearch.searchField.value = "";
    }
}

function resetTextfield(){
    if (document.siteSearch.searchField.value == ""){
        document.siteSearch.searchField.value = "search...";
    }
}

function resizeBorder () {
    var n = document.getElementById('main');
    var myHeight = n.offsetHeight;
    var s = document.getElementById('borderlr');
    var m = document.getElementById('bordermid');
    s.style.height = myHeight+"px";
    m.style.height = (myHeight-80)+"px";
}

function showNPic(id) {
    var pic = "pi"+id;
    var one, other;
    if(id == "c1") {
        one = "pic"+2;
        other = "pic"+3;
    }else if(id == "c2") {
        one = "pic"+1;
        other = "pic"+3;
    }else if (id == "c3") {
        one = "pic"+1;
        other = "pic"+2;
    }
    
    one = document.getElementById(one);
    other = document.getElementById(other);
    pic = document.getElementById(pic);

    one.style.visibility = "hidden";
    other.style.visibility = "hidden";
    pic.style.visibility = "visible";
}

function popup(link) {
    window.open(link,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');
    return false;
}

function getHeight() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    //window.alert( 'Width = ' + myWidth );
    //window.alert( 'Height = ' + myHeight );
    return myHeight;
}

function resize() {
    var s = document.getElementById('spanner');
    var h = getHeight()-100;
    //alert(h);
    s.style.height = h+"px";
}


function hideLogin() {
    var s = document.getElementById('login');
    s.style.visibility = "hidden";
}

function showLogin() {
    var s = document.getElementById('login');
    s.style.visibility = "visible";
}

function updateSocial(topic) {
    $('#social').html($('#social').html().replace(/tgshr/g, topic));
}

window.onload = resizeBorder;



