function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=400,width=570,scrollbars=yes');
myform.target=windowname;
return true;
}
function searchText(){
	searchString = document.getElementById('search').value;
	document.location.href = 'pitta_search.php?do_search=1&searchtype=1&searchtext=' + 	searchString;
}

function emailPage(pageUrl){
	window.open('form_emailpage.php?pageUrl='+pageUrl, 'EmailForm', 'height=450,width=590,scrollbars=yes');
	//      <FORM style="padding:0px;margin:0px" id="emailpageform" METHOD="POST" ACTION="form_emailpage.php" onSubmit="popupform(this, 'emailpage')">

}

function printThis(){
	window.print();
}


function equalize(mode) {

 var left=document.getElementById('leftcolumn');
 var right=document.getElementById('rightcolumn');
 var leftcolumnrepeat = document.getElementById('leftcolumnRepeat');
 var contentContainer = document.getElementById('contentContainer');
	if(right.offsetHeight>left.offsetHeight) {
//	 left.style.height=contentContainer.offsetHeight + 'px';
	 leftcolumnrepeat.style.height = (right.offsetHeight - left.offsetHeight) + 15 + 'px'
	}
	//alert('left: ' + left.offsetHeight + ' right: ' + right.offsetHeight);

}

function setuplayout(mode){
	//equalize(mode);
	//loadsidebarbg(mode);

}

function printPage(pageUrl){
	window.open(pageUrl, 'printWin', 'width=930, height=700, scrollbars=1, menubar=1');
}
function checkEnter(e){ //e is event object passed from function invocation
	var characterCode;// literal character code will be stored in this variable
	if(e && e.which){ //if which property of event object is supported (NN4)
	e = e
	characterCode = e.which //character code is contained in NN4's which property
	}
	else{
	e = event
	characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
	searchText();//submit the form
	return false
	}
	else{
	return true
	}

}
