
//function for print
function funPrint(spath){
//alert(location.href);
path= location.href;
window.open(spath + "print.php?path='" + path +"'", 'printwindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600,left = 162,top = 134');
}

//function for sendmail
function openWindowmail(spath) {
path= location.href;
window.open(spath + "mailbox.php?path='" + path +"'", 'mailwindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600,left = 162,top = 134');
}


//function for rss
function rssFeed()
{
	path= location.href;
	window.location.href="/rss.php?path="+path;
}

//function for rss for homepages
function rssFeedHomePage()
{
	aPath = location.href.split('/');

	var sPath ="";
	for (var i=0;i<(aPath.length-1) ;i++ )
	{
		if (i >2 )
		{
			if (sPath.length==0)
			{
				sPath =aPath[i];
			}else 
			{
				sPath =sPath+"/"+aPath[i];
			}
		}
	}
	window.location.href="/rss_homepage.php?path="+sPath;
}

// Starts "trim" function
function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { 
	  retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   
   return retValue; 
} // Ends the "trim" function

//function for search
function sSearch() 
{
	var search = trim(document.form1.search.value);
	if (search.length >0)
	{
		//window.location.href="/searchresult.php?query=" + search;
		document.form1.action="/searchresult.php?query=" + search;
		return true;
	}else 
	{
		alert("Please enter search string.");
		return false;
	}
	
}
