//reloads the window if Nav4 resized----------------------------------------------------------
function MM_reloadPage(init) {  
  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);
//--------------------------------------------------------------------------------------------

//Popup Win-----------------------------------------------------------------------------------
function OpnPopWin(theURL,winNam,winPro) { 
  window.open(theURL,winNam,winPro);
}
//--------------------------------------------------------------------------------------------

//Add to favorite-----------------------------------------------------------------------------
function add2fav(webUrl, webNam){
	
	window.external.AddFavorite( webUrl, webNam)
}
//--------------------------------------------------------------------------------------------


//Section NAvigation--------------------------------------------------------------------------
function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
//--------------------------------------------------------------------------------------------

//Go Back Dude--------------------------------------------------------------------------------
function goBackDude()
{
	window.history.back();
}
function GoBack()
{
	setTimeout('goBackDude()', 3000);
}

//--------------------------------------------------------------------------------------------

//Check empty---------------------------------------------------------------------------------
function ckEmp(frm, fld, art)
{
	var fld2ck = document.getElementById(fld);
	
	if( fld2ck.value=="" )
	{
		alert(art);
		fld2ck.focus();
	}
	else
	{
		document.forms[frm].submit();
	}
}
//--------------------------------------------------------------------------------------------

//Set Title-----------------------------------------------------------------------------------------
function SetNavPro(Lng, actID)
{
	var AvilLngs = new Array('En', 'Ar');
		WS_Lang = new Array();
		WS_Lang[AvilLngs[0]] = new Array('Profile', 'Services', 'Portfolio', 'Contact');
		WS_Lang[AvilLngs[1]] = new Array('السيرة الذاتية', 'الخدمات', 'المعرض', 'الاتصال');
	
	var InfBarImgPth = 'Lyot/'+Lng+'/',
		InfBarTtlImg = new Array('InfBar-Ttl_Pro', 'InfBar-Ttl_Srv', 'InfBar-Ttl_Por', 'InfBar-Ttl_Con', 'InfBar-Ttl_Nws', 'InfBar-Ttl_Lts'),
		InfBarImg_S = GEID('InfImg_S'),
		InfBarImg_L = GEID('InfImg_L');
	
	WS_Nam = Lng == AvilLngs[0] ? 'ORILENZ photos' : 'اريلنز فوتوز';
	
	if( actID == 'Reset1' )
	{
		var HomTtl = Lng == AvilLngs[0] ? 'Welcome' : 'مرحباً';
		
		document.title = WS_Nam+' : '+HomTtl;
		InfBarImg_S.src = InfBarImgPth+InfBarTtlImg[4]+'.jpg';
		//InfBarImg_L.src = InfBarImgPth+InfBarTtlImg[5]+'.jpg';
	}
	else if( actID == 'Reset2' )
	{
		var HomTtl = Lng == AvilLngs[0] ? 'Welcome' : 'مرحباً';
		
		document.title = WS_Nam+' : '+HomTtl;
		//InfBarImg_S.src = InfBarImgPth+InfBarTtlImg[4]+'.jpg';
		InfBarImg_L.src = InfBarImgPth+InfBarTtlImg[5]+'.jpg';
	}
	else
	{
		document.title = WS_Nam+' : '+WS_Lang[Lng][actID];
		
		if( actID != 2 ) InfBarImg_S.src = InfBarImgPth+InfBarTtlImg[actID]+'.jpg';
		if( actID == 2 ) InfBarImg_L.src = InfBarImgPth+InfBarTtlImg[2]+'.jpg';
	}


}
//---------------------------------------------------------------------------------------------


//FX------------------------------------------------------------------------------------------
function BlnkText(divID, divTxt)
{
	var BlkDiv = document.getElementById(divID);
	BlkDiv.innerHTML == '' ? BlkDiv.innerHTML = divTxt : BlkDiv.innerHTML = '';
} 

function OvrClrText(divID, divClr1, divClr2)
{
	var BlkDiv = document.getElementById(divID);
	BlkDiv.style.color == divClr1 ? BlkDiv.style.color = divClr2 : BlkDiv.style.color = divClr1;
} 


function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
//--------------------------------------------------------------------------------------------


//Adjust Print Div----------------------------------------------------------------------------
function doPrt()
{
	window.print();
}

function doHlite(wm, tHs, lnkH, lnkU)
{
	toHl = document.getElementById(tHs);
	hLnk = document.getElementById(lnkH);
	uLnk = document.getElementById(lnkU);
	
	hlCr_1 = '#FFFFB8';
	hlCr_2 = '';
	
	switch( wm )
	{
		case 'h':
		toHl.style.backgroundColor=hlCr_1;
		hLnk.style.display='none';
		uLnk.style.display='';
		break;
		
		case 'u':
		toHl.style.backgroundColor=hlCr_2;
		hLnk.style.display='';
		uLnk.style.display='none';
		break;
		
	}
}

//--------------------------------------------------------------------------------------------


//Menu----------------------------------------------------------------------------------------
function MnuNorOvr(objId, objCls)
{
	var objToOvr = document.getElementById(objId);
	return objToOvr.className=objCls;
}

function GoToURL(basUrl)
{
	var basSitUrl = basUrl==null || basUrl=='' ? null : basUrl;
	if( basSitUrl != null ) return window.location = basSitUrl;
	else return false;
}
//---------------------------------------------------------------------------------------------

//Misc-----------------------------------------------------------------------------------------
function GEID(elm)
{
	if( document.getElementById(elm) ) return document.getElementById(elm);	
	else return false;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function FshBnrSH(bnrID)
{
	var bnrDiv = new Array('FshBnr_00_Wel', 'FshBnr_01_Pro', 'FshBnr_02_Srv', 'FshBnr_03_Por', 'FshBnr_04_Con');
	
	for( var reSrt = 0; reSrt < bnrDiv.length; reSrt++ )
	{
		GEID(bnrDiv[reSrt]).style.display = 'none';
	}
	GEID(bnrID).style.display = '';
}

function xFshBnr(bnrId)
{
	var bnrFilNam = new Array('Bnr-00-Wel', 'Bnr-01-Pro', 'Bnr-02-Srv', 'Bnr-03-Por', 'Bnr-04-Con');
	
	var fshObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="823" height="113"><param name="movie" value="Lyot/Glbl/'+bnrFilNam[bnrId]+'.swf" /><param name="quality" value="high" /><param name="menu" value="false" /> <param name="wmode" value="transparent" /><embed src="Lyot/Glbl/'+bnrFilNam[bnrId]+'.swf" width="823" height="113" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed></object>';

	GEID('FshBnrDiv').innerHTML = fshObj;
}

function ShwHidElm(Obj)
{
	var objToPrf = GEID(Obj);
	if( objToPrf.style.display=='none' )
	{
		objToPrf.style.display='';
	}
	else
	{
		objToPrf.style.display='none';
	}
}


//---------------------------------------------------------------------------------------------
