var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}



var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo


if(ie){
Ex = "event.x"
Ey = "event.y"

topColor = "#808080"
subColor = "#C0C0C0"
}

if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere

topColor = "#808080"
subColor = "#C0C0C0"
}


function MoveToolTip(layerName, FromTop, FromLeft, e){
	if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop)))}
	if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
	eval(doc + layerName + sty + ".left = " + ((eval(FromLeft) - 37) + document.body.scrollLeft))
}

function ReplaceContent(layerName){
	if(ie){document.all[layerName].innerHTML = ContentInfo}
	if(ns){
	with(document.layers[layerName].document) 
	{ 
		open(); 
		write(ContentInfo); 
		close(); 
	}
	}
}



function Activate(){initialize=1}
function deActivate(){initialize=0}


function overhere(e){
	if(initialize)
	{
//		var offsetTrail = document.getElementById('btn10');
//		ab = offsetTrail.offsetTop + 119;
//		ab = (document.body.scrollLeft);
		aa = 90
		MoveToolTip("ToolTip", aa, Ex, e)
		eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
	}
	else
	{
		MoveToolTip("ToolTip", 0, 0)
		eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
	}
}

function EnterContent(layerName,TContent){
	ContentInfo = '<table width="74" height="33" border="0" cellspacing="0" cellpadding="0" background="images_en/img9.gif">'+
	'<tr><td height="3"></td></tr><tr><td class="TTf" height="17" align="center">'+TContent+'</td></tr><tr><td></td></tr></table>';
	ReplaceContent(layerName)
}








function RunForYourLife(aa,abb)
{
	x=document.services
	usernamev=x.txtUserName.value
	passwordv=x.txtPassword.value
	if (usernamev.length<2 || passwordv.length<2)
	{
			if (aa == '10'){
				if (abb == 'B'){
					top.location = "http://download.jeel.com/new/english/"
				}else{
					top.location = "http://download.jeel.com/new/arabic/"
				}
			}
			else if (aa == '11'){
				if (abb == 'B'){
					top.location = "http://classifieds.jeel.com"
				}else{
					top.location = "http://classifieds.jeel.com/StartArabic.asp"
				}
			}
			else if (aa == '12'){
				if (abb == 'B'){
					top.location = "http://forums.jeel.com/page1-en.asp"
				}else{
					top.location = "http://forums.jeel.com/page1-ar.asp"
				}
			}
			else if (aa == '15'){
					top.location = "http://chat.jeel.com/"
			}
			else if (aa == '3'){
				if (abb == 'B'){
					top.location = "http://sms.jeel.com/new/english"
				}else{
					top.location = "http://sms.jeel.com/new/arabic"
				}
					
			}
			else if (aa == '13'){
				if (abb == 'B'){
					top.location = "http://2way.jeel.com/new/english"
				}else{
					top.location = "http://2way.jeel.com/new/arabic"
				}
			}
			else if (aa == '7'){
				if (abb == 'B'){
					top.location = "http://favorites.jeel.com/new/english"
				}else{
					top.location = "http://favorites.jeel.com/new/arabic"
				}
			}
			else if (aa == '8'){
				if (abb == 'B'){
					top.location = "http://myfiles.jeel.com/new/"
				}else{
					top.location = "http://myfiles.jeel.com/new/default-ar.asp"
				}
			}
			else if (aa == '1'){
					top.location = "http://support.jeel.com/ISPProUsersInterface/"
			}
			else if (aa == '9'){
				if (abb == 'B'){
					top.location = "http://games.jeel.com/new/english"
				}else{
					top.location = "http://games.jeel.com/new/arabic"
				}
			}
			else if (aa == '4'){
				if (abb == 'B'){
					top.location = "http://www.jeel.com/calender/calender/"
				}else{
					top.location = "http://www.jeel.com/calender/calender/default-ar.asp"
				}
			}
			else if (aa == '5'){
				if (abb == 'B'){
					top.location = "http://webfax.jeel.com/webfax/default-en.asp"
				}else{
					top.location = "http://webfax.jeel.com/webfax/"
				}
			}
			else
			{
				if (abb == 'B'){
					alert("Please Login first.")
					document.services.txtUserName.focus();
				}else{
					alert("الرجاء إدخال إسم المستخدم وكلمة المرور")
					document.services.txtUserName.focus();
				}
			}
	}
	else
	{
		if (aa == '1'){
			x = document.form1	//Support
		}else if(aa == '2'){
			x = document.form5	//Web Mail
		}else if(aa == '3'){
			x = document.form2	//SMS
		}else if(aa == '4'){
			x = document.form3	//Calendar
		}else if(aa == '5'){
			x = document.form4	//WebFax
		}else if(aa == '6'){
			x = document.form6	//Members
		}else if(aa == '7'){
			x = document.form7	//Favorites
		}else if(aa == '8'){
			x = document.form8	//My Files
		}else if(aa == '9'){
			x = document.form9	//My Files
		}else if(aa == '10'){
			x = document.form10	//Downloads
		}else if(aa == '11'){
			x = document.form11	//Classifieds
		}else if(aa == '12'){
			x = document.form12	//Forums
		}else if(aa == '13'){
			x = document.form13	//2 way sms
		}else if (aa == '15'){
			top.location = "http://chat.jeel.com/"	//Chat
			return false;
		}
		if (aa == '8' || aa == '7' || aa == '10'){
			x.strUserName.value = document.services.txtUserName.value;
			x.strPassword.value = document.services.txtPassword.value;
			x.submit();
		}else if (aa == '2' || aa == '11'){
			x.username.value = document.services.txtUserName.value;
			x.password.value = document.services.txtPassword.value;
			x.submit();
		}else if (aa == '12'){
			x.userid.value = document.services.txtUserName.value;
			x.passwd.value = document.services.txtPassword.value;
			x.submit();
		}else{
			x.txtUserName.value = document.services.txtUserName.value;
			x.txtPassword.value = document.services.txtPassword.value;
			x.submit();
		}
	}
}





function OpenWin(filename,winW,winH)
{
	window.open(filename,"my_new_window","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width="+ winW +",height="+ winH +"")
}







function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() 
	{ //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; 
	  document.MM_sr=new Array; 
	  for(i=0;i<(a.length-2);i+=3)
	  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; 
	  if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
   }
}




