// Browser Detection
//
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

IE5plus = IE5 || IE6;
IEMajor = 0;

if (IE4plus)
{
	var start = navigator.appVersion.indexOf("MSIE");
	var end = navigator.appVersion.indexOf(".",start);
	IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
	IE5plus = (IEMajor>=5) ? true : false;
}




	document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/"
	+ "AaliHost_ie_home.css"
	+ "\">");

	
	var subfolder="";
	
	if (document.images) {
  menu1on = new Image();
  menu1on.src = subfolder+"images/TopMenu/ApplicationHover.gif";

  menu2on = new Image();
  menu2on.src = subfolder+"images/TopMenu/MicrosoftHostHover.gif";

  menu3on = new Image();
  menu3on.src = subfolder+"images/TopMenu/MicrosoftSharepointHover.gif";

  menu4on = new Image();
  menu4on.src = subfolder+"images/TopMenu/SitebuliderHover.gif";

  menu5on = new Image();
  menu5on.src = subfolder+"images/TopMenu/EcommerceHover.gif";
  
  menu6on = new Image();
  menu6on.src = subfolder+"images/TopMenu/TechnicalHover.gif";

  menu1off = new Image();
  menu1off.src = subfolder+"images/TopMenu/Application.gif";

  menu2off = new Image();
  menu2off.src = subfolder+"images/TopMenu/MicrosoftHost.gif";

  menu3off = new Image();
  menu3off.src = subfolder+"images/TopMenu/MicrosoftSharepoint.gif";

  menu4off = new Image();
  menu4off.src = subfolder+"images/TopMenu/Sitebulider.gif";

  menu5off = new Image();
  menu5off.src = subfolder+"images/TopMenu/Ecommerce.gif";
  
  menu6off = new Image();
  menu6off.src = subfolder+"images/TopMenu/Technical.gif";
  
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

// Switch Language

function Switch(Target)
{

 // Target True then From English to Arabic

 var strTemp,strTempNew;
 
 strTemp=document.location.href;

 if(Target)
	strTempNew=strTemp.replace("english","arabic");
 else
	strTempNew=strTemp.replace("arabic","english");
   
 if(strTemp.indexOf("/english/")==-1)
	 if(Target)
		strTempNew=strTemp.replace("default","/arabic/default");
		
 document.location.href=strTempNew;
}


// Portfolio Pop-ups
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}


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();
}
MM_reloadPage(true);