function parseSearchString() {
	  var ss = TrimAll(document.searchForm.searchString.value);

	  if (ss.length > 0) {

		  ss = ss.replace(" ", "* ");
	  	ss = ss + "*";
	  }

	  document.searchForm.search.value = ss;
}

function LTrimAll(str) {
	if (str==null){return str;}
	for (var i=0; str.charAt(i)==" " || str.charAt(i)=="\n" || str.charAt(i)=="\t"; i++);
	return str.substring(i,str.length);
	}
function RTrimAll(str) {
	if (str==null){return str;}
	for (var i=str.length-1; str.charAt(i)==" " || str.charAt(i)=="\n" || str.charAt(i)=="\t"; i--);
	return str.substring(0,i+1);
	}
function TrimAll(str) {
	return LTrimAll(RTrimAll(str));
}


function printOvamApplication(){
	var currentLocation = window.location.href;

	if (currentLocation.indexOf("?") < 0 ){
		currentLocation += "?print=1";
	}
	else{
			currentLocation = currentLocation.slice(0, currentLocation.indexOf("?")+1) + "print=1";
	}
	var ovamPrintWindow = window.open('' ,'ovamPrintWindow','width=590,height=600, toolbar=no, scrollbars=yes, location=no, resizable=yes');
	
	ovamPrintWindow.document.write("<html><head>");
	var OVAM_NS4 = false;

	if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
		OVAM_NS4 = true;
	}

	ovamPrintWindow.document.write('<LINK rel="stylesheet" type="text/css" href="/jahia/jsp/jahia/templates/myjahiasite/ovam/stylesheet/main' + ((OVAM_NS4)?'_nn':'') + '.css">');
	ovamPrintWindow.document.write("<body>");
	ovamPrintWindow.document.write("<br><br>" + document.getElementById("application_print_content").innerHTML + "</body></html>");
	ovamPrintWindow.document.close();
	ovamPrintWindow.print();
}