function showFAQ(u){
	var w = window.open(u, "FAQWindow", "menubar=no, resizable=no, scrollbars=yes, status=0, location, toolbar=no, screenX=50, screenY=30, width=620, height=460");
	w.focus();
	return false;
}
function showMobilizer(u, w, h){
	var winopt = "menubar=no, resizable=no, scrollbars=yes, status=0, location, toolbar=no, screenX=50, screenY=30, width=" + w + ", height=" + h;
	var wnd = window.open(u, "InstantMobilizer", winopt);
	wnd.focus();	
	return false;
}
function openWindow(u, w, h){
	return window.open(u, "", "menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, screenX=50, screenY=30, width=" + w + ", height=" + h);
}
function openWindowNR(u, w, h){
	return window.open(u, "", "menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no, screenX=50, screenY=30, width=" + w + ", height=" + h);
}

function setCont(id, html, cssclass){
	var c = document.getElementById(id);
	c.className = cssclass;
	c.innerHTML = html;
}

function closeWindow(){
		window.close();
}
function show_hide(id){
	var i = document.getElementById(id);
	if (i.style.display == ""){
		i.style.display = "none";
	}
	else if (i.style.display == "none"){
		i.style.display = "";
	}		
}

function setContent(id, txt, Cclass){
	var c = document.getElementById("c" + id);
	c.className = Cclass;
	c.innerHTML = txt;
}

function checkAvailability(d, tld, id, tldId, pg, yr, minc){

	var liveSearchReq = false;
	var ret 
	
	setContent(id, 'Checking Availability', 'lkpResWork lkpResSml');
		
	if (window.XMLHttpRequest)
	{
		liveSearchReq = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		liveSearchReq = new ActiveXObject('Microsoft.XMLHTTP');
	}
	liveSearchReq.open('GET', '/wl.asp?q=' + d + tld, true);
	liveSearchReq.onreadystatechange=function() {
		if (liveSearchReq.readyState==4) {
			ret = parseInt(TrimString(liveSearchReq.responseText), 10);
			ajaxLookupResult(d, tld, id, ret, tldId, pg, yr, minc)

		}
	}
	liveSearchReq.send(null);
	return false;
}


function ajaxLookupResult(d, tld, id, res, tldId, pg, yr, minc){
	var cssClass;
	var innerHTML;
	
	if (res == 0){
		cssClass="lkpResSucc lkpResSml";
		
		innerHTML = "<form action='/basket/' method='post'><select name='yr'>" + yearsDrop(yr) + "</select>&nbsp;<input type='submit' value='Add' /><input type='hidden' name='action' value='additem' /><input type='hidden' name='return' value='" + pg + "' /><input type='hidden' name='nm' value='" + d + "' /><input type='hidden' name='tld' value='" + tld + "' />&nbsp; <span><a href='/domain-names/'> from " + minc + "/yr</a></span></form>";
			}
	else if (res == 1){
		cssClass="lkpResFail lkpResSml";
		innerHTML = '<div class="r"><a href="#" onClick="Javascript: view_whois(\'' + d + tld + '\');">Whois</a> | <a href="http://www.' + d + tld + '" target="_new">Website</a>';
		if (tldId != 18 && tldId != 19){
			innerHTML = innerHTML + "| <a href='/backorder/?q=" + d + "&t=" + tldId + "&td=" + tld + "'>Back order</a>";
		}
		//alert(innerHTML);
		innerHTML = innerHTML + "</div>Unavailable";
	}
	else if (res == 2){
		cssClass = "lkpResFail lkpResSml";
		innerHTML = "Invalid Domain Queried";
	}
	else if (res == 3){
		cssClass="lkpResFail lkpResSml"
		innerHTML = "Error Occurred. Please try again.";
	}
	else if (res == 4){
		cssClass="lkpResFail lkpResSml";
		innerHTML = "Exceeded acceptable use policy.  Please try again later.";
	}
	
	setContent(id, innerHTML, cssClass);
}


function yearsDrop(min){
	min = parseInt(min);
	var str = "";
	var i;
	if (min > 0){
		if (min == 3) {
			min = min-1
			for (i=2;i<=10;i++){
				str = str + "<option value='" + i + "'>" + i + " Year";
				if (i>1){str = str + "s"};
				str = str + "</option>";
			}
		}
		else {
			i = min
			str = str + "<option value='" + i + "'>" + i + " Year";
			if (i>1){str = str + "s"};
			str = str + "</option>";
		}
	}
	else if (min == 0){
		for (i=1;i<=10;i++){
			str = str + "<option value='" + i + "'>" + i + " Year";
			if (i>1){str = str + "s"};
			str = str + "</option>";
		}
	}
	return str;
}


function showTLDs(topid, q){
	show_hide("tld" + topid);
	show_hide("subtld" + topid);
	var x, y
	for (x=1;x<=10;x++){
		if (x==1){y = ".com";}
		if (x==2){y = ".net";}
		if (x==8){y = ".org";}
		if (x==7){y = ".eu";}
		if (x==3){y = ".co.uk";}
		if (x==4){y = ".org.uk";}
		if (x==5){y = ".me.uk";}
		if (x==9){y = ".biz";}
		if (x==10){y = ".info";}
		if (x==6){y = ".mobi";}
		liveSearchDoSearch(q + y , "subtld" + topid + "item" + x, y);
	}
}

function liveSearchDoSearch(q, id, tld){

	var liveSearchReq = false;
	var txt = document.getElementById(id);

	var ret 
	
	if (window.XMLHttpRequest)
	{
		liveSearchReq = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		liveSearchReq = new ActiveXObject('Microsoft.XMLHTTP');
	}
	liveSearchReq.open('GET', '/wl.asp?q=' + q, true);
	liveSearchReq.onreadystatechange=function() {
		if (liveSearchReq.readyState==4) {
			ret = parseInt(TrimString(liveSearchReq.responseText), 10);
			if (ret == 0){
				txt.style.backgroundColor = "#efe";
				txt.style.border = "1px solid #6c6"
				txt.innerHTML = "<a class='tldlookup' href='#' onClick=\"subFm('" + q + "');\">" + tld + "</a>";
			}
			else{
				txt.style.border = "1px solid #f00";
				txt.style.backgroundColor = "#fee";			
			}

		}
	}
	liveSearchReq.send(null);

}
function subFm(d){
	var f = document.getElementById("new_domain_lookup");
	var q = document.getElementById("new_q"); 
	q.value = d;
	f.submit();
}
function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}

function hideSearching(){
	var d = document.getElementById("searchingdiv");
	d.innerHTML = "Domain Registration"
}
var i
i = 1;
function showAnimSearch(){
	var xtra, j
	xtra = "";
	for (j=1;j<=i;j++){
		xtra += ".";
	}
	var d = document.getElementById("searchingdiv");
	d.innerHTML = "Searching" + xtra;
	
	i++;
	if (i>5){i=0;}
}


function hideWhoisSearching(){
	var d = document.getElementById("whoissearchingdiv");
	d.innerHTML = "WHOIS Result"
}
function hideWhoisSearchingBackorder(){
	var d = document.getElementById("whoissearchingdiv");
	d.innerHTML = "Data Retrieved"
}
var i
i = 1;
function showWhoisAnimSearch(){
	var xtra, j
	xtra = "";
	for (j=1;j<=i;j++){
		xtra += ".";
	}
	var d = document.getElementById("whoissearchingdiv");
	d.innerHTML = "Retrieving WHOIS Data" + xtra;
	
	i++;
	if (i>5){i=0;}
}

function showWhoisAnimSearchBackorder(){
	var xtra, j
	xtra = "";
	for (j=1;j<=i;j++){
		xtra += ".";
	}
	var d = document.getElementById("whoissearchingdiv");
	d.innerHTML = "Retrieving Expiry Data" + xtra;
	
	i++;
	if (i>5){i=0;}
}

function hideRegistering(){
	var d = document.getElementById("registeringingdiv");
	d.innerHTML = "Registration Complete"
}
function hideRegisteringFailed(){
	var d = document.getElementById("registeringingdiv");
	d.innerHTML = "Your order could not be processed."
}
var i
i = 1;
function showAnimRegistering(){
	var xtra, j
	xtra = "";
	for (j=1;j<=i;j++){
		xtra += ".";
	}
	var d = document.getElementById("registeringingdiv");
	d.innerHTML = "Please wait" + xtra;
	
	i++;
	if (i>5){i=0;}
}
function showAnimProcessing(){
	var xtra, j
	xtra = "";
	for (j=1;j<=i;j++){
		xtra += ".";
	}
	var d = document.getElementById("registeringingdiv");
	d.innerHTML = "Processing Your Order" + xtra;
	
	i++;
	if (i>5){i=0;}
}


function printpage()
{
window.print()
}

function disableBut(i){
	document.getElementById(i).disabled = true;
}


var state = 'none';
function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.getElementById) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
function textLimit(field, maxlen) {
	if (field.value.length > maxlen)
	field.value = field.value.substring(0, maxlen);
} 

function doCardValidate(cardArray, idType, idCard, idErr, idCrd){
	var s = document.getElementById("cc_country");
	var c = s.options[s.selectedIndex].value;
	if (c == "GB"){
		idType = idType + "_GBP";
	}
	else if (arrEuropean[c]){
		idType = idType + "_EUR";
	}
	else{
		idType = idType + "_USD";
	}

	var type = document.getElementById(idType).value;
	var card = document.getElementById(idCard).value;
	var crd1 = document.getElementById(idCrd + "1");
	var crd2 = document.getElementById(idCrd + "2");
	var err = document.getElementById(idErr);
	var e = new Array(0, "");
	var r = checkCreditCard(cardArray, type, card, e);
	if (!r){
		err.innerHTML = e[1];
		err.style.display = "";
		crd1.className =  "cc_in_fail";
		crd2.className =  "cc_in_fail";
	} else {
		err.innerHTML = "";
		err.style.display = "none";
		crd1.className =  "";
		crd2.className =  "";
		
	}
}

function checkCreditCard(cards, cardType, cardnumber, errs){
	//initialise error reporting
	errs[0] = 0;
	errs[1] = "";

	if (cardnumber == ""){
		return true;
	}

	var cardNo = cardnumber
	var cardexp = /^[0-9]{13,19}$/;
	if (!cardexp.exec(cardNo))  {
	 errs[0] = 1;
	 errs[1] = "The Card Number you entered is invalid";
	 return false; 
	}

	   
	var checksum = 0;
	var mychar = ""; 
	var j = 1;
	
    var calc;
    for (i = cardNo.length - 1; i >= 0; i--) {
      calc = Number(cardNo.charAt(i)) * j;
      if (calc > 9) {
        checksum = checksum + 1;
        calc = calc - 10;
      }
      checksum = checksum + calc;
      if (j ==1) {j = 2} else {j = 1};
    } 
    if (checksum % 10 != 0)  {
	 errs[0] = 2;
	 errs[1] = "The Card Number you entered is invalid";
     return false; 
    }
	else if(cardType == 0){
		return true;
	}

  var LengthValid = false;
  var PrefixValid = false; 
  var undefined; 

  var prefix = new Array ();
  var lengths = new Array ();
  
  prefix = cards[cardType].prefixes.split(",");
      
  for (i=0; i<prefix.length; i++) {
    var exp = new RegExp ("^" + prefix[i]);
    if (exp.test (cardNo)) PrefixValid = true;
  }

  if (!PrefixValid) {
	 errs[0] = 3;
	 errs[1] = "The Card Number you entered does not match the Card Type";
     return false; 
  }

  lengths = cards[cardType].lens.split(",");
  for (j=0; j<lengths.length; j++) {
    if (cardNo.length == lengths[j]) LengthValid = true;
  }

  if (!LengthValid) {
	 errs[0] = 4;
	 errs[1] = "The Card Number you entered is invalid";
     return false; 
  };   

  return true;

}
function doAJAXpost(url, params, eId){
	var ret = document.getElementById(eId);
	var xmlhttp = false;
	
	if (window.XMLHttpRequest)
	{
		xmlhttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
	}
	xmlhttp.open('POST', url, true);
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp.setRequestHeader("Content-length", params.length);
	xmlhttp.setRequestHeader("Connection", "close");
    xmlhttp.onreadystatechange=function() {
	
		if (xmlhttp.readyState==4){// && xmlhttp.status=="200") {
			ret.innerHTML = "";
			if (xmlhttp.responseText.length > 0 ) {
				var op = xmlhttp.responseText.split("|");
				for(var i=0; i < op.length; i++) {
					var oOption = document.createElement("option");
					var o = op[i].split(":");
					var opt_txt = document.createTextNode(o[1]);
					oOption.appendChild(opt_txt);
					oOption.setAttribute("value", o[0]);
					AttachEvent(oOption,"dblclick",subSelect,false);
					ret.appendChild(oOption);
				}
			}
			else {
					var oOption = document.createElement("option");
					var opt_txt = document.createTextNode("No Matches Found");
					oOption.appendChild(opt_txt);
					oOption.setAttribute("value", 0);
					oOption.style.color = "#999999";
					ret.appendChild(oOption);
			}
		}
	}
	xmlhttp.send(params);
}
function searchAJAX(src, out){
	var s = document.getElementById(src).value;
	s.replace(/^[A-Za-z0-9\-]$/g, "");
	if (s.length > 0) {doAJAXpost('/members/domainlist/js/', 'd=' + s, out);};
}
function focusSearch(){
	if (document.getElementById('dSearch')){
		document.getElementById('dSearch').focus();
	}
}
function subSelect(){
	document.getElementById('dropListFm').submit();
}
//*** This code is copyright 2003 by Gavin Kistner, gavin@refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
function AttachEvent(obj,evt,fnc,useCapture){
	if (!useCapture) useCapture=false;
	if (obj.addEventListener){
		obj.addEventListener(evt,fnc,useCapture);
		return true;
	} else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
	else{
		MyAttachEvent(obj,evt,fnc);
		obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
	}
} 

function MyAttachEvent(obj,evt,fnc){
	if (!obj.myEvents) obj.myEvents={};
	if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
	var evts = obj.myEvents[evt];
	evts[evts.length]=fnc;
}
function MyFireEvent(obj,evt){
	if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
	var evts = obj.myEvents[evt];
	for (var i=0,len=evts.length;i<len;i++) evts[i]();
}
function cInitTxt(e,t){
	if (e.value == t){
		e.value = '';
		e.style.color = '#000000';
	}
}

function show_hide_editorial(id){
	var i = document.getElementById(id);
	var idLen = id.length;
	var parent = id.substring(0,(id.length-8))+'_parent';
	var p = document.getElementById(parent);
	if (i.style.display == ""){
		i.style.display = "none";
		p.innerHTML = "+ ";
	}
	else if (i.style.display == "none"){
		i.style.display = "";
		p.innerHTML = "- ";
	}		
}


function show_hide_smp(id){
	var i = document.getElementById(id);
	var idLen = id.length;
	var parent = id.substring(0,(id.length-2))+'_p';
	var url = "/sitemonsterprohelp/images/";
	//alert(url);
	var p = document.getElementById(parent);
	if (i.style.display == ""){
		i.style.display = "none";
		p.innerHTML = '<img src="'+url+'show.gif" />';
	}
	else if (i.style.display == "none"){
		i.style.display = "";
		p.innerHTML = '<img src="'+url+'hide.gif" />';
	}		
}

function getSmcCookie(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=")
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1 
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
				return unescape(document.cookie.substring(c_start,c_end))
		} 
	}
	return ""
}

function setSmcCookie(c_name,value,expiredays){
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	
	var openId = getSmcCookie('open')
		//use split and join to use an array
		if(openId!=null && openId!=""){
			var endValue = openId.split(",");
			var alreadyThere = -1;
			for (var i=0; i < endValue.length; i++){
			if (value == endValue[i]){
				var alreadyThere = i ;
				break ;
			}
		}
		//alert("Already there "+alreadyThere);
		//alreadyThere contains index number;
		if(alreadyThere == -1){
			endValue.splice(endValue.length,0,value);
		}else{
			endValue.splice(alreadyThere,1);
		}
		endValue = endValue.join(",");
	}else{
		endValue = value;
	}
	//alert("End Value "+endValue);
	document.cookie=c_name+ "=" +escape(endValue)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString()+"; path=/")
}

function checkSmcCookie(){
	var openId = getSmcCookie('open')
	if(openId!=null && openId!=""){
		openId = unescape(openId);
		openId = openId.split(",");
		for(i in openId){
			show_hide_smp(openId[i]);
			//alert(openId[i]);
		}
	}else{
		setSmcCookie('open','',365)
	}
}

function addLoadEvent(func) {
  var oldonload = window.onload;  
  if (typeof window.onload != 'function') {  
    window.onload = function(){func}; //IE8 doesn't like assigning 'func' on its own.
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
function goFrm(frmid){
	document.getElementById(frmid).submit();
	return false;
}
function showBanner(swfFile, targetDt){
	var MM_contentVersion = 5;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i];
			}
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	if ( MM_FlashCanPlay ) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="591" height="30" id="countdown_timer" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="' + swfFile + '" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="#ffffff" />');
		document.write('<param name="flashvars" value="tgtDt=' + targetDt + '" />');
		document.write('<embed src="' + swfFile + '" quality="high" bgcolor="#ffffff" width="591" height="30" name="countdown_timer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="tgtDt=' + targetDt + '" />');
document.write('</object>');
	} else{
		document.write('<a href="/domain-name/me/" title=""><img src="/images/dotme_long.gif" alt="" title="" /></a>');
	}
}

// .me / .asia Banner Cycle
adImages = new Array ("/images/dotAsia_home_sml","/images/sml_dotMe");
adURL = new Array ("/dotasia-registration/","/domain-name/me/");
thisAd = -1;
imgCt = adImages.length;

adImages2 = new Array ("/images/mobi_reg","/images/dotMe_sml_3");
adURL2 = new Array ("/domain-registration/","/domain-name/me/");
thisAd2 = -1;
imgCt2 = adImages2.length;

adImages3 = new Array ("/images/mx-domain/mx_home","/images/im-domain/im_home","/images/mx-domain/mx_home");
adURL3 = new Array ("/domain-name/mx/","/domain-name/im/","/domain-name/mx/");
thisAd3 = -1;
imgCt3 = adImages3.length;

//adImages = new Array creates new variable called adImages
//imgCt holds value adImages.length (number of elements in array) to make it easy to add or subtract images
function rotate(ver,type){
	if (document.images){
		
		if(ver==1){str="_p"}
		if(ver==2){str="_d"}
		if(ver==3){str="_e"}
		
		if(type==1){
			thisAd++
			if (thisAd == imgCt){
				thisAd = 0;
			}
			document.adBanner.src=adImages[thisAd]+str+".gif";
			document.getElementById("adBannerLink").href = adURL[thisAd];
			
		}
		if(type==2){
			thisAd2++
			if (thisAd2 == imgCt2){
				thisAd2 = 0;
			}
			document.adBanner.src=adImages2[thisAd2]+str+".gif";
			document.getElementById("adBannerLink").href = adURL2[thisAd2];
			
		}
		if(type==3){
			thisAd3++
			if (thisAd3 == imgCt3){
				thisAd3 = 0;
			}
			document.adBanner.src=adImages3[thisAd3]+str+".gif";
			document.getElementById("adBannerLink").href = adURL3[thisAd3];
					
		}
		setTimeout("rotate("+ver+","+type+")", 3.5 * 1000);
		
	}
}


function goProceed(r){
	var pform = document.getElementById("proceedfm");	
	if (r == 1) {
		if (document.getElementById('telconfirmCB').type == "hidden" || document.getElementById('telconfirmCB').checked){
			document.getElementById('telconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('telconfirm2').value = 0;
		}
	} else if (r == 2){
		if (document.getElementById('cmconfirmCB').type == "hidden" || document.getElementById('cmconfirmCB').checked){
			document.getElementById('cmconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('cmconfirm2').value = 0;
		}
		
	} else if (r == 3){
	
		if (document.getElementById('mxconfirmCB').type == "hidden" || document.getElementById('mxconfirmCB').checked){
			document.getElementById('mxconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('mxconfirm2').value = 0;
		}
		
		
				
	} else if (r == 4){

		/* MX and CM */

		if (document.getElementById('mxconfirmCB').type == "hidden" || document.getElementById('mxconfirmCB').checked){
			document.getElementById('mxconfirm2').value = 1;
		}
		else {
			document.getElementById('mxconfirm2').value = 0;
		}

		if (document.getElementById('cmconfirmCB').type == "hidden" || document.getElementById('cmconfirmCB').checked){
			document.getElementById('cmconfirm2').value = 1;
		}
		else {
			document.getElementById('cmconfirm2').value = 0;
		}		
		
		if (document.getElementById('cmconfirm2').value == 1 && document.getElementById('mxconfirm2').value == 1){
			pform.action = "/checkout/process_order.asp";
		}

	} else if (r == 5){
	
		if (document.getElementById('euidnconfirmCB').type == "hidden" || document.getElementById('euidnconfirmCB').checked){
			document.getElementById('euidnconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('euidnconfirm2').value = 0;
		}
		
	} else if (r == 6){
		if (document.getElementById('coconfirmCB').type == "hidden" || document.getElementById('coconfirmCB').checked){
			document.getElementById('coconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('coconfirm2').value = 0;
		}

	} else if (r == 7){
		if (document.getElementById('telidnconfirmCB').type == "hidden" || document.getElementById('telidnconfirmCB').checked){
			document.getElementById('telidnconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('telidnconfirm2').value = 0;
		}
				
	} else if (r == 8){

		/* CO and TEL IDN */

		if (document.getElementById('coconfirmCB').type == "hidden" || document.getElementById('coconfirmCB').checked){
			document.getElementById('coconfirm2').value = 1;	
		}
		else {
			document.getElementById('coconfirm2').value = 0;
		}
		
		if (document.getElementById('telidnconfirmCB').type == "hidden" || document.getElementById('telidnconfirmCB').checked){
			document.getElementById('telidnconfirm2').value = 1;	
		}
		else {
			document.getElementById('telidnconfirm2').value = 0;
		}	
		
		if (document.getElementById('coconfirm2').value == 1 && document.getElementById('telidnconfirm2').value == 1){
			pform.action = "/checkout/process_order.asp";
		}	

	} else if (r == 9){
		if (document.getElementById('ukprizeCB').checked){
			document.getElementById('ukprize2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('ukprize2').value = 0;
		}

	} else if (r == 10){
		if (document.getElementById('soconfirmCB').type == "hidden" || document.getElementById('soconfirmCB').checked){
			document.getElementById('soconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('soconfirm2').value = 0;
		}

				
	} else if (r == 11){

		/* SO and GR.COM */

		if (document.getElementById('soconfirmCB').type == "hidden" || document.getElementById('soconfirmCB').checked){
			document.getElementById('soconfirm2').value = 1;	
		}
		else {
			document.getElementById('soconfirm2').value = 0;
		}
		
		if (document.getElementById('grcomconfirmCB').type == "hidden" || document.getElementById('grcomconfirmCB').checked){
			document.getElementById('grcomconfirm2').value = 1;	
		}
		else {
			document.getElementById('grcomconfirm2').value = 0;
		}	
		
		if (document.getElementById('soconfirm2').value == 1 && document.getElementById('grcomconfirm2').value == 1){
			pform.action = "/checkout/process_order.asp";
		}	


	} else if (r == 12){
		if (document.getElementById('grcomconfirmCB').type == "hidden" || document.getElementById('grcomconfirmCB').checked){
			document.getElementById('grcomconfirm2').value = 1;			
			pform.action = "/checkout/process_order.asp";
		}
		else {
			document.getElementById('grcomconfirm2').value = 0;
		}
		
							
		
	} else {
		pform.action="/checkout/process_order.asp";
	}
	pform.submit();
}

function rzCC(s){
// thanks http://www.ruzee.com/blog/2006/07/\
// retrieving-css-styles-via-javascript/
	for(var exp=/-([a-z])/;
		exp.test(s);
		s=s.replace(exp,RegExp.$1.toUpperCase()));
	return s;
}

function _setStyle(element, declaration) {
	if (declaration.charAt(declaration.length-1)==';')
		declaration = declaration.slice(0, -1);
	var k, v;
	var splitted = declaration.split(';');
	for (var i=0, len=splitted.length; i<len; i++) {
		k = rzCC(splitted[i].split(':')[0]);
		v = splitted[i].split(':')[1];
		eval("element.style."+k+"='"+v+"'");
	}
}

function helperTips(){
	if(document.getElementsByTagName) {
		var elements = document.getElementsByTagName('*');
		for(var i in elements) {
			var element = elements[i];
			if(element.className == 'helperTip') {
				_setStyle(element,'position:relative;');
				help_info = document.createElement('span');
				var curPage = location.pathname
				switch(curPage){
					case '/':	_setStyle(help_info, 'position:absolute;top:-55px;right:-80px;width:106px;height:91px;background:url("/images/netmag/search_biz.png") no-repeat 0 0;');
					break;
					case '/domain-registration/':	_setStyle(help_info, 'position:absolute;top:-91px;right:-106px;width:106px;height:91px;background:url("/images/netmag/search_biz.png") no-repeat 0 0;');
					break;
					case '/basket/': _setStyle(help_info, 'position:absolute;top:20px;right:0px;width:88px;height:121px;background:url("/images/netmag/checkout_biz.png") no-repeat 0 0;');
					break;
					case '/checkout/': _setStyle(help_info, 'position:absolute;top:-60px;right:100px;width:104px;height:90px;background:url("/images/netmag/register_biz.png") no-repeat 0 0;');
					break;
				}
				help_info.innerHTML = "&nbsp;";
				element.appendChild(help_info);
			}
			if(element.className == 'helperTip2'){
				_setStyle(element,'position:relative;');
				help_info2 = document.createElement('span');
				var curPage = location.pathname
				switch(curPage){
					case '/domain-registration/':	_setStyle(help_info2, 'position:absolute;top:-115px;right:-85px;width:88px;height:121px;background:url("/images/netmag/add_biz.png") no-repeat 0 0;');
					break;
					case '/checkout/':	_setStyle(help_info2, 'position:absolute;top:-120px;right:0px;width:88px;height:121px;background:url("/images/netmag/code_biz.png") no-repeat 0 0;');
					break;
				}
				help_info2.innerHTML = "&nbsp;";
				element.appendChild(help_info2);
			}
			if(element.className == 'helperTip3'){
				_setStyle(element,'position:relative;');
				help_info3 = document.createElement('span');
				var curPage = location.pathname
				switch(curPage){
					case '/domain-registration/':	_setStyle(help_info3, 'position:absolute;top:-50px;right:-121px;width:119px;height:88px;background:url("/images/netmag/basket_biz.png") no-repeat 0 0;');
					break;
				}
				help_info3.innerHTML = "&nbsp;";
				element.appendChild(help_info3);
			}
		}
	}
}
