function PrintPopUp(ww,wh,URL) {
	window.open(URL, 'adrespopup', 'toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=1,resizable=1,width='+ww+',height='+wh+',left = 100,top = 50');
}

function popUp(ww,wh,URL) {
	window.open(URL, 'adrespopup', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width='+ww+',height='+wh+',left = 100,top = 50');
}

function checksearchinputchange(x) {
	var y=document.getElementById(x).value;
	if (y=="Search") {
		document.getElementById(x).value="";
		document.getElementById(x).style.color="#000000";
		searchok=true;			
	}
}


function setCookie(c_name,value,exdays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value+"; path=/"; 
}

var myWidth = 800, myHeight = 600;

function GetWindowWH() {

	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	//myWidth = screen.width; myHeight = screen.height;
	//window.alert( 'Width = ' + myWidth + ' and height = ' + myHeight );
	setCookie("WindowW",myWidth,null);
	setCookie("WindowH",myHeight,null);
}

function showLeftPanel() {
    GetWindowWH();
	var lbar=document.getElementById("leftbar");
	var showMode = 'table-cell';
	if (document.all) showMode='block';
	if (myWidth<600) {
		lbar.style.visibility="hidden";
		lbar.style.display ="none";
	} else {
	   	lbar.style.visibility="visible";
	   	lbar.style.display =showMode;
	}	
	//alert(myWidth);
}

function onResize() {
	GetWindowWH();
	showLeftPanel();

}

function addWindowEvent (type, eventHandle) {
	if (window.addEventListener) {
    	window.addEventListener( type, eventHandle, false );
	} else if (window.attachEvent) {
		window.attachEvent( "on" + type, eventHandle );
	}
}


//addWindowEvent("resize", onResize );

	



