 var nc;
 function addBookmark()
 {
 	if (window.sidebar && window.sidebar.addPanel)
 	{
 		window.sidebar.addPanel("iWEBTOOL Instant Domain Check-up","http://www.iwebtool.com/instant/",'');
 	}
 	else if ( window.external && (navigator.platform=='Win32' || (window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1)) )
 	{
 		window.external.AddFavorite("http://www.iwebtool.com/instant/","iWEBTOOL Instant Domain Check-up");
 	}
 	else if (document.layers)
 	{
 		window.alert('Please click OK then press Ctrl+D to create a bookmark');
 	}
 	else
 	{
 		window.alert('Please use your browser\'s bookmarking facility to create a bookmark');
 	}
 	return false;
 }
 var t=0;
 var ld=0;
 function createXMLHttpRequest()
 {
 	var ua;
 	if(window.XMLHttpRequest)
 	{
 		try
 		{
 			ua = new XMLHttpRequest();
 		} catch(e)
 		{
 			ua = false;
 		}
 	}
 	else if(window.ActiveXObject)
 	{
 		try
 		{
 			ua = new ActiveXObject("Microsoft.XMLHTTP");
 		}
 		catch(e)
 		{
 			ua = false;
 		}
 	}
 return ua;
 }
 var reqsuggest = createXMLHttpRequest();
 var req = createXMLHttpRequest();
 var reqtwo = createXMLHttpRequest();
 
 function sendRequest(domain,ext,type)
 {
 	if (!t)
 	{
 		return false;
 	}
 	domain = domain.replace('&',"%26");
 	if (type==2)
 	{
 		t = 0;
 		reqsuggest.open('get', 's.php?q='+domain);
 		reqsuggest.onreadystatechange = handleResponsesuggestion;
 		reqsuggest.send(null);
 	}
 	if (type == 1)
 	{
 		req.open('get', 'g.php?ext='+ext+'&domain='+domain);
 		req.onreadystatechange = handleResponse;
 		req.send(null);
 	}
 	if (type == 2)
 	{
 		reqtwo.open('get', 'g.php?ext='+ext+'&domain='+domain);
 		reqtwo.onreadystatechange = handleResponsetwo;
 		reqtwo.send(null);
 	}
 }
 
 function handleResponsesuggestion()
 {
 	if(reqsuggest.readyState == 4)
 	{
 		var response = reqsuggest.responseText;
 		document.all.psuggest.innerHTML=response;
 	}
 }
 
 function handleResponse()
 {
 	if(req.readyState == 4)
 	{
 		var response = req.responseText;
 		document.all.pdiv.innerHTML=response;
 	}
 }
 
 function handleResponsetwo()
 {
 	if(reqtwo.readyState == 4)
 	{
 		var response = reqtwo.responseText;
 		document.all.pdivtwo.innerHTML=response;
 	}
 }
 
 function sp()
 {
 	if (!document.pf.domain.value)
 	{
 		document.all.psuggest.innerHTML="<font size=2>Suggestions for your keyword will appear here.</font>";
 		document.all.pdivtwo.innerHTML="";
 		document.all.pdiv.innerHTML="<font size=2><b>Enter your domain into the box above and results should appear.</b></font>";
 		t=0;
 		return false;
 	}
 	if (ld == document.pf.domain.value)
 	{
 		return false;
 	}
 	if (!nc)
 	{
 		ld = document.pf.domain.value;
 	}
 	nc=0;
 	var iChars = "¦!@#$%^&*()+=_[]\\\';,£/{}|\":<>.? ";
 	for (var i = 0; i < document.pf.domain.value.length; i++)
 	{
 		if (iChars.indexOf(document.pf.domain.value.charAt(i)) != -1)
 		{
 			t=0;
 			document.all.psuggest.innerHTML="";
 			document.all.pdivtwo.innerHTML="";
 			document.all.pdiv.innerHTML="<font size=2 color=#FF0000><b>Invalid domain name.<br><br>Letters (a-z), numbers (0-9) and hyphen (-) are allowed only.</b></font>";
 			return false;
 		}
 	}
 	if (!t)
 	{
 		setTimeout('sendRequest(document.pf.domain.value,document.pf.one.value,1);', 900);
 		setTimeout('sendRequest(document.pf.domain.value,document.pf.two.value,2);', 900);
 		t=1;
 	}
 	document.all.pdiv.innerHTML="<table border=0 cellspacing=5 cellpadding=5><tr><td><font size=3 color=#C0C0C0><b>Looking for ."+document.pf.one.value+" domain, please wait...</b></font></td></tr></table>";
 	document.all.pdivtwo.innerHTML="<table border=0 cellspacing=5 cellpadding=5><tr><td><font size=3 color=#C0C0C0><b>Looking for ."+document.pf.two.value+" domain, please wait...</b></font></td></tr></table>";
} 