var count=0, scrw, scrh, prev_set,Set_Status;
var b, bVer, MenuLeft, MenuWidth, note_prev=0;
var listMenu, prevMenu, prevBox, strFront, strEnd;
var loaded = 'false'
var toggle=0;
var XMLHttpRequestObject = false; 

if (window.XMLHttpRequest) 
 {
  XMLHttpRequestObject = new XMLHttpRequest();
 }
else if (window.ActiveXObject) 
 {
  XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
 }

function whichVersion()
{
 scrh = screen.height;
 scrw = screen.width;
  prevMenu="";
 var myBrowser = navigator.userAgent;
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("5.0")!=-1)){b = "IE"; bVer=5;}
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("4.0")!=-1)){b = "IE"; bVer=4;}
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("3.0")!=-1)){b = "IE"; bVer=3;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("2.0")!=-1)){b = "NS"; bVer=2;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("3.0")!=-1)){b = "NS"; bVer=3;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("4.0")!=-1)){b = "NS"; bVer=4;}

 if (b=="IE")
  {
    strFront = "document.all.";
    strEnd = ".style";  }
 else
  {
   strFront = "document.";
   strEnd = "";
  }
}


function Format(set)
{
}

function getSel()
{
	var txt = '';
	var foundIn = '';
	if (window.getSelection)
	{
		txt = window.getSelection();
		foundIn = 'window.getSelection()';
	}
	else if (document.getSelection)
	{
		txt = document.getSelection();
		foundIn = 'document.getSelection()';
	}
	else if (document.selection)
	{
		txt = document.selection.createRange().text;
		foundIn = 'document.selection.createRange()';
	}
	else return;
	document.forms[0].selectedtext.value = 'Found in: ' + foundIn + '\n' + txt;
}

function ShowTab(set)
{
 document.getElementById("tab_main").className = "tab_content_hide";
 document.getElementById("tab_master").className = "tab_content_hide";
 switch(set)
  {
	 case 1:document.getElementById("tab_main").className = "tab_content_show";break;
	 case 2:document.getElementById("tab_master").className = "tab_content_show";break;
	 default: document.getElementById("tab_main").className = "tab_content_show";break;
	}
 document.ADMIN.tab.value = set;
}

function DomainSelect()
{
 var option, box;
 box = document.DOMAIN_SELECT.dom;
 option = box.options[box.selectedIndex].value;
 if(option == "NEW")document.getElementById("new_domain").className = "tab_content_show";
 else 
  {
	 document.getElementById("new_domain").className = "tab_content_hide";
//	 window.location = "generic_admin2.asp?dom=" + option;
	 document.DOMAIN_SELECT.submit();
	}
}

function CategoryList()
{
 var option, box;
 box = document.DOMAIN_NEW.CATSELECT;
 option = box.options[box.selectedIndex].value;
 if(XMLHttpRequestObject) 
  {
	 //XMLHttpRequestObject.open("GET", "http://ramrod/angie/rubbish/admin/xmlDomainList.asp?cat=" + option);
	 XMLHttpRequestObject.open("GET", "http://www.any-domains.com/admin/xmlDomainList.asp?cat=" + option);
   XMLHttpRequestObject.onreadystatechange = function() 
    { 
      if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) 
			 { 
        document.getElementById("DOMAINLISTING").innerHTML = XMLHttpRequestObject.responseText;
       } 
    } 
   XMLHttpRequestObject.send(null); 
  }
}

function DomainListSelect()
{
 var option, box;
 box = document.DOMAIN_NEW.domselect;
 option = box.options[box.selectedIndex].value;
 document.DOMAIN_NEW.NEW_DOMAIN.value = option;
}

function CreateUrl()
{
 var url,root;
 document.ADMIN.TABNAME.value = document.ADMIN.PAGENAME.value;
// if(document.ADMIN.PAGEURL.value =="")
//  {
	 root = document.ADMIN.DOMNAME.value;
	 root = root.replace(".co.uk","");
	 root = root.replace(".CO.UK","");
	 root = root.replace(".com","");
	 root = root.replace(".COM","");
	 document.ADMIN.ADKEY.value = root + " " + document.ADMIN.PAGENAME.value;
	 document.ADMIN.PAGETITLE.value = document.ADMIN.PAGENAME.value;
	 document.ADMIN.PAGEDESCRIPTION.value = root + " " + document.ADMIN.PAGENAME.value;
	 document.ADMIN.PAGEKEYWORDS.value = root + " " + document.ADMIN.PAGENAME.value;
//   url = root + "_" + document.ADMIN.PAGENAME.value;
	 url = document.ADMIN.PAGENAME.value;
   url = url.replace(/ /g,"_");
   url = url + ".asp";
   document.ADMIN.PAGEURL.value = url;
//  }
//alert(document.ADMIN.PAGETITLE.value);
}

function SubmitForm()
{
 document.ADMIN.submit();
}

function SiteDesigner(set,dom)
{
 var BuildWin;
 BuildWin = window.open("SiteBuilder.asp?did=" + dom, "Builder", "width=650,height=650,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 BuildWin.focus();
}

loaded = 'true'