function MakeAlphaString(lastchar,PhoneNumber){

	var str = ""
	str = str + PhoneNumber
	var l = str.length
	var c = ""
	var crest = ""
	var theResult = ""
	if (str.length >= 1) {
		c = str.substring(0, 1)
		crest = str.substring(1, str.length)
			
		if ((c >= "2") && (c <= "9")){
		
			if (c == "2"){
				theResult = theResult + MakeAlphaString(lastchar + "a", crest)
				theResult = theResult + MakeAlphaString(lastchar + "b", crest)
				theResult = theResult + MakeAlphaString(lastchar + "c", crest)
			} else if (c == "3"){
				theResult = theResult + MakeAlphaString(lastchar + "d", crest)
				theResult = theResult + MakeAlphaString(lastchar + "e", crest)
				theResult = theResult + MakeAlphaString(lastchar + "f", crest)
			} else if (c == "4"){
				theResult = theResult + MakeAlphaString(lastchar + "g", crest)
				theResult = theResult + MakeAlphaString(lastchar + "h", crest)
				theResult = theResult + MakeAlphaString(lastchar + "i", crest)
			} else if (c == "5"){
				theResult = theResult + MakeAlphaString(lastchar + "j", crest)
				theResult = theResult + MakeAlphaString(lastchar + "k", crest)
				theResult = theResult + MakeAlphaString(lastchar + "l", crest)
			} else if (c == "6"){
				theResult = theResult + MakeAlphaString(lastchar + "m", crest)
				theResult = theResult + MakeAlphaString(lastchar + "n", crest)
				theResult = theResult + MakeAlphaString(lastchar + "o", crest)
			} else if (c == "7"){
				theResult = theResult + MakeAlphaString(lastchar + "p", crest)
				theResult = theResult + MakeAlphaString(lastchar + "q", crest)
				theResult = theResult + MakeAlphaString(lastchar + "r", crest)
				theResult = theResult + MakeAlphaString(lastchar + "s", crest)
			} else if (c == "8"){
				theResult = theResult + MakeAlphaString(lastchar + "t", crest)
				theResult = theResult + MakeAlphaString(lastchar + "u", crest)
				theResult = theResult + MakeAlphaString(lastchar + "v", crest)
			} else if (c == "9"){
				theResult = theResult + MakeAlphaString(lastchar + "w", crest)
				theResult = theResult + MakeAlphaString(lastchar + "x", crest)
				theResult = theResult + MakeAlphaString(lastchar + "y", crest)
				theResult = theResult + MakeAlphaString(lastchar + "z", crest)
			}
		} else {
			theResult = theResult + MakeAlphaString(lastchar + c, crest)
		}
	} else {
		theResult = theResult +  lastchar + "\r"
	}
	return theResult

}


function UpdateForm2(){
	document.phoneform2.anumber.value = MakeAlphaString("", document.phoneform2.rnumber.value)
}

function MakeNumberString(){

	var str = ""
	str = str + document.getElementById('alphanumber').value
	var l = str.length
	var theResult = ""
	var c = ""

	for(i = 1; i <= l; i++){
		c = str.substring(i-1, i)
		if ((c >= "a") && (c <= "z") || (c >= "A") && (c <= "Z")){
		
			if ((c >= "a") && (c <= "c") || (c >= "A") && (c <= "C")){
				theResult = theResult + "2"
			} else if ((c >= "d") && (c <= "f") || (c >= "D") && (c <= "F")){
				theResult = theResult + "3"
			} else if ((c >= "g") && (c <= "i") || (c >= "G") && (c <= "I")){
				theResult = theResult + "4"
			} else if ((c >= "j") && (c <= "l") || (c >= "J") && (c <= "L")){
				theResult = theResult + "5"
			} else if ((c >= "m") && (c <= "o") || (c >= "M") && (c <= "O")){
				theResult = theResult + "6"
			} else if ((c >= "p") && (c <= "s") || (c >= "P") && (c <= "S")){
				theResult = theResult + "7"
			} else if ((c >= "t") && (c <= "v") || (c >= "T") && (c <= "V")){
				theResult = theResult + "8"
			} else if ((c >= "w") && (c <= "z") || (c >= "W") && (c <= "Z")){
				theResult = theResult + "9"
			}
		} else {
			theResult = theResult + c
		}
	}
	document.getElementById('realnumber').value=theResult;
	return theResult

}

function submitenter(e)
{
	var keycode;
	if (window.event)
	{
		keycode = window.event.keyCode;
	}
	else if (e)
	{
		keycode = e.which;
	}
	else
	{
		return true;
	}

	if (keycode == 13)
	   {
	    MakeNumberString()
	   return false;
	   }
	else
	{
	   return true;
	}

}

function setFocus_toolslist() {
    document.getElementById('Text1').focus();
}

function setFocus_convertphonenumber() {
    document.getElementById('alphanumber').focus();
}

function addToFavorites() { 

	if (window.external) { 
		window.external.AddFavorite(location.href,document.title) 
	} else { 
		alert("Sorry! Your browser doesn't support this function."); 
		} 
}

function Button1_onclick() {
/*var url=document.getElementById('Text1').value;

var yahoosrc = 'http://search.yahoo.com/search?ei=utf-8&fr=slv8-msgr&p='+encodeURI(url);
alert(yahoosrc);
var googlesrc = 'http://www.google.com/search?q='+encodeURI(url);
var livesrc ='http://search.live.com/results.aspx?q='+encodeURI(url)+ '&mkt=en-us&FORM=LIVSOP';

parent.frames[1].location.href =   yahoosrc;
parent.frames[2].location.href =   googlesrc;
parent.frames[3].location.href =   livesrc;
parent.frames[4].location.href="counter.htm";*/
url = encodeURI(document.getElementById('Text1').value);
var eFlag;
eFlag = '000';
var yahoochk;
  var googlechk;
  var livechk;
  yahoochk = document.getElementById('yahoochk').checked;
  googlechk = document.getElementById('googlechk').checked;
  livechk =document.getElementById('livechk').checked;
  if(yahoochk == true && googlechk == true && livechk == true)
  {
  	eFlag = '111';
  }
  else if (yahoochk  ==true && googlechk  == true && livechk  == false)
  {
 	 eFlag ='110';
  }
  else if(yahoochk  ==true && googlechk  == false && livechk  == true)
  {
  	eFlag = '101';
  }
  else if(livechk  == true && googlechk  == true && yahoochk  ==false)
  {
  	eFlag = '011';
  }
  else if(yahoochk  ==true && googlechk  == false && livechk  == false)
  {
  	eFlag = '100';
  }
  else if(yahoochk  ==false && googlechk  == true && livechk  == false)
  {
  	eFlag = '010';
  }
  else if(yahoochk  ==false && googlechk  == false && livechk  == true)
  {
  	eFlag = '001';
  }
parent.window.location = 'http://www.seeaarch.com/mainweb.htm?'+ eFlag + url;
}
function submitenter(e)
{
	var keycode;
	if (window.event)
	{
		keycode = window.event.keyCode;
	}
	else if (e)
	{
		keycode = e.which;
	}
	else
	{
		return true;
	}

	if (keycode == 13)
	   {
	    Button1_onclick()
	   return false;
	   }
	else
	{
	   return true;
	}

}
function hideFrame() {
    var frameset = parent.document.getElementById('masterFrameset');
   // origCols = frameset.cols;
  //  alert(document.getElementById('yahoochk').value);
  var yahoochk;
  var googlechk;
  var livechk;
  yahoochk = document.getElementById('yahoochk').checked;
  googlechk = document.getElementById('googlechk').checked;
  livechk =document.getElementById('livechk').checked;
  if(yahoochk == true && googlechk == true && livechk == true)
  {
  	frameset.cols = "30%,40%,*";
  }
  else if (yahoochk  ==true && googlechk  == true && livechk  == false)
  {
 	 frameset.cols = "50%,50%,*";
  }
  else if(yahoochk  ==true && googlechk  == false && livechk  == true)
  {
  	frameset.cols = "50%,0,*";
  }
  else if(livechk  == true && googlechk  == true && yahoochk  ==false)
  {
  	frameset.cols = "0,50%,*";
  }
  else if(yahoochk  ==true && googlechk  == false && livechk  == false)
  {
  	frameset.cols = "30%,0,0";
  }
  else if(yahoochk  ==false && googlechk  == true && livechk  == false)
  {
  	frameset.cols = "0,100%,*";
  }
  else if(yahoochk  ==false && googlechk  == false && livechk  == true)
  {
  	frameset.cols = "0,0,100%";
  }


}

function showFrame() {
    document.getElementById("masterFrameset").cols = origCols;
    origCols = null;
}
