// JavaScript Document
var current_id=1;
var current_img='';

var cur,prv;
var search_url = 'http://search.sify.com/';
var s = new Array(new Array(  "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='top'><input type='text' id='search' class='textfield' name='q' valign='center'/></td></tr><tr><td align='center'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='30' align='center'><input type='submit' name='Submit' value='Google Search'/></td></tr></table>" , search_url + 'search.php','GET',search_url + 'images/home/SShome_07.gif',search_url + 'images/home/SShome_o_07.gif')
   ,new Array(  "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='top'><input type='text' id='search' class='textfield' name='q' valign='center'/></td></tr><tr><td align='center'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='30' align='center'><input type='submit' name='Submit' value='Google Search'/></td></tr></table>" , search_url + 'search.php','GET',search_url + 'images/home/SShome_07.gif',search_url + 'images/home/SShome_o_07.gif')
   ,new Array(  "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='top'><input type='text' id='search' class='textfield' name='q' valign='center'/></td></tr><tr><td align='center'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='30' align='center'><input type='submit' name='Submit' value='Google Search'/></td></tr></table>" , search_url + 'search.php','GET',search_url + 'images/home/SShome_07.gif',search_url + 'images/home/SShome_o_07.gif'));
function g(e) 
{ 
  return document.getElementById(e);
}
function more()
{
window.location = "search_new.php";
}
function show(id,query)
{
  pval = g('search').value;
 
  g('idiv').innerHTML = s[id][0];
  if(query)
    g('search').value = query;
  else
    g('search').value = pval;
  g('search').focus();  
 // g('inftxt').innerHTML = s[id][3];
}
function go() 
{
          var val=g('search').value;
		 if(val =='') 
		 {
			//makeAlert('Sify Search','Please enter the search keyword');
			alert("Please enter the search keyword");
			return false;
		}
		if(isWhitespace(val))
		{
		 alert("Blank space is not allowed");
		 return false;
        }
}
var reWhitespace = /^\s+$/;
   function isWhitespace(s)
   { 
	return(reWhitespace.test(s));
   }	
function activate(id,query)
{
  //if query is set , then the control has reached here due to
  // submit so set the icon
 // g('search').value = '';	
  if(query) {
    show(id -1,query);
  }
  else {
    //reset the previousely selected image
    if(current_id)
	  {
        
   //   g( 'Image' + current_id ).src = s[current_id - 1][4];
    show(id -1);
	  }
  }
 // g('Image' + id).src = s[id-1][5];

  current_id = id;
  current_img = s[id-1][4];

  if(s[id-1][1] == 'http://classifieds.sify.com/searchresults.php')
	 classified = "1";
  g('frminp').action = s[id-1][1];
  g('frminp').method = s[id-1][2];
   
}
var tone_id = 3;
var books_id = 5;
var mall_id = 4;
var prop_id = 10;
var start;



function dosubmit() {
  try {
    if(g('search').value != "")
	 {
	   g('frminp').submit();
	 }
  }
  catch(e){}
}
