function flipsearch(){
var searchbox = document.getElementById('searchbox').style;
var logocontainer = document.getElementById('logo_container').style;

	if(searchbox.visibility != 'visible'){
		searchbox.visibility = 'visible';
	}else{
	searchbox.visibility = 'hidden';
	}
}


function setOpacity(opacity, id) { 
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
	object.filter = "alpha(opacity=" + opacity + ")";
}

function getOpacity(id) {
	var object = document.getElementById(id).style; 
	if (object.opacity) return (object.opacity*100);
	return (100);
}

function domainSubmit(setOp,el1,el2){

statusmsg = document.getElementById(el1);
domain = document.frmDomainSearch.domainToCheck.value;


	if(domain!=''){
		if(setOp){
			setOpacity(50,el2);
			statusmsg.style.visibility = 'visible';
			document.frmDomainSearch.submit();	
		}
		else
		{
			setOpacity(100,el2);
			statusmsg.style.visibility = 'hidden';		
		}
	}
}

function addEngine1()
{
	window.external.AddSearchProvider('http://www.mycheapdomains.com.au');
}

function addEngine(name,ext,cat,type)
{
    if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) { 
        window.sidebar.addSearchEngine(
            "http://www.mycheapdomains.com.au/search_plugin/"+name+".src",
            "http://www.mycheapdomains.com.au/search_plugin/"+name+"."+ext, name, cat
        );
    } else {
        alert("Sorry, you need a Mozilla-based browser to install a search plugin.");
    } 
}

function myLogon(){
	myUrl = "https://idp.securepaynet.net/login.aspx?se=%2B&prog%5Fid=mycheapdomains&spkey=SPSWEB42&target="
	login = "&login="+document.frmLogin.login.value;
	//alert(myUrl+login);
	window.location = myUrl+login;
	return false;
}

function openDomainDealPopup()
{
	var win=window.open('https://www.securepaynet.net/gdshop/jump_pages/domaindeal.asp?se=+&prog%5Fid=mycheapdomains&app%5Fhdr=99', 'domaindealwin', 'left=50,top=50,resizable=yes,scrollbars=yes,width=430,height=280');
}

/* dropdown menu scripts */

var agt=navigator.userAgent.toLowerCase();
var is_safari = agt.indexOf("safari")!=-1;
function mainovr(div,name,status){
	if(is_safari){
		bHover=name; Act(div,name,false);window.status=status;}
	else{
		bHover=name;window.status=status;setTimeout('Act(\'' + div + '\', \'' + name + '\', false)',400);}
}
function findDiv(n, d) { 
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findDiv(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function tNav() { 
	var i,p,v,obj,args=tNav.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findDiv(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    if(v=='visible')setPosition(args[i]);    
    obj.visibility=v;} 
}
function hde(sect) {
  tNav('dom','','hide');tNav('host','','hide');tNav('sslhdr','','hide');tNav('em','','hide');tNav('eco','','hide');tNav('webs','','hide');showElement('SELECT');
}
function hideDD(sect) {
  tNav(sect,'','hide');hde(sect);
}
var secSet = null;
var activeTimer = null;
var bHover = '';
function Act(sect, windowStatusVal, bshow) {
	hde(sect);
	if ((bHover==windowStatusVal)||(bshow)){		
		tNav(sect,'','show');
		if (secSet != null) window.clearTimeout(secSet);		
		hideElement('SELECT', document.all[sect]); 
	}
}
function setPosition(sect)
{
  var obj, objstyle, overobj, len=0;
  overobj=findDiv(sect+"_td");
  obj=findDiv(sect);
  if (eval(overobj.offsetLeft+obj.offsetWidth) > overobj.offsetParent.offsetWidth){
	len = eval(overobj.offsetLeft+obj.offsetWidth)-overobj.offsetParent.offsetWidth;}
  if (obj.style) { objstyle=obj.style;
  objstyle.left = overobj.offsetLeft-len;}
}
function Tim(sect){
	if (secSet != null) window.clearTimeout(secSet);
	secSet = window.setTimeout('hideDD("' + sect + '")',500);
}

function hideElement( elmID, overDiv ) {
  if(document.all) {
    for(i = 0; i < document.all.tags( elmID ).length; i++) {
      obj = document.all.tags( elmID )[i];
      if(!obj || !obj.offsetParent) continue;
      // Find the element's offsetTop and offsetLeft relative to the BODY tag.
      objLeft   = obj.offsetLeft - overDiv.offsetParent.offsetLeft;
      objTop    = obj.offsetTop;
      objParent = obj.offsetParent;
      while(objParent.tagName.toUpperCase() != 'BODY') {
        objLeft  += objParent.offsetLeft;
        objTop   += objParent.offsetTop;
        objParent = objParent.offsetParent;}
      objHeight = obj.offsetHeight;
      objWidth  = obj.offsetWidth;            
      if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
      else if((overDiv.offsetParent.offsetTop + overDiv.offsetHeight + 50) <= objTop);
      else if(overDiv.offsetTop >= eval(objTop + objHeight));
      else if(overDiv.offsetLeft >= eval(objLeft + objWidth));
      else {
        obj.style.visibility = 'hidden';
      }
    }
  }
}

function showElement(elmID) {
  if(document.all) {
    for(i = 0; i < document.all.tags( elmID ).length; i++) {
      obj = document.all.tags(elmID)[i];
      if(!obj || !obj.offsetParent) continue;
      obj.style.visibility = '';
    }
  }
}





