// JavaScript Document

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="web-packages.php">Web Packages</a>'
menu1[1]='<a href="top-up.php">Topup Packages</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="join-us.php" title="Why Us">Why Us</a>'
menu2[1]='<a href="faq.php" title="FAQ">FAQ</a>'
menu2[2]='<a href="affiliates.php" title="Affiliates">Affiliates</a>'
menu2[4]='<a href="#" title="Live Help" onclick=\'javascript:window.open("http://www.providesupport.com?messenger=pcdoctor247","mywindow","menubar=0,resizable=1,width=490,height=430")\'>Live Help</a>'
menu2[5]='<a href="how-to-do-things.php" title="How To Do Things">How To Do Things</a>'
menu2[6]='<a href="contact.php" title="Contact Us">Contact Us</a>'
		
var menuwidth='129px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}


return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


/*<![CDATA[*/
function launchChat()
{
	window.open('http://www.providesupport.com?messenger=limtex','mywindow','menubar=0,resizable=1,width=490,height=430');
}
function send_mail123() {
	window.open ("send_mail_request.php" ,"mywindow","scrollbars=1, menubar=1,resizable=1,top=400px,left=100px,width=550,height=400"); 
}
function blank() {
	document.getElementById("email_send").style.display="none";
	document.getElementById("email_err").style.display="none";
}
function op_win() {
	window.open ("http://www.businessprodesigns.com/phplive/request.php?l=BusinessPro&x=1&deptid=1&pagex=http%3A//www.businessprodesigns.com/<?php echo $_SERVER['PHP_SELF'];?>" ,"mywindow","scrollbars=1, menubar=1,resizable=1,width=550,height=200");  
}

var secs = 25;
var timerID = null;
var timerRunning = false;
var delay = 1000;
function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}
function StartTheTimer()
{   
	if (secs==0)
    {
		if(timerRunning)
        clearTimeout(timerID)
		timerRunning = false
		window.open ("http://www.businessprodesigns.com/phplive/request.php?l=BusinessPro&x=1&deptid=1&pagex=http%3A//www.businessprodesigns.com/<?php echo $_SERVER['PHP_SELF'];?>" ,"tinyWindow","status=0,scrollbars=0, menubar=no,resizable=no,titlebar=no,location=no,toolbar=no,top=800px,left=0px,width=458,height=322");   		
	}
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
/*]]>*/
/*another 2nd*/

/*<![CDATA[*/
function clo123() {
	document.getElementById("email_err").style.display="none";
}
function send_mail() {
	var msg="";	
	if(document.getElementById("name123").value=="") {
		document.getElementById("email_err").style.display="block";
		msg+='<font color="red" size="-1">Provide a Valid name</font>';
	}	
	if(document.getElementById("name123").value!="") {
		if(document.getElementById("name123").value.length >15) {
			msg+='<font color="red" size="-1">Your Name Exceeds Limit</font>';		
		}	
	}
	if(document.getElementById("telephone123").value=="") {
		msg+='<br><font color="red" size="-1">Provide Your Valid Telephone No</font>';
	}
	if(document.getElementById("telephone123").value!="") {
		if(document.getElementById("telephone123").value.length >15) {
			msg+='<br><font color="red" size="-1">Your Telephone no Exceeds Limit</font>';		
		}	
	}	
	if(document.getElementById("telephone123").value!="") {
		if(!parseInt(document.getElementById("telephone123").value)) {
			msg+='<br><font color="red" size="-1">Provide Your Valid Telephone No</font>';
		}		
	}	
	if(document.getElementById("email123").value=="") {
		document.getElementById("email_err").style.display="block";
		msg+='<br><font color="red" size="-1">Provide Your Email Address </font>';
	}		
	
	if(document.getElementById("email123").value!="") {
		if(document.getElementById("email123").value.length >35) {
			msg+='<br><font color="red" size="-1">Your Email Exceeds Exceeds Limit</font>';		
		}	
	}
	if(document.getElementById("email123").value!="") {
		if (echeck(document.getElementById("email123").value)==false){
			document.getElementById("email123").value="" ;
			msg+='<br><font color="red" size="-1">Provide Your Valid Email</font>';
		}			
	}	
	if(document.getElementById("requir123").value=="") {
		document.getElementById("email_err").style.display="block";
		msg+='<br><font color="red" size="-1">Provide Your Requirements</font>';
	}	
	if(document.getElementById("requir123").value!="") {
		if(document.getElementById("requir123").value.length >2000) {
			document.getElementById("Panel1").style.display="block";
			msg+='<br><font color="red" size="-1">Your Requirements Exceeds Limit</font>';
		}		
	}	
	if(msg!="") {
		document.getElementById("msg123").innerHTML=msg ;
	}
	if(msg=="") {
		var name=document.getElementById("name123").value ;
		var telephone=document.getElementById("telephone123").value ;
		var email=document.getElementById("email123").value ;
		var requir=document.getElementById("requir123").value ;
		if(window.XMLHttpRequest)
		{
			req = new XMLHttpRequest();
		}
		if(window.ActiveXObject)
		{
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		if(req)
		{
			req.onreadystatechange=ProcessRequest_123;
			req.open("GET","quote.php?name="+name + "&telephone="+telephone + "&email="+email +"&requir="+requir,true);
			req.send(null);	
		}
		return false;
	}	
}

function ProcessRequest_123()
	{
		if(req.readyState==4)
		{
			if(req.status==200)
			{    
				document.getElementById("disp123456").innerHTML="";
				document.getElementById("email_send").style.display="none";
			}
		}
	}

function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	  
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		
		return false
	 }
	 return true					
}

function chat_close() {
	document.getElementById("topbar").style.display="none";
}
/*]]>*/