var ns6 = false
if ((!document.all) && document.getElementById) {
	ns6 = true
	document.all = document.getElementById;
}

var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false


function showElement(divMenu) {
   if (divMenu != ''){
	 if (document.getElementById(divMenu)){
      document.getElementById(divMenu).style.visibility = "inherit";
      if(document.getElementById(divMenu).style.display){
		document.getElementById(divMenu).style.display='block'
      }
      if (ns6==true) {
      	document.getElementById(divMenu).style.display = "inline";
      }
     }
    }
}
function hideElement(divMenu) {
   if (divMenu != ''){
	 if (document.getElementById(divMenu)){
      document.getElementById(divMenu).style.visibility = "hidden";
      if(document.getElementById(divMenu).style.display){
		document.getElementById(divMenu).style.display='none'
      }
      if (ns6==true) {
      	document.getElementById(divMenu).style.display = "none";
      }
     }
    }
}
function hideElementDoc(doc,divMenu) {
   if (divMenu != ''){
	 if (doc.getElementById(divMenu)){
      doc.getElementById(divMenu).style.visibility = "hidden";
      if (ns6==true) {
      	doc.getElementById(divMenu).style.display = "none";
      }
     }
    }
}

function getHTMLElement(divMenu) {
   if (divMenu != ''){
	 if (document.getElementById(divMenu)){
      return document.all(divMenu);
     }
   }
}
function positionOnCenter(doc){
	var diff=Math.floor((doc.body.scrollHeight-doc.body.clientHeight)/2);
	doc.body.scrollTop=diff;
	
}

function centerPage(elm){
	//elm.style.posTop=Math.floor((document.body.clientHeight/2)- (elm.clientHeight/2))
	//elm.style.posLeft=Math.floor((document.body.clientWidth/2)- (elm.clientWidth/2))
	//elm.style.height=elm.offsetTop+'px';
	//document.getElementById('showLoadingTable').style.height=elm.style.height;
	//alert(elm.style.height);
	var refElm=document.getElementById('showLoadingHelp');
	elm.style.height=refElm.offsetTop;
	elm.style.posTop=refElm.offsetTop -elm.clientHeight;
	hideElementDoc(document,'oneToBeHidden');
	positionOnCenter(document)
}
function centerPageWithDoc(elm,doc){
	//elm.style.posTop=Math.floor((doc.body.clientHeight/2)- (elm.clientHeight/2))
	//elm.style.posLeft=Math.floor((doc.body.clientWidth/2)- (elm.clientWidth/2))
	var refElm=doc.getElementById('showLoadingHelp');
	elm.style.height=refElm.offsetTop;
	elm.style.posTop=refElm.offsetTop -elm.clientHeight;
	hideElementDoc(doc,'oneToBeHidden');
	positionOnCenter(doc)
}
function MM_reloadPage(init) {
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function redirectMe(url){
	var myred=window.open(url,'outasite','width=700,height=400,directories=0,resizable=1,status=1,toolbar=1,scrollbars=1');myred.focus();
}
function showAgreement(url){
	var myred=window.open(url+'?REDUCT=1','agree','width=593,height=400,directories=0,resizable=1,status=1,toolbar=0,scrollbars=1,location=0');myred.focus();
}
function helpME(url){
	var myred=window.open(url,'helpme','width=593,height=400,directories=0,resizable=1,status=1,toolbar=0,scrollbars=1,location=0');myred.focus();
}
function showNews(id){
	var myred=window.open('/sitehelp/show-news.asp?REDUCT=1&ID='+escape(id),'news','width=593,height=410,directories=0,resizable=1,status=1,toolbar=0,scrollbars=1,location=0');myred.focus();
}
function scrollit(seed)
{
  var m1  = "  Offers cheapest domain name registration and renewals.          ";
  var m2  = "    Only $8.49/yr for .com, .net & .org ...    ";
  var m3  = "    Back-order domain name for only $15.00 ...          Many FREE services included - search engine submission, keyword density analyzer and more...      ";
  var msg=m1+m2+m3;
  var out = "Unpicked.com                ";
  var c   = 1;
  if (seed > 100) {
    seed--;
    var cmd="scrollit(" + seed + ")";
    timerTwo=window.setTimeout(cmd,100);
  }
  else if (seed <= 100 && seed > 0) {
    for (c=0 ; c < seed ; c++) {
      out+=" ";
    }
    out+=msg;
    seed--;
    var cmd="scrollit(" + seed + ")";
    window.status=out;
    timerTwo=window.setTimeout(cmd,100);
  }
  else if (seed <= 0) {
    if (-seed < msg.length) {
      out+=msg.substring(-seed,msg.length);
      seed--;
      var cmd="scrollit(" + seed + ")";
      window.status=out;
      timerTwo=window.setTimeout(cmd,100);
    }
    else {
      window.status=" ";
      timerTwo=window.setTimeout("scrollit(100)",75);
    }
  }
}

// enableBanner is used only with TrafficG banners because they display some text
// under the banner which should be hidden
function enableBanner(id)
{
	//document.all(id).style.visibility='visible';
	var xobj=document.all(id);
	// third tag in html returned by trafficG .js is <img> tag that should be visible
	if (ns6==true) {
		/*var x=xobj.childNodes;
		for(i=0;i<x.length;i++){
			var y=x[i].childNodes;
			for(j=0;j<y.length;j++){
				if(y[j].tagName=="A"){
					var u=y[j].childNodes;
					for(var z=0;z<u.length;z++){
						if(u[z].tagName=="IMG")
							u[z].style.display="inline"
					}
				}
			}
		}*/
  }	
  else{
		xobj.all(2).style.visibility='visible';
	}
}

function showAndLoadWaitingPage(frm,doSubmit)
{
	var myElm=getHTMLElement('showLoading');
	myElm.style.top=0;
	myElm.style.width='100%';
	myElm.style.height='100%';
	showElement('showLoading');
	hideElement('domainTLDSelectBox');
	centerPage(myElm);
	if (doSubmit) frm.submit();
}

function LoadLocalAgent(CharID, CharACS) {
	LoadReq = wolfi.Characters.Load(CharID, CharACS);
	return(true);
}

function showPageAdds(){
showElement('tableWithAds');
document.getElementById('qsrvAds').appendChild(document.getElementById('tableWithAds'));
}
