$.elementReady('news_loc_wrap', function(){
										 
    var h = $('#news_loc_wrap').height() - 58;
	$('.leftright_border').css("height", h);
	
});

function emptyIt(id){
	if($(id).val()=='enter keyword'){
		$(id).val('');
	}
}
function unEmptyIt(id){
	if($(id).val()==''||$(id).val()=='enter keyword'){
		$(id).val('enter keyword');
	}
}
function searchIt(id){
	if($(id).val()==''||$(id).val()=='enter keyword'){
		return false;	
	}
	return true;
}
function popup(mylink, name, w, h){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1'+',resizable=1'+',status=0'+'';
	win = window.open(mylink, name, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function sendlink(mylink){
	popup(mylink.attr('href')+'&sendlink=1', 'sendlink', 450, 600);
}
function sendenquiry(mylink){
	popup(mylink.attr('href')+'&sendenquiry=1', 'sendlink', 450, 700);
}

function NewWindow(mypage, myname, w, h, scroll, resizable, status) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',status='+status+'';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// tell a friend
function emailThisPage(lnk)
{
	NewWindow('./emailThisPage.php?link='+lnk, 'EmailThisPage', 500, 375, 1, 0);
}

//print this page
function printPage()
{
	var txtQueryString = window.location.search.substring(1);
	var txtPrint = (txtQueryString=="")?'?print=1':'&print=1';
	NewWindow(window.location + txtPrint, 'PrintPage', 800, 500, 1, 1, 0);
}