// toggle display/hide

function toggle( targetId ){
        ie4 = (document.all)? true:false
        ns6 = (!document.all && document.getElementById)?true:false
        if (ie4){
                target = document.all[targetId];
                        if (target.style.display == "none"){
                                target.style.display = "";
                        }
                        else {
                                target.style.display = "none";
                        }
        }
        else if (ns6){
                target = document.getElementById(targetId);
                        if (target.style.display == "none"){

                                target.style.display = "";
                        }       
                        else {  
                                target.style.display = "none";
                        }
        }                       
}

// write to layer

function writeto(name, message) {
    if (document.layers) {
        document.layers[name].document.close();
        document.layers[name].document.write(message);
        document.layers[name].document.close();
    } else {
        if (document.all) {
            eval("document.all." + name + ".innerHTML='" + message + "'");
        } else {
            document.getElementById(name).innerHTML = message;
        }
    }
}

function window_size() {
	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 );
	ie4 = (document.all)? true:false
	ns6 = (!document.all && document.getElementById)?true:false
	if (ie4) { 
		frame = document.all["side"];
		contentdiv = document.all["content"];
	}
	else if (ns6) {
		frame = document.getElementById("side"); 
		contentdiv = document.getElementById("content"); 
	}
	if(document.getElementById){
		contentheight = contentdiv.offsetHeight;
	}
	else if (document.layers){
		contentheight = document.layers["side"].clip.height;
	}
	contentheight2 = contentheight + 245;
	var htmlheight = document.body.parentNode.scrollHeight; 
	var windowheight = myHeight;//window.innerHeight; 
	if (contentheight2 <= myHeight) {
		frame.style.height = (myHeight - 245) + "px";
	} 
	else { 
		frame.style.height = contentheight + "px"; 
	}
	//frame.style.width = myWidth + "px";
	//window.alert(myWidth +" "+ frame.style.width);
}
