	


var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
var menutype;
var flagout=0;
var divTable;
var divflag=0;
var hideFlag=0;
var hideFunction=0;
var DivLive=0;
	toc1off = new Image();         // preload five images activated
        toc1off.src = "images/languageroll.gif";  // when mouse moves off menu
        toc2off = new Image();
  	toc2off.src = "images/homeroll.gif";
        toc3off = new Image();
  	toc3off.src = "images/solutionsroll.gif";
  	toc4off = new Image();
  	toc4off.src = "images/productsroll.gif";
  	toc5off = new Image();
  	toc5off.src = "images/servicesroll.gif";
  	toc6off = new Image();
  	toc6off.src = "images/partnersroll.gif";


  	toc1on = new Image();         // preload five images activated
        toc1on.src = "images/language.gif";  // when mouse moves on menu
        toc2on = new Image();
  	toc2on.src = "images/home.gif";
        toc3on = new Image();
  	toc3on.src = "images/solutions.gif";
  	toc4on = new Image();
  	toc4on.src = "images/products.gif";
  	toc5on = new Image();
  	toc5on.src = "images/services.gif";
  	toc6on = new Image();
  	toc6on.src = "images/partners.gif";

function printFriendly(){
	//document.getElementById("3links").style.visibility = 'hidden';
	//document.getElementById("toplinks1").style.visibility = 'hidden';
	//document.getElementById("toplinks2").style.visibility = 'hidden';
	//document.getElementById("navBar").style.visibility = 'hidden';
	//document.getElementById("banner7").style.visibility = 'hidden';
	//document.getElementById("navBar").style.visibility = 'hidden';
	//document.getElementById("siteName").style.visibility = 'hidden';
	//document.getElementById("linksbar").style.visibility = 'hidden';
	//document.getElementById("siteInfo").style.visibility = 'hidden';
	//document.getElementById("headlines").style.visibility = 'hidden';
	//document.getElementById("pageName").style.visibility = 'hidden';
	//document.getElementById("content").style.width = 600;
	document.write("<html><head><title>Alepo Billing software, RADIUS, prepaid for: ISP,  VoIP, Hotpsot, WLAN</title><link rel=stylesheet href=/main.css type=text/css></head><body>"+document.getElementById("content").innerHTML);
	document.write("</body></html>");

}


function setImgOn(imgName){
	imgon = eval(imgName + "on.src");
	document [imgName].src = imgon;

}

function setImg(imgName){
	imgOff = eval(imgName + "off.src");
	document [imgName].src = imgOff;
}

function isDivlive()
	{
	 DivLive=0;
	}

function Checkout()
	{
	if (flagout==1)
		{
		for (i=1;i<6;i++)
			eval("menbar"+i).innerHTML="";
		}
	flagout=0;
	}
function killDivlive()
	{
	DivLive=0;
	}
function returnColor(obj)
	{
	obj.bgColor='#336699';
	}

function cangeColor(obj)
	{

	hideFlag=1;
	DivLive=1;
	obj.bgColor='#83B3E2';
	setTimeout('isDivlive()',4000);
	}

function Outmouse(obj)
	{
	if (obj.bgColor!='#ffffff')
		obj.bgColor='#83B3E2';
	}
function hideDiv2(){
	if (hideFunction==0)
		{
		hideFunction=1;
		setTimeout('hideDiv3()',500);
		}
	}
function hideDiv3(){
	//alert(hideFlag);
	for (i=1;i<6;i++)
		{
		if(eval("M"+i).bgColor != "")
			{
			hideFlag=1;
			}
		}

	if (hideFlag==0 & DivLive == 0)
		{
		hideFunction=0;
		hideFlag=0;
		hideDiv();
		}
	else
		{
		hideFunction=0;
		hideFlag=0;
		setTimeout('hideDiv2()',500);
		}
	}
function hideDiv(){



		for (i=1;i<7;i++)
			{
			document.getElementById("menbar"+i).innerHTML="";
			}
		}

function showMenu(num)
	{

	hideDiv();
	var DHTML = (document.getElementById || document.all || document.layers);
	var posTop=104;
	var leftPos;

	if(num==1){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=/"+sPage+">English</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=/fr/"+sPage+">Français</a></nobr></td></tr>" +
		"</table>";
		leftPos=0;
		}
	if(num==2){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
		"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=/></a></nobr></td></tr>" +
		"</table>";
		leftPos=183;
		}
	if(num==3){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=billing-software.shtml>Billing and Customer Care</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=prepaid-internet-billing.shtml>Prepaid Internet & Voice</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=triple-play.shtml>Triple Play</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=radius-server.shtml>Radius Server</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=wireless-lan-billing-software.shtml>Public WLAN</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=wimax.shtml>WiMAX</a></nobr></td></tr>" +
			//			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=redB href=where.shtml>Where to Buy</a></nobr></td></tr>" +
			"</table>";
		leftPos=183;
		}
	if(num==4){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=convergent-billing.shtml>Service Enabler</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=hotspot-billing-software.shtml>RBS Hotspot</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=isp-billing.shtml>RBS ISP</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=voip-billing.shtml>RBS VOIP</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=voip-cost-asr-routing.shtml>VoIP Intelligent Route Server</a></nobr></td></tr>" +
		 //	"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=redB href=where.shtml>Where to Buy</a></nobr></td></tr>" +
		"</table>";
		leftPos=313;
		}
	if(num==5){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
			"</tr><tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=development-implementation.shtml>Implementation</a></nobr></td>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=remote-configuration-services.shtml>Remote Configuration</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=training.shtml>Education and Training</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=support.shtml>Support</a></nobr></td>" +
			"</tr><tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=consulting.shtml>Consulting</a></nobr></td></tr>" +
		"</table>";
		leftPos=443;
		}
	if(num==6){
		divTable = "<table width=130 cellpadding=2 cellspacing=1 bgcolor=#336699 border=0>" +
		 // "<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=where.shtml>Resellers List</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=technology-partners.shtml>Technology Partners</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=reseller-program.shtml>Reseller Program</a></nobr></td></tr>" +
			"<tr bgcolor=#336699><td onMouseOver=cangeColor(this); onMouseOut=returnColor(this);><nobr><a class=whiteB href=solution-program.shtml>Solutions Partners</a></nobr></td></tr>" +
		"</table>";
		leftPos=573;
		}
	//document.write(divTable);
	//eval("menbar"+num).innerHTML="<DIV id='hiddenDiv' style='position:absolute;top:104;left:"+leftPos+";z-index:5;background-color: transparent'>"+divTable+"</DIV>";
document.getElementById("menbar"+num).innerHTML = "<DIV id='hiddenDiv' style='position:absolute;top:106;left:"+leftPos+";z-index:5;background-color: transparent'>"+divTable+"</DIV>";
	}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
       var dc = document.cookie;
       var prefix = name + "=";
       var begin = dc.indexOf("; " + prefix);
       if (begin == -1)
       {
           begin = dc.indexOf(prefix);
           if (begin != 0) return null;
       }
       else
       {
           begin += 2;
       }
       var end = document.cookie.indexOf(";", begin);
       if (end == -1)
       {
           end = dc.length;
       }
       return unescape(dc.substring(begin + prefix.length, end));
}

 /**
  * Extract the camp value
  */
function extractCampValue()
{
  search_parameters_list = window.location.search;
  search_parameters = search_parameters_list.split("&");
  index = 0;
  while (index < search_parameters.length) {
    pos = search_parameters[index].indexOf("AlepoCamp=")
     if ( pos != -1) {
         alepo_camp_val =search_parameters[index].substr(pos + 10, search_parameters[index].length);
         return  alepo_camp_val;
    }
     index++;
  }
   return " ";
}

/**
 * Extract the keywords used for searching
 */
function extractKeywords()
{
   ref = document.referrer;
   if (ref && (ref.indexOf("google") > 0  || ref.indexOf("msn") > 0)) {
      pos = ref.indexOf("&q=")
   }
   else if (ref.indexOf("yahoo") > 0 ) {
      pos = ref.indexOf("&p=")
   }
   else {
      return "";
   }

   search_keywords_list_till_end = ref.substr(pos + 3, ref.length);
   pos = search_keywords_list_till_end.indexOf("&");
   if (pos > 0) {
     search_keywords_list = search_keywords_list_till_end.substring(0, pos);
   }
   else {
     search_keywords_list = search_keywords_list_till_end
   }

   /*search_keywords = search_keywords_list.split("+");*/
   search_keywords = search_keywords_list;
   return search_keywords;
}

/**
 * Sets the info in the cookie.
 */
function setInfo()
{
  // set cookie ONLY if it does not exist.
  var cookie_exists =  getCookie("alepo_cookie");
  if (cookie_exists)
     return;

  // get todays date
  var my_date = new Date();

  /**
   * New values can be appended to the cookie value. Note "####" is used as
   * seperator.
  */
  // build timeoffset string
  offsetHrsMins =  -1*(my_date.getTimezoneOffset()/60);
  offsetHrs = Math.floor(offsetHrsMins);
  offsetMins = -1*(my_date.getTimezoneOffset()%60);
  currentTimeZoneOffset =  + offsetHrs + ":" + offsetMins;
  if (offsetHrs > 0)
     currentTimeZoneOffset = "+" + currentTimeZoneOffset;

  // build date in mm/dd/yyyy format
  date_mm_dd_yyyy = (my_date.getMonth()+1) + "\\"
                    + my_date.getDate()	   + "\\"
					+ my_date.getYear();

  value = document.referrer
              + "####"
              + navigator.browserLanguage
              + "####"
              + date_mm_dd_yyyy
              + "####"
              + extractCampValue()
              + "####"
              + extractKeywords()
              + "####"
              + currentTimeZoneOffset;

  var exp_date = new Date("December 31, 2023");
  var the_cookie_date = exp_date.toGMTString();
  var the_cookie = "alepo_cookie="
                              + escape(value)
                              + ";expires="
                              + the_cookie_date;
                              + ";path=/;";

  document.cookie = the_cookie;
}




