
function Trim(str)
	{
		var resultStr = "";
		resultStr = TrimLeft(str);
		resultStr = TrimRight(resultStr);
		return resultStr;
	}

function TrimLeft( str )
	{
		var resultStr = "";
		var i = len = 0;
		if (str+"" == "undefined" || str == null)
		return null;
		str += "";

	if (str.length == 0)
		resultStr = "";
	else {
	  	len = str.length - 1;
		len = str.length;

  		while ((i <= len) && (str.charAt(i) == " "))
			i++;
	 		resultStr = str.substring(i, len);
	  	}
	  	return resultStr;
}

function TrimRight( str ) {
	var resultStr = "";
	var i = 0;
	if (str+"" == "undefined" || str == null)
		return null;
	str += "";

	if (str.length == 0)
		resultStr = "";
	else {
  		i = str.length - 1;
  		while ((i >= 0) && (str.charAt(i) == " "))
 		i--;
  		resultStr = str.substring(0, i + 1);
  		}
  	return resultStr;
}

function openwin(winUrl)
		{
	my_window = window.open(winUrl,"",config="toolbar=1,location=1,top="+parseInt(window.screen.height)* (1/100)+",left="+parseInt(window.screen.width)* (1/100)+",menubar=1,scrollbars=1,width=770,height=400,resizable=1")
		}
		
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// Show/Hide functions for non-pointer layer/objects
function show(id) {
	if (ns4) document.layers[id].visibility = "show"
	else if (ie4) document.all[id].style.visibility = "visible"
}

function hide(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else if (ie4) document.all[id].style.visibility = "hidden"
}

function goSearch()
{
if(Trim(document.forms[0].search.value)=="")
{
	alert("Enter a keyword for search");
	document.forms[0].search.value =""
	document.forms[0].search.focus();

}
else
{
	document.forms[0].method="post";
	document.forms[0].action="../private/keyword_search.asp?CurrentPage=1";
	//document.forms[0].CurrentPage.value=1;
	document.forms[0].submit();
}
}
function goSearch1()
{

if(Trim(document.forms[0].search.value)=="")
	{
	       	alert("Enter a keyword for search");
		document.forms[0].search.value =""
		document.forms[0].search.focus();

	}
else
	{
		document.forms[0].method="post";
		document.forms[0].action="private/keyword_search.asp?CurrentPage=1";
		document.forms[0].submit();
	}
}


function openwinMesg(winUrl)
		{
		my_window = window.open(winUrl,"","toolbar=0,location=0,top= "+parseInt(window.screen.height)* (50/190)+",left="+parseInt(window.screen.width)* (50/95)+",menubar=0,scrollbars=0,width=347,height=509,resizable=1")
}

function fnOpen(url)
 {
window.close()
		//window.parent.close()
		//window.opener.document.forms[0].action=url
		//window.opener.document.forms[0].method="post"
		//window.opener.document.forms[0].submit()

}
function divOver(){
	args = divOver.arguments;
	if(br=="N"){}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if(theObj.style.backgroundColor="ffffff"){
			theObj.style.backgroundColor="cccccc";
		}
	}
	else{return}
}

function divOut(){
	args = divOut.arguments;
	if(br=="N"){}
	else if(br=="IE"){
	theObj=eval(args[0]);
		if(theObj.style.backgroundColor="ffffff"){
			theObj.style.backgroundColor="cccccc";
		}
	}
	else{return}
}
