function initMenu()
{
	var nodes = document.getElementById("navigation").getElementsByTagName("li");
	for (var i=0; i<nodes.length; i++)
	{
		nodes[i].onmouseover = function()
		{
			this.className += " hover";
		}
		nodes[i].onmouseout = function()
		{
			this.className = this.className.replace(" hover", "");
		}
	}
}
if (document.all && !window.opera) attachEvent("onload", initMenu);

// tabs.js
function tabstabs(tabNum, elemNum, mItemCounter) {
	var el01 = '';
	for (var i=1; i<=mItemCounter; i++) {
		if (document.getElementById('tab'+tabNum+i)) {document.getElementById('tab'+tabNum+i).style.display = (i!= elemNum)?'none':'block'}					
		el01 = document.getElementById('item'+tabNum+i);
		if (el01) {
			if (i!=elemNum) {
				el01.className=el01.className.replace(new RegExp("_act\\b"), "");						
			}  else {							
				if (el01.className.indexOf("_act")<0) {el01.className+='_act'}
			}
		}			
	}				
}

// jump.js
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Open non-a2 links in new window - dr05142008
function setLinkTargets(){
	for(var i=0; i<document.links.length; i++){
		if( document.links[i].hostname != '' && document.links[i].hostname.indexOf('championconsulting.com') == -1 ){
			document.links[i].target = "_blank";
		}
	}
}

// Popup
function PopUp(url,win_id){
	var d = new Date();
	window.open(	url, 
			win_id,
			"location=no,menubar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,resizable=yes,height=300,width=400,directories=no,screenX=100,screenY=100"
	);
}

// IE6 PNG Transparency Fix
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version <= 6.0) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}

// No idea what this does - from mz_fch.js
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) 
      break;
  }
  return null;
}

function SetCookie (name, value) {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
}

$(function(){
	$('.orderNow').append('<span class="hover"></span>').each(function () {
		var $span = $('> span.hover', this).css('opacity', 0);
		$(this).hover(function () {
			$span.stop().fadeTo(300, 1);
		}, function () {
			$span.stop().fadeTo(300, 0);
		});
	});
	$('.orderNowBig').append('<span class="hover"></span>').each(function () {
		var $span = $('> span.hover', this).css('opacity', 0);
		$(this).hover(function () {
			$span.stop().fadeTo(300, 1);
		}, function () {
			$span.stop().fadeTo(300, 0);
		});
	});
});

//Tooltips
$.ajaxSetup({'async': false});
$(function(){
    $('a[rel=tooltip-prices]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-prices]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=prices", function(json){ title = "json.prices."+section+".title"; title = eval(title); text = "json.prices."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-resources]').hover(function(event){ event.preventDefault(); section = $(this).attr("name"); });
    $('a[rel=tooltip-resources]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=resources", function(json){ title = "json.resources."+section+".title"; title = eval(title); text = "json.resources."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-difference]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-difference]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=difference", function(json){ title = "json.difference."+section+".title"; title = eval(title); text = "json.difference."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-domains]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-domains]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=domains", function(json){ title = "json.domains."+section+".title"; title = eval(title); text = "json.domains."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-control]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-control]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=control", function(json){ title = "json.control."+section+".title"; title = eval(title); text = "json.control."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-resellercontrol]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-resellercontrol]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=resellercontrol", function(json){ title = "json.resellercontrol."+section+".title"; title = eval(title); text = "json.resellercontrol."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-email]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-email]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=email", function(json){ title = "json.email."+section+".title"; title = eval(title); text = "json.email."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-ecommerce]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-ecommerce]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=ecommerce", function(json){ title = "json.ecommerce."+section+".title"; title = eval(title); text = "json.ecommerce."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-promotion]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-promotion]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=promotion", function(json){ title = "json.promotion."+section+".title"; title = eval(title); text = "json.promotion."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-oneclick]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-oneclick]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=oneclick", function(json){ title = "json.oneclick."+section+".title"; title = eval(title); text = "json.oneclick."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-developer]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-developer]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=developer", function(json){ title = "json.developer."+section+".title"; title = eval(title); text = "json.developer."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-stats]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-stats]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=stats", function(json){ title = "json.stats."+section+".title"; title = eval(title); text = "json.stats."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-additional]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-additional]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=additional", function(json){ title = "json.additional."+section+".title"; title = eval(title); text = "json.additional."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-optional]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-optional]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=optional", function(json){ title = "json.optional."+section+".title"; title = eval(title); text = "json.optional."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-vpsfeatures]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-vpsfeatures]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=vpsfeatures", function(json){ title = "json.vpsfeatures."+section+".title"; title = eval(title); text = "json.vpsfeatures."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });
    $('a[rel=tooltip-managed]').hover(function(){ section = $(this).attr("name"); });
    $('a[rel=tooltip-managed]').qtip({ content: { text: 'Loading...' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, style: { width: 250 }, api : { beforeShow: function() { $.getJSON("/scripts/json.php?section=managed", function(json){ title = "json.managed."+section+".title"; title = eval(title); text = "json.managed."+section+".text"; text = eval(text); }); this.updateContent("<strong>"+title+"</strong><p>"+text+"</p>"); } } });

    $.getJSON("/scripts/json.php?section=pricing", function(json){ coupon_code = json.pricing.coupons.code; coupon_discount = json.pricing.coupons.discount; });
    
    $('a[rel=tooltip-pricing-web]').hover(function(){  });
    $('a[rel=tooltip-pricing-web]').qtip({
        content: { text: '<div style=\"width:400px;height:75px;\"></div>', title: { text: 'Web Hosting Pricing Chart' } },
	style: { width: '700px', name: 'dark', tip: 'bottomMiddle' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' }, adjust: { screen: true } },
        api : {
            beforeShow: function() {
                $.getJSON("/scripts/json.php?section=pricing", function(json){
		    startup="";executive="";
		    count=0;
		    $.each(json.pricing.web.startup,function(i,item) { count++; if (count == 5) { startup = startup + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { startup = startup + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.web.executive,function(i,item) { count++; if (count == 5) { executive = executive + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { executive = executive + "<td>$" + item + "/mo</td>"; } });
                });
		this.updateContent("<table cellspacing=\"0\"><tr class=\"th\"><th>Hosting Plan</th><th>1-month</th><th>6-months</th><th>12-months</th><th>24-months</th><th>36-months</th></tr><tr><th>StartUp</th>"+startup+"</tr><tr><th>Executive</th>"+executive+"</tr><tr><td colspan=\"6\">Prices reflect the <strong>"+coupon_discount+"%</strong> off discount when the coupon code <strong>"+coupon_code+"</strong> is used at the checkout.<br />Take advantage of this limited time offer today!</td></tr></table>");
            }
        }
    });
    $('a[rel=tooltip-pricing-vps]').hover(function(){  });
    $('a[rel=tooltip-pricing-vps]').qtip({
        content: { text: '<div style=\"width:400px;height:125px;\"></div>', title: { text: 'VPS Hosting Pricing Chart' } },
	style: { width: '700px', name: 'dark', tip: 'bottomMiddle' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' }, adjust: { screen: true } },
        api : {
            beforeShow: function() {
                $.getJSON("/scripts/json.php?section=pricing", function(json){
		    core="";enhanced="";power="";pinnacle="";
		    count=0;
		    $.each(json.pricing.vps.core,function(i,item) { count++; if (count == 5) { core = core + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { core = core + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.vps.enhanced,function(i,item) { count++; if (count == 5) { enhanced = enhanced + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { enhanced = enhanced + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.vps.power,function(i,item) { count++; if (count == 5) { power = power + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { power = power + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.vps.pinnacle,function(i,item) { count++; if (count == 5) { pinnacle = pinnacle + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { pinnacle = pinnacle + "<td>$" + item + "/mo</td>"; } });
                });
		this.updateContent("<table cellspacing=\"0\"><tr class=\"th\"><th>Hosting Plan</th><th>1-month</th><th>6-months</th><th>12-months</th><th>24-months</th><th>36-months</th></tr><tr><th>Core</th>"+core+"</tr><tr><th>Enhanced</th>"+enhanced+"</tr><tr><th>Power</th>"+power+"</tr><tr><th>Pinnacle</th>"+pinnacle+"</tr><tr><td colspan=\"6\">Prices reflect the <strong>"+coupon_discount+"%</strong> off discount when the coupon code <strong>"+coupon_code+"</strong> is used at the checkout.<br />Take advantage of this limited time offer today!</td></tr></table>");
            }
        }
    });
    $('a[rel=tooltip-pricing-reseller]').hover(function(){  });
    $('a[rel=tooltip-pricing-reseller]').qtip({
        content: { text: '<div style=\"width:400px;height:100px;\"></div>', title: { text: 'Reseller Hosting Pricing Chart' } },
	style: { width: '700px', name: 'dark', tip: 'bottomMiddle' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' }, adjust: { screen: true } },
        api : {
            beforeShow: function() {
                $.getJSON("/scripts/json.php?section=pricing", function(json){
		    concept="";venture="";enterprise="";
		    count=0;
		    $.each(json.pricing.reseller.concept,function(i,item) { count++; if (count == 5) { concept = concept + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { concept = concept + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.reseller.venture,function(i,item) { count++; if (count == 5) { venture = venture + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { venture = venture + "<td>$" + item + "/mo</td>"; } });
		    count=0;
		    $.each(json.pricing.reseller.enterprise,function(i,item) { count++; if (count == 5) { enterprise = enterprise + "<td><strong class=\"red\">$" + item + "</strong>/mo</td>"; } else { enterprise = enterprise + "<td>$" + item + "/mo</td>"; } });
                });
		this.updateContent("<table cellspacing=\"0\"><tr class=\"th\"><th>Hosting Plan</th><th>1-month</th><th>6-months</th><th>12-months</th><th>24-months</th><th>36-months</th></tr><tr><th>Concept</th>"+concept+"</tr><tr><th>Venture</th>"+venture+"</tr><tr><th>Enterprise</th>"+enterprise+"</tr><tr><td colspan=\"6\">Prices reflect the <strong>"+coupon_discount+"%</strong> off discount when the coupon code <strong>"+coupon_code+"</strong> is used at the checkout.<br />Take advantage of this limited time offer today!</td></tr></table>");
            }
        }
    });

    $('a[rel=tooltip-pricing-semided]').hover(function(){  });
    $('a[rel=tooltip-pricing-semided]').qtip({
        content: { text: '<div style=\"width:400px;height:50px;\"></div>', title: { text: 'Semi-Dedicated Hosting Pricing Chart' } },
	style: { width: '700px', name: 'dark', tip: 'bottomMiddle' }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' }, adjust: { screen: true } },
        api : {
            beforeShow: function() {
                $.getJSON("/scripts/json.php?section=pricing", function(json){
		    authority="";
		    count=0;
		    $.each(json.pricing.semided.authority,function(i,item) { count++; if (count == 5) { authority = authority + "<td><span class=\"red\">$" + item + "</span>/mo</td>"; } else { authority = authority + "<td>$" + item + "/mo</td>"; } });
                });
		this.updateContent("<table cellspacing=\"0\"><tr class=\"th\"><th>Hosting Plan</th><th>1-month</th><th>6-months</th><th>12-months</th><th>24-months</th><th>36-months</th></tr><tr><th>Authority</th>"+authority+"</tr><tr><td colspan=\"6\">Prices reflect the <strong>"+coupon_discount+"%</strong> off discount when the coupon code <strong>"+coupon_code+"</strong> is used at the checkout.<br />Take advantage of this limited time offer today!</td></tr></table>");
            }
        }
    });
});



