function send(adr,subj){
l = "mailto:" + adr + "@" + "xx" + "absoluteway.com" + "?subject=" + escape(subj);
l = l.replace("@xx","@");
location.href = l;
return 0;
}

function GetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for(var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if(sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  return null;
}

//update cookie
function UpdateCookie() {

	add = "; path=/; expires=Tue, 10 Mar 2009 12:00:00 UTC;";
	date = new Date();
	
	//set cookie if not exist
	if( GetCookie("id")==null)
	{
		document.cookie = "id=1" + add;
		if( document.referrer.length==0 )
		{
			document.cookie = "referrer=unknown" + add;
		}
		else
		{
			document.cookie = "referrer=" + escape(document.referrer) + add;
		}
		document.cookie = "numvisits=1" + add;
		document.cookie = "firstdate=" + date.getDate() + "." + (date.getMonth()+1) + "." + date.getFullYear() + add;
		document.cookie = "lastdate=" + escape(date.toUTCString()) + add;
		document.cookie = "FirstEnterPage=" + document.location.href + add;
	}
	else
	{
		lastdate = GetCookie("lastdate");
		if( lastdate != null )
		{
			if( lastdate.length > 0 )
			{
				ldate = new Date(lastdate);
				if( !isNaN(ldate) )
				{
					d = ((((date - ldate)/1000)/60)/60);
					if( d >= 1 )//if prev visit more then 1 hour ago
					{
						numvisits = GetCookie("numvisits");
						if( numvisits==null )
						{
							numvisits = 1;
						}
						else
						{
							num = new Number(numvisits);
							numvisits = num+1;
						}
						document.cookie = "numvisits=" + numvisits + add;
					}
				}
			}
		}
		
		document.cookie = "lastdate=" + escape(date.toUTCString()) + add;
	}
	
	//if enter page
	if( document.referrer.indexOf("absoluteway.com") == -1 )
	{
		document.cookie = "LastEnterPage=" + document.location.href + add;
	}
	
	return true
}

//Check the form before submitting
function CheckSearch() {
	//Check for   word to  search
	if (document.formSearch.search.value==""){
		alert("Please enter at least one keyword to search");
		document.formSearch.search.focus();
		return false;
	}
	
	return true
}

function Search() {

	//Check for   word to  search
	if (CheckSearch()==true){
		
		document.formSearch.submit();
		return true;
	}
	
	return false
}

function CheckEMail(field) {

	var i1 = -1;
	var i2 = -1;

	//Check e-mail
	if (field.value==""){
		alert("Please  enter  e-mail");
		field.focus();
		return false;
	}
	if (field.value=="your e-mail"){
		alert("Please  enter  e-mail");
		field.focus();
		return false;
	}
	i1 = field.value.indexOf("@");
	if (i1==-1){
		alert("Please  enter  e-mail");
		field.focus();
		return false;
	}
	i2 = field.value.lastIndexOf(".");
	if (i2==-1){
		alert("Please  enter  e-mail");
		field.focus();
		return false;
	}
	if (i1>i2){
		alert("Please  enter  e-mail");
		field.focus();
		return false;
	}
	
	return true
}

function Subscribe(field) {

	//Check e-mail
	if (CheckEMail(field)==true){
		
		document.formMailingList.submit();
		return true;
	}
	
	return false
}

dom = (document.getElementById)? true : false;
nn4 = (document.layers)? true : false;
ie4 = (!dom && document.all)? true : false;

var occupied_header = new Array();
var occupied_menu = new Array();


for(i=1;i<=8;i++) {
 occupied_header[i] = 0;
 occupied_menu[i] = 0; 
}

function n_GetX(El) {
	var X = 0;
	do { X += El.offsetLeft } while ((El = El.offsetParent) != null);
	return X;
}

function n_GetY(El) {
	var Y = 0;
	do { Y += El.offsetTop } while ((El = El.offsetParent) != null);
	return Y;
}

function CreateLayer(text, id, t, l,m) {
  if (dom && !document.all) {
        var strng="<div id=sub" + id + " style=\"position:absolute;top:" + t + ";left:" + l + ";visibility:hidden;z-index:1;\" onmouseover=\"occupied_menu[" + id + "]=1;\" onmouseout=\"Turn('" + id + "',0);occupied_menu[" + id + "]=0;\">" + text + "</div>";
        document.write(strng);
  }
  else {
    if(document.layers) {
      var str="<LAYER ID=sub" + id + " TOP=" + t + " LEFT=" + l + " onmouseover=\"occupied_menu[" + id + "]=1;\" onmouseout=\"Turn('" + id + "',0);occupied_menu[" + id + "]=0;\" VISIBILITY=hide Z-INDEX=2 bgcolor=\"#FFFFFF\">" + text + "</LAYER>";
      document.write(str);
    }
    else 
	  if(document.all) {
        var strng="<div id=sub" + id + " style=\"position:absolute;top:" + t + ";left:" + l + ";visibility:hidden;z-index:1;\" onmouseover=\"occupied_menu[" + id + "]=1;\" onmouseout=\"Turn('" + id + "',0);occupied_menu[" + id + "]=0;\">" + text + "</div>";
        document.write(strng);
      }
   }
 }

 
function Turn(id, mode) {
 if(document.layers || document.all || dom) {
  if(mode)
   eval("setTimeout(\"On(" + id + ");\",100)");
  else
   eval("setTimeout(\"Off(" + id + ");\",100)");
 }
}

function On(id){
  if(occupied_header[id]) {
//  document.images["m"+id].src = "pics/" + id + "transp.gif";
  if (dom && !document.all) {
//    LeftCoord = n_GetX(document.images["m"+id]);
//    document.getElementById("sub" +id).style.left = LeftCoord;
    document.getElementById("sub" + id).style.visibility = 'visible';
  }
  else {
    if(document.all) {
//      LeftCoord = n_GetX(document.images["m"+id]);
//      document.all["sub" +id].style.left = LeftCoord;
      document.all["sub" + id].style.visibility = 'visible';
    }    
    else 
	  if(document.layers) {
//        LeftCoord = document.images["m"+id].x;
//        eval('document.layers["sub" +id].left = LeftCoord');    
        eval("document.layers['sub" + id + "']").visibility = "show";
      }    
  }
  }
}
 
function Off(id){
  if(!occupied_menu[id] && !occupied_header[id]) {
//   document.images["m"+id].src = "pics/" + id + ".gif";
  if (dom && !document.all) {
      document.getElementById("sub" + id).style.visibility = 'hidden';
  }
  else {
    if(document.all) {
      eval("sub" + id).style.visibility = 'hidden';
    }
    else 
	  if(document.layers) {
        eval("document.layers['sub" + id + "']").visibility = "hide";
      }    
  }
  }
}

txt = new Array();

txt[2] = "<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=92><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/index.htm id=mainmenu>Home</a><br>&nbsp;<a href=/news.asp id=mainmenu>News</a><br>&nbsp;<a href=/mailing_list.asp id=mainmenu>Mailing list</a><br>&nbsp;<a href=/search.asp id=mainmenu>Site search</a></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[2], 2, 76, 25);

txt[3] ="<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=150><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/products.htm id=mainmenu>Products</a><br>&nbsp;<a href=/products.htm#tw id=mainmenu>TweakWindow</a><br>&nbsp;<a href=/products.htm#atb id=mainmenu>ActiveTextBox</a><br>&nbsp;<!--<a href=/products.htm#ap id=mainmenu>AtPrivacy</a><br>&nbsp;<a href=/products.htm#appr id=mainmenu>AtPrivacy Pro</a><br>&nbsp;--><a href=/products.htm#dev id=mainmenu>Custom development</a></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[3],3, 76, 85);

txt[4] = "<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=110><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/download.htm id=mainmenu>Downloads</a><br>&nbsp;<a href=/download.htm#tw id=mainmenu>TweakWindow</a><br>&nbsp;<a href=/download.htm#atb id=mainmenu>ActiveTextBox</a><!--<br>&nbsp;<a href=/download.htm#ap id=mainmenu>AtPrivacy</a><br>&nbsp;<a href=/download.htm#appr id=mainmenu>AtPrivacy Pro</a>--></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[4], 4, 76, 172);

txt[5] = "<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=181><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/register.htm id=mainmenu>Register</a><br>&nbsp;<a href=/register.htm#tw id=mainmenu>TweakWindow registration</a><br>&nbsp;<a href=/register.htm#atb id=mainmenu>ActiveTextBox registration</a><br>&nbsp;<!--<a href=/register.htm#ap id=mainmenu>AtPrivacy registration</a><br>&nbsp;<a href=/register.htm#appr id=mainmenu>AtPrivacy Pro registration</a><br>&nbsp;--><a href=/registrators.htm id=mainmenu>About registration services</a></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[5],5, 76, 270);

txt[6] = "<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=180><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/support.htm id=mainmenu>Support</a><br>&nbsp;<a href=/tester.htm id=mainmenu>Testers</a><br>&nbsp;<a href=/tweakwindow/faq.htm id=mainmenu>TweakWindow FAQ</a><br>&nbsp;<a href=/tweakwindow/tutorial.htm id=mainmenu>TweakWindow Tutorial</a><br>&nbsp;<a href=/tweakwindow/help.htm id=mainmenu>TweakWindow Online help</a><br>&nbsp;<a href=/activetextbox/faq.htm id=mainmenu>ActiveTextBox FAQ</a><br>&nbsp;<a href=/activetextbox/tutorial.htm id=mainmenu>ActiveTextBox Tutorial</a><br>&nbsp;<a href=/activetextbox/help.htm id=mainmenu>ActiveTextBox Online help</a><br>&nbsp;<!--<a href=/atprivacy/faq.htm id=mainmenu>AtPrivacy FAQ</a><br>&nbsp;<a href=/atprivacy/tutorial.htm id=mainmenu>AtPrivacy Tutorial</a><br>&nbsp;<a href=/atpivacy/help.htm id=mainmenu>AtPrivacy Online Help</a><br>&nbsp;--><a href=/feedback.htm id=mainmenu>Feedback form</a></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[6], 6, 76, 350);


txt[7] = "<table bgcolor=#99a7c4 cellspacing=0 cellpadding=0 border=0 width=183><tr><td width= 2 background=/pics/drop-shadow-left.gif><img src=/pics/drop-shadow-left.gif width=2 height=5></td><td background=/pics/drop-shadow-ins.gif width=171><img src=/pics/drop-shadow-ins.gif width=1 height=5></td><td width=2 background=/pics/drop-shadow-right.gif><img src=/pics/drop-shadow-right.gif width=2 height=5></td></tr><tr><td width=2 background=/pics/drop-left.gif><img src=/pics/drop-left.gif width=2 height=5></td><td width=171 background=/pics/drop-ins.gif valign=top>&nbsp;<a href=/custom_software_development.htm id=mainmenu>Software development</a><br>&nbsp;<!--<a href=/dev_technologies.htm id=mainmenu>Technologies</a><br>&nbsp;<a href=/dev_tools.htm id=mainmenu>Development tools</a><br>&nbsp;--><a href=/dev_contact.htm id=mainmenu>Contact development team</a></td><td width=2 background=/pics/drop-right.gif><img src=/pics/drop-right.gif width=2 height=5></td></tr><tr><td width=2><img src=/pics/drop-bottom-left.gif width=2 height=6></td><td background=/pics/drop-bottom-ins.gif width=171><img src=/pics/drop-bottom-ins.gif width=1 height=6></td><td width=2><img src=/pics/drop-bottom-right.gif width=2 height=6></td></tr></table>";
CreateLayer(txt[7], 7, 76, 429);
