﻿function setpro(si){
    document.getElementById("setbg").className = "setbg";
    document.getElementById("setbg").style.display = "block";
    document.getElementById("pgmsgbox").style.display = "block";
    var zw = document.body.clientWidth;
    var zz = zw-300;
    if (zz <= 0) {
        document.getElementById("pgmsgbox").style.left = 0+"px";
    } else{
        document.getElementById("pgmsgbox").style.left = zz/2+"px";
    }
        document.getElementById("pgmsgbox").style.top = 50+"px";

document.getElementById("pgmsg").innerHTML = si;
document.getElementById("pgmsgbox").focus();
}

function setproj(si){
    document.getElementById("setbg").className = "setbg";
    document.getElementById("setbg").style.display = "block";
    document.getElementById("pgmsgbox1").style.display = "block";
    var zw = document.body.clientWidth;
    var zz = zw-300;
    if (zz <= 0) {
        document.getElementById("pgmsgbox1").style.left = 0+"px";
    } else{
        document.getElementById("pgmsgbox1").style.left = zz/2+"px";
    }
        document.getElementById("pgmsgbox1").style.top = 50+"px";

document.getElementById("pgmsg1").innerHTML = si;
document.getElementById("pgmsgbox").focus();
}


function updatens(){
    setpro('Updating DNS Settings..<br/>Please Wait!');
   var zz = confirm('eComSolution.Net\r\nIt may take 72 hours to reflect changes on internet.\r\nAre you sure you want to continue..?');
   if (zz==true){
   return true;
   }else{
   return false;
   }
}

function confdel(){
   var zz = confirm('eComSolution.Net\r\nYou are about to delete this record.\r\nAre you sure you want to continue..?');
   if (zz==true){
   setpro('Deleting Record..<br/>Please Wait!');
   return true;
   }else{
   return false;
   }
}


function doKeypress(control, maxLength){
    value = control.value;
     if(maxLength && value.length > maxLength-1){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
     }
}
// Cancel default behavior
function doBeforePaste(control, maxLength){
     if(maxLength)
     {
          event.returnValue = false;
     }
}
// Cancel default behavior and create a new paste routine
function doPaste(control, maxLength){
    value = control.value;
     if(maxLength){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
          var oTR = control.document.selection.createRange();
          var iInsertLength = maxLength - value.length + oTR.text.length;
          var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
          oTR.text = sData;
     }
}

function setphcng(cnt){
    if(cnt.value==""){
        cnt.value = "+1.1234567890"
        cnt.style.color = "silver"
    }
}

function setphsel(cnt){
    if(cnt.value=="+1.1234567890"){
        cnt.value = ""
        cnt.style.color = "#333333"
    }
}


 //<![CDATA[
var cot_loc0=(window.location.protocol == "https:")? "https://secure.comodo.net/trustlogo/javascript/cot.js" :
"http://www.trustlogo.com/trustlogo/javascript/cot.js";
document.writeln('<scr' + 'ipt language="JavaScript" src="'+cot_loc0+'" type="text\/javascript">' + '<\/scr' + 'ipt>');
//]]>


 $(document).ready(function(){
   $("a").click(function(e){
     e.preventDefault(); 
     setproj("Loading Page..<br/>Please Wait");
     setTimeout(function(){window.location.href = e.currentTarget.href;},1000); 
   });
 });

jQuery.fn.extend({ 
        AjaxReady : function(fn){ 
            if (fn) { 
                return jQuery.event.add(this[0], "AjaxReady", fn, null); 
            } else { 
                var ret = jQuery.event.trigger("AjaxReady", null, this[0], false, null); 
                // if there was no return value then the even validated correctly 
                if (ret === undefined) 
                    ret = true; 
                return ret; 
            } 
        } 
    });

$(document).AjaxReady(function(){  $('#features').jshowoff({controls:false,speed:9000,effect:'slideLeft'});
    document.getElementById("setbg").style.display = "none";
	$('ul.tabs').each(function() {
		$(this).find('li').each(function(i) {
			$(this).click(function(){
				$(this).addClass('current').siblings().removeClass('current')
					.parents('div.section').find('div.box').hide().end().find('div.box:eq('+i+')').fadeIn(150);
			});
		});
	});

 });  
 
