﻿// JScript File
function Goto_Search_Page()
{


    //alert(document.getElementById("search_text").value); 
    if(document.getElementById("search_text").value=="Search the site")
    {
         alert("please enter search text..");
    }
    else if(document.getElementById("search_text").value=="")
    {
         alert("please enter search text..");
    }
    else
    {
        location.href="../search.aspx?search_text="+document.getElementById("search_text").value+"#sitesearch";
    }
}
function fnGoClick()
{
    //alert(window.event.keyCode);
	if (window.event.keyCode == 13) 
	{
		
		if (document.getElementById("search_text").value!="Search the site")
		{
			document.getElementById("go_btn").click();
			return false;
		}
	}
	return true;
}
function alltrim(para)
{
var word, temp, chr, flag;

word = para;
word = rtrim(ltrim(word))
return word;
}
function ltrim(para)
{
var word, temp, chr, flag;
word = para;
if (word.length>0){
	flag = false;
	temp = '';
	for (i=0;i<word.length;i++){
		chr = word.charAt(i);
		if (chr!=' '){
			flag = true;
		}
		if (flag==true){
			temp = temp + chr;
		}
	}
	word = temp;
}
return word;
}
function rtrim(para)
{
var word, temp, chr, flag;
word = para;
if (word.length>0){
	flag = false;
	temp = '';
	for (i=word.length - 1;i>=0;i--){
		chr = word.charAt(i);
		if (chr!=' '){
			flag = true;
		}
		if (flag==true){
			temp = chr + temp;
		}
	}
	word = temp;
}
return word;
}

 



