// define mouseover for main menu
if (document.images) {
  menu1on = new Image();
  menu1on.src = "/english/images/main/menu_01on.gif";

  menu2on = new Image();
  menu2on.src = "/english/images/main/menu_02on.gif";

  menu3on = new Image();
  menu3on.src = "/english/images/main/menu_03on.gif";

  menu4on = new Image();
  menu4on.src = "/english/images/main/menu_04on.gif";

  menu5on = new Image();
  menu5on.src = "/english/images/main/menu_05on.gif";

  menu1off = new Image();
  menu1off.src = "/english/images/main/menu_01off.gif";

  menu2off = new Image();
  menu2off.src = "/english/images/main/menu_02off.gif";

  menu3off = new Image();
  menu3off.src = "/english/images/main/menu_03off.gif";

  menu4off = new Image();
  menu4off.src = "/english/images/main/menu_04off.gif";

  menu5off = new Image();
  menu5off.src = "/english/images/main/menu_05off.gif";


  nav1on = new Image();
  nav1on.src = "/english/images/main/nav_01on.gif";

  nav2on = new Image();
  nav2on.src = "/english/images/main/nav_02on.gif";

  nav3on = new Image();
  nav3on.src = "/english/images/main/nav_03on.gif";

  nav4on = new Image();
  nav4on.src = "/english/images/main/nav_04on.gif";

  nav5on = new Image();
  nav5on.src = "/english/images/main/nav_05on.gif";
  
  nav1off = new Image();
  nav1off.src = "/english/images/main/nav_01off.gif";

  nav2off = new Image();
  nav2off.src = "/english/images/main/nav_02off.gif";

  nav3off = new Image();
  nav3off.src = "/english/images/main/nav_03off.gif";

  nav4off = new Image();
  nav4off.src = "/english/images/main/nav_04off.gif";

  nav5off = new Image();
  nav5off.src = "/english/images/main/nav_05off.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;
}





/* Creation date: 10/15/2003 */

onerror=ErrorManager;

function ErrorManager(){
	//return true;
}

function nvoid(){

}

function HideDiv(divName){
	var divObject=eval("document.all."+divName);
	divObject.style.display="none";
}


function ShowDiv(divName){
	var divObject=eval("document.all."+divName);
	divObject.style.display="block";
}

function ProceedShowHide(divName){
	var divObject=eval("document.all."+divName);
	
	if(divObject.style.display=="none"){
		divObject.style.display="block";
	}
	else{
		divObject.style.display="none";
	}
}

var iOpened=0;
function ProceedShow(){

	if(iOpened==0){
		iOpened=1;
		document.all.AddDiv.style.display="block";
		document.all.LinkText.innerHTML="HIDE";
	}
	else{
		iOpened=0;
		document.all.AddDiv.style.display="none";
		document.all.LinkText.innerHTML="SHOW";
	}
	
	
}




var isAll=false;
function SelectAllCheckBoxes(){

	
	if(isAll){
		re = /CHECKED/gi;  
		MainForm.innerHTML=MainForm.innerHTML.replace(re,"");
		SelectAllButton.value=" Select All ";
	}
	else{
		re = /type=checkbox/gi;  
		MainForm.innerHTML=MainForm.innerHTML.replace(re,"type=checkbox CHECKED");
		SelectAllButton.value=" Deselect All ";
	}
	
	isAll=!isAll;
	
}





/*************** Color settings ******************/
var tdMouseBasic="#f7f3f7";
var tdMouseOver="#e7dfe7";
var tdMouseSelected="#c6594a";
/***********************************************/


function tdOver(x,y){
	if(document.all&&y!="selected"){
		
		if(x.style.background!=tdMouseSelected){
			x.style.background=""+tdMouseOver;
		}
	}
}


function tdOut(x,y){
	if(document.all&&y!="selected"){
		x.style.background=""+tdMouseBasic;	
	}
}


// 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);