if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

function PlaySound(embedName)
{
	var sndObj = document.getElementById(embedName);
	if (sndObj != undefined) {
		sndObj.play();
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

		browserOk = (
			((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 ))
			||
			((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
			||
			((navigator.appName == "Opera") && (parseInt(navigator.appVersion) >= 7 ))
		);
		
		//alert(navigator.appName);

		imgon=new Array();
		imgoff=new Array();

		imgNames = new Array("hnav_home","hnav_about","hnav_rates","hnav_account_placement","hnav_paymentmode","hnav_client","hnav_status_demo","hnav_contact");

		for(i = 0; i < imgNames.length; i++){
			var imgname = imgNames[i];
			imgon[imgname] = new Image();
			imgon[imgname].src = "images/cha_"+imgname+"_on.jpg";
			imgoff[imgname] = new Image();
			imgoff[imgname].src = "images/cha_"+imgname+"_off.jpg";
		}

		imageRef="document.images";

		function msover(which) {
			if (browserOk) {
				//eval(imageRef + '["' + which + '"].src = imgon["' + which + '"].src');
				var imgOnSrc = eval('imgon["' + which + '"].src');
				imgOnSrc = imgOnSrc.replace("%5C", "/");	// bug fix: replace "%5C" in URL to "/"
				eval(imageRef + '["' + which + '"].src = "' + imgOnSrc + '"');
			}
		}

		function msout(which) {
			if (browserOk) {
				//eval(imageRef + '["' + which + '"].src = imgoff["' + which + '"].src');
				var imgOffSrc = eval('imgoff["' + which + '"].src');
				imgOffSrc = imgOffSrc.replace("%5C", "/");	// bug fix: replace "%5C" in URL to "/"
				eval(imageRef + '["' + which + '"].src = "' + imgOffSrc + '"');
			}
		}
		
		function send_email()
		{
			var to = "vbaidoon@eegsoft.com";
			var subj = "customer request";
			var from = document.getElementById("e-mail").value;
			if (from != null && from != "" && from != "undefined")
			{
				var msg = "company_name=" + document.getElementById("company_name").value;
				msg += "\ncustomer_name=" + document.getElementById("your_name").value;
				msg += "\nphone=" + document.getElementById("phone").value;
				msg += "\ncomments=" + document.getElementById("comments").value;
				msg += "\nfrom=" + from;
				var myMail = Server.CreateObject("CDO.Message");
				//var myMail = new CDO.Message();
				myMail.Subject = subj;
				myMail.From = from;
				myMail.To = to;
				myMail.TextBody = msg;
				myMail.Send();
				from = "";
			}
		}

		function MM_openBrWindow(theURL,winName,features) { //v2.0
			window.open(theURL,winName,features);
		}
  
		//function onDownloadDone1(s) {
		//	oText.value=s;
		//}

		//function msclick(link) {
		//	if (browserOk) {
		//		alert(link);
		//		eval('<a href='+link+'></a>');
		//	}
		//}

/***********************************************
* Fixed ToolTip script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
		
var tipwidth='150px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay=250  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="0px" //horizontal offset of tooltip from anchor link
var horizontal_offset="-3px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></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, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!="" && tipwidth != undefined){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
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=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
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 windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (tipwidth=="" || tipwidth == undefined) {
	tipwidth = new String(menucontents.length * 6.8);
}
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
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"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


