// JScript File

function parm()
{
txtsearch= document.getElementById('bb').value ;
qs = new Querystring()

y = qs.get("hgd","");
z = qs.get("hid","");
}
function Querystring()
{
// get the query string, ignore the ? at the front.
var querystring=location.search.substring(1,location.search.length);
// parse out name/value pairs separated via &
	var args = querystring.split('&');
// split out each name = value pair
	for (var i=0;i<args.length;i++)
	{
		var pair = args[i].split('=');
		// Fix broken unescaping
		temp = unescape(pair[0]).split('+');
		name = temp.join(' ');
		temp = unescape(pair[1]).split('+');
		value = temp.join(' ');
		this[name]=value;
	}
	this.get=Querystring_get;
}
function Querystring_get(strKey,strDefault)
{
	var value=this[strKey];
	if (value==null)
	{
		value=strDefault;
	}
	return value;

}

function brand()
{
parm();
   document.getElementById('b1').style.color= "black";
   document.getElementById('p1').style.color= "green";
   document.getElementById('t1').style.color= "green";
   document.getElementById('c1').style.color= "green";
   	
   document.getElementById("p1").style.fontWeight= "normal";
   document.getElementById("t1").style.fontWeight= "normal";
   document.getElementById("c1").style.fontWeight= "normal";
   document.getElementById("b1").style.fontWeight= "bold";
   
   document.getElementById("b1").style.fontSize= "14px";
   document.getElementById("p1").style.fontSize= "12px";
   document.getElementById("t1").style.fontSize= "12px";
   document.getElementById("c1").style.fontSize= "12px";
  
 if(document.getElementById('bb').value == "")
    {
   
    alert("Please enter the Search Text");
    document.getElementById('bb').focus() ;
    return (false);
    }


 self.location='Brandnamesearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;
}

function ps()
{
parm();
document.getElementById('b1').style.color= "green";
   document.getElementById('t1').style.color= "green";
   document.getElementById('c1').style.color= "green";
 
   document.getElementById('p1').style.color= "black";
   	document.getElementById("p1").style.fontWeight= "bold";
   document.getElementById("p1").style.fontSize= "14px";
   document.getElementById("b1").style.fontSize= "12px";
   document.getElementById("t1").style.fontSize= "12px";
   document.getElementById("c1").style.fontSize= "12px";
   

	document.getElementById("b1").style.fontWeight= "normal";

document.getElementById("t1").style.fontWeight= "normal";

document.getElementById("c1").style.fontWeight= "normal";

if(document.getElementById('bb').value == "")
    {
 
    alert("Please enter the Search Text");
      document.getElementById('bb').focus() ;
    return (false);
    }

 self.location='Productsevicesearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;
}

function company()
{
parm();
document.getElementById('b1').style.color= "green";
   document.getElementById('p1').style.color= "green";
   document.getElementById('t1').style.color= "green";
 
   document.getElementById('c1').style.color= "black";
   document.getElementById("p1").style.fontWeight= "normal";

	document.getElementById("b1").style.fontWeight= "normal";

document.getElementById("t1").style.fontWeight= "normal";

document.getElementById("c1").style.fontWeight= "bold";

   document.getElementById("c1").style.fontSize= "14px";
   document.getElementById("p1").style.fontSize= "12px";
   document.getElementById("t1").style.fontSize= "12px";
   document.getElementById("b1").style.fontSize= "12px";
   

if(document.getElementById('bb').value  == "")
    {
    alert("Please enter the Search Text");
      document.getElementById('bb').focus() ;
    return (false);
    }

 self.location='searchcompany.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;
}

function telephone()
{
parm();
document.getElementById('b1').style.color= "green";
   document.getElementById('p1').style.color= "green";
   document.getElementById('c1').style.color= "green";
 
   document.getElementById('t1').style.color= "black";
   document.getElementById("p1").style.fontWeight= "normal";

	document.getElementById("b1").style.fontWeight= "normal";

document.getElementById("t1").style.fontWeight= "bold";

document.getElementById("c1").style.fontWeight= "normal";
   document.getElementById("t1").style.fontSize= "14px";
   document.getElementById("p1").style.fontSize= "12px";
   document.getElementById("b1").style.fontSize= "12px";
   document.getElementById("c1").style.fontSize= "12px";
   

if(document.getElementById('bb').value  == "")
    {
    alert("Please enter the search text.");
      document.getElementById('bb').focus();
    return (false);
    }

 self.location='Telephonefaxsearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;
}

function buttonclicking()
{
parm();
if(document.getElementById('bb').value  == "")
    {
 
    alert("Please enter the Search Text");
      document.getElementById('bb').focus() ;
    return (false);
    }
 
  
else if (document.getElementById('p1').style.color== "black")
{


 self.location='Productsevicesearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;
}

else if (document.getElementById('b1').style.color== "black")
{

 self.location='Brandnamesearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
else if (document.getElementById('t1').style.color== "black")
{

 self.location='Telephonefaxsearch.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
else if (document.getElementById('c1').style.color== "black")
{

 self.location='searchcompany.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
else 
{
alert ("Please select the type of search you want to do");
}

}

document.onkeypress= processkey;
function processkey(e)
{
  if (null == e)
    e = window.event ;
    
  if (e.keyCode == 13)  
  {
    buttonclicking();
    return false;
}
}

function terms()
{
window.open('term of condition.html');
return false;
}

function about()
{

parm();
 self.location='about us.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function product()
{
parm();

 self.location='product.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}

function tips()
{
parm();

 self.location='tips.htm?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function ad()
{
parm();
 self.location='ad.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function free()
{
parm();
 self.location='freebook.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}

function enquiry()
{
parm();
 self.location='enquiry.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function request()
{
parm();

 self.location='request.htm?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function faq()
{
parm();
 self.location='faq.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function contact()
{
parm();
 self.location='contact us.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function partner()
{
parm();
 self.location='our partners.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function update()
{
parm();
 self.location='updateform.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function testimonial()
{
parm();

 self.location='testimonal.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}

function career()
{
parm();
 self.location='career.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function features()
{
parm();
 self.location='features.html?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}

function home()
{
parm();
 self.location='home.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function login()
{
parm();
 self.location='loginpage.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function register()
{
parm();
 self.location='registration.aspx?search=' + escape(txtsearch)+'&hgd='+y+'&hid='+z;

}
function welcome()
{
parm();
if (z=="")
{
document.getElementById('weldata').style.display= "none"; 
return false;
}
else {
document.getElementById('weldata').style.visibility= "visible";
document.getElementById('val').innerText= z;
return true;
}
}

function focusing()
{
document.getElementById('bb').focus();
}


