var LD = null;
var TransNB = 0;
//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
	var display_url=0
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);
// -->
//-->

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+=' يجب أن تدون عنوان بريدك الإلكتروني صحيحاً\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='عذراً ولكن يجب أن يكون رقم الهاتف صحيحاً\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += ' عذراً ولكن يجب تعبئة هذه الخانة\n'; }
  } if (errors) alert('\n'+errors);
  document.MM_returnValue = (errors == '');
}

function Dany_art_menu(x) 
{

  var ns4 = document.layers;
  var ns6 = document.getElementById && !document.all;
  var ie4 = document.all;
  if (x == 1){y = "visible";};
  if (x == 0){y = "hidden";};
 
  if(ns4) {document.layers.art_menu.style.visibility = y;};
  if(ns6){document.getElementById("art_menu").style.visibility = y;};
  if(ie4) {document.all["art_menu"].style.visibility = y;}
}

	function showmenuie5(){
	var rightedge=document.body.clientWidth-event.clientX
	var bottomedge=document.body.clientHeight-event.clientY

	if (rightedge<ie5menu.offsetWidth)
	ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
	else
	ie5menu.style.left=document.body.scrollLeft+event.clientX

	if (bottomedge<ie5menu.offsetHeight)
	ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
	else
	ie5menu.style.top=document.body.scrollTop+event.clientY

	ie5menu.style.visibility="visible"
	return false
	}

	function hidemenuie5(){
	ie5menu.style.visibility="hidden"
	}

	function highlightie5(){
	if (event.srcElement.className=="menuitems"){
	event.srcElement.style.backgroundColor="#999999"
	event.srcElement.style.color="#FFFFFF"
	if (display_url==1)
	window.status=event.srcElement.url
	}
	}

	function lowlightie5(){
	if (event.srcElement.className=="menuitems"){
	event.srcElement.style.backgroundColor=""
	event.srcElement.style.color="#000000"
	window.status=''
	}
	}

	function jumptoie5(){
	if (event.srcElement.className=="menuitems")
	window.location=event.srcElement.url
	}


function PopDesc(LD) {
   if(document.all) {
      StatDesc = LD ;
	  PopIE(LD,StatDesc);
   }
  
   else  {
      StatDesc = LD ;
      window.setTimeout("window.status = StatDesc",10);
//	  StatDesc
   }
}

function PopIE(MyDis,StatDesc) {
   document.all.HLie.innerHTML = MyDis
   document.all.HLie.style.left = window.event.clientX + 42;
   if((document.body.clientWidth - window.event.clientX) < document.all.HLie.offsetWidth) {
      document.all.HLie.style.left = (document.body.clientWidth - (document.all.HLie.offsetWidth + 12));
   }
   document.all.HLie.style.top = document.body.scrollTop + window.event.clientY + 20;
   if((document.body.clientHeight - window.event.clientY) < document.all.HLie.offsetHeight) {
      if(((document.body.clientWidth - window.event.clientX) < (document.all.HLie.offsetWidth + 43)) && ((document.body.clientHeight - window.event.clientY) < document.all.HLie.offsetHeight)) {
         document.all.HLie.style.left = (document.body.clientWidth - (document.all.HLie.offsetWidth + 12));
         document.all.HLie.style.top = document.body.scrollTop + (window.event.clientY - (document.all.HLie.offsetHeight + 15));
      }
      else {
         document.all.HLie.style.top = document.body.scrollTop + (document.body.clientHeight - (document.all.HLie.offsetHeight + 15));
      }
   }
   document.all.HLie.filters.revealTrans.Transition = TransNB;
   document.all.HLie.filters.revealTrans.Apply();
   document.all.HLie.style.visibility = "visible";
   document.all.HLie.filters.revealTrans.Play();
   TransNB++
   //window.setTimeout("window.status =StatDesc",10);
}




function RemDesc() {
   if(document.all) {
      document.all.HLie.filters.revealTrans.Transition = TransNB;
      document.all.HLie.filters.revealTrans.Apply();
      document.all.HLie.style.visibility = "hidden";
      document.all.HLie.filters.revealTrans.Play();
      TransNB++
      if(TransNB == 24) TransNB = 0;
   }
   
   window.status = '';
}



////////////////////////////////////////////////////////////////
//                                                            //
//           BYKLEIN CHROMELESS WINDOW OBJECT 2.0             //
//             FOR MICROSOFT IEXPLORER 5.5 & UP               //
//                                                            //
//   (c) Copyright 2003. Mariano Klein || www.byklein.com     //
//         Distributed under the terms of the GNU GPL         //
//                                                            //
//    Thanks to Gabriel Suchowolski || www.microbians.com     //
////////////////////////////////////////////////////////////////

ChromelessWindow = function ()
{
	var a = ChromelessWindow.arguments;
////////////////////////////////////////////////////////////////////PRIVATE PROPERTIES
 
	var URL = a[0];
	var title = "";                 // title
	var titlebarImage = "index/titlebar.gif";             // titlebarImage
	var titlebarHeight = 25;                                            // titlebarHeight
	var titleFont = "";                                       // titleFont
	var titleSize = 13;                                            // titleSize
	var titleColor = "#000000";                                     // titleColor
	var scrollbars = false;                                         // scrollbars
	var w = 380+(5*2);
	var h = 450+5+25;
	var centered = true;                                          // centered
	var xPos = 10;                                            // xPos
	var yPos = 10;                                            // yPos
	var borderColor = "#D4E5FF";                                     // borderColor
	var borderSize = 5;                                             // borderSize
	var minimizeButton = "index/minimizar.gif";            // minimizeBottom
	var closeButton = "index/cerrar.gif";               // closeBottom
	this.author = "Mariano Klein";
	this.version = "ByKlein Chromeless Windows 2.0";
	
	
	var win = (navigator.appVersion.indexOf("Windows"))?true:false;
	var ie= (navigator.appName == "Microsoft Internet Explorer")?true:false;
	var v = navigator.appVersion;
	var v55 = v.indexOf("MSIE 5.0")?true:false;
	var v60 = v.indexOf("MSIE 6.0")?true:false;
	var chromelessCompatible = null;
	var titlebarContent = null;
	var chromelessWW = null;
////////////////////////////////////////////////////////////////////PUBLIC METHODS
	openChromeless = function(){if(chromelessWW==null || chromelessWW.closed){openParent();setChrome();moveChromeless();setParentSource();}else{chromelessWW.execScript("showChromeless()");}}
	closeChromeless = function(){if(chromelessWW && !chromelessWW.closed)chromelessWW.close();chromelessWW=null}
	minimizeChromeless = function(){if(chromelessWW && !chromelessWW.closed)chromelessWW.execScript("minimizeChromeless()")}
	setURL = function(){URL = arguments[0];if(chromelessWW && !chromelessWW.closed){chromelessWW.execScript("b.all.canvas.URL='"+URL+"'");chromelessWW.execScript("showChromeless()");}}
	moveChromeless= function()
	{
		if (arguments.length == 0)
		{
			if (centered)
			{
				var tempX = w;
				var tempY = h;
				xPos = (screen.availWidth/2)-(tempX/2);
				yPos = (screen.availHeight/2)-(tempY/2);	
			}
		}
		else if(arguments[0]=="center")
		{
			var tempX = w;
			var tempY = h;
			xPos = (screen.availWidth/2)-(tempX/2);
			yPos = (screen.availHeight/2)-(tempY/2);
		}
		else
		{	
			xPos = arguments[0];
			yPos = arguments[1];
			
		}
		if((chromelessWW)&&(arguments.length != 0))
		{
			if(chromelessCompatible)
			{
				chromelessWW.execScript('var cx='+xPos+';');
				chromelessWW.execScript('var cy='+yPos+';');
				chromelessWW.execScript("showChromeless()");
				chromelessWW.execScript("focus()");
			}
			else
			{
				chromelessWW.moveTo(xPos,yPos);
			}
		}
	}
	resizeChromeless = function()
	{
		w = arguments[0];
		h = arguments[1];
		cH = (h-titlebarHeight)-borderSize;
		cW = w -(borderSize*2);
		if(chromelessWW)
		{
			chromelessWW.execScript('var cw='+w+';');
			chromelessWW.execScript('var ch='+h+';');
			chromelessWW.execScript("b.all.canvas.style.width='"+cW+"'");
			chromelessWW.execScript("b.all.canvas.style.height='"+cH+"'");
			chromelessWW.execScript("b.all.closeButton.style.right='"+borderSize+"'");
			chromelessWW.execScript("b.all.minimizeButton.style.right='"+(borderSize+20)+"'");
			chromelessWW.execScript("showChromeless();focus()");
		}
	}
////////////////////////////////////////////////////////////////////PRIVATE METHODS
	openParent = function()
	{
		chromelessCompatible = win && ie && (v55 || v60);
		var sc = (scrollbars)?"yes":"no";
		if (chromelessCompatible)
		{
			chromelessWW = window.open("about:blank","","top=5000,left=5000,width=100,height=100,scrollbars="+sc);
		}
		else
		{	
			chromelessWW = window.open(URL, "chromelessWindow","top="+yPos+",left="+xPos+",width="+w+",height="+(h-20)+",scrollbars="+sc+",resizable=0");
			chromelessWW.document.title = title;
		}	
	}	
	setChrome = function()
	{
		var cH = (h-titlebarHeight)-borderSize;
		var cW = w -(borderSize*2);
		this.c = "<object style='position:absolute;z-index:4;top:"+titlebarHeight+"px;left:"+borderSize+"px;width:"+cW+"px;height:"+cH+"px;' data='"+URL+"' id='canvas'></object>";
	
		if((titlebarImage==undefined)||(titlebarImage==null)||(titlebarImage==""))
		{
			titlebarContent="";
			tb = false;
		}
		else
		{
			titlebarContent="<img id='menu' unselectable='on' src='"+titlebarImage+"' style='position:absolute; top:0px; left:0px;z-index:2'>";
			tb = true;
		}
		menu = "\<div id='Title' unselectable='on' style='font-family:Arial;font-size:11px;font-weight:bold;position:absolute;top:5px;left:"+borderSize+"px;width:70%;height:15px;cursor:default;font-family:"+titleFont+";font-size:"+titleSize+";color:"+titleColor+";z-index:3'>"+title+"</div>\
			<img id='closeButton' unselectable='on' src='"+closeButton+"' width='15' height='15' style='position:absolute; top:5px; right:"+(borderSize)+"px;z-index:3'>\
			"+titlebarContent+"\<img id='minimizeButton' unselectable='on' src='"+minimizeButton+"' width='15' height='15' style='position:absolute; top:5px; right:"+(borderSize+20)+"px;z-index:3'>\
			<div id='fondo' unselectable='on' style='position:absolute; top:0px; left:0px; width:100%; height:100%; background-color:"+borderColor+";z-index:1'></div>";
		
	}	
	setParentSource = function()
	{
		if(chromelessWW)
		{
			chromelessWW.document.open();
			parentSource = '\
			<html>\n\
			<head>\n\
			<META HTTP-EQUIV="imagetoolbar" CONTENT="no">\n\
			<script>\n\
			var idsi = setInterval(objControl,50);\n\
			function objControl(){objContent = b.all("canvas").object;if(objContent!=null){setUpContent();}};\n\
			</script>\n\
			</head>\n\
			<body>\n\
			<script>\n\
			tempOpener = opener;\n\
			opener = self;\n\
			var c=window.createPopup();\n\
			var b=c.document.body;\n\
			var ox=oy=ix=iy=0;\n\
			var allContent =\"<html><head></head><body>'+menu+c+'</body></html>\";\n\
			b.innerHTML=allContent;\n\
			var cx='+xPos+';\n\
			var cy='+yPos+';\n\
			var cw='+w+';\n\
			var ch='+h+';\n\
			window.showChromeless = function(){\n\
			c.show(cx,cy,cw,ch)}\n\
			var mm=false;\n\
			var cmove=b.all("fondo");\n\
			var cmove2=(b.all("menu"))?b.all("menu"):"";\n\
			var ctitle=b.all("Title");\n\
			ctitle.style.visibility=('+tb+')?"hidden":"visible";\n\
			var cclose=b.all("closeButton");\n\
			var cminimize=b.all("minimizeButton");\n\
			self.resizeChromeless = function(){w = arguments[0];h = arguments[1];cH = (h-'+titlebarHeight+')-'+borderSize+';cW = w -('+borderSize+'*2);cw=w;ch=h;b.all.canvas.style.width=cW;b.all.canvas.style.height=cH;b.all.closeButton.style.right='+borderSize+';b.all.minimizeButton.style.right='+(borderSize+20)+';showChromeless();focus()}\n\
			self.moveChromeless = function(){if(arguments[0]=="center"){var tempX = '+w+';var tempY = '+h+';xPos = (screen.availWidth/2)-(tempX/2);yPos = (screen.availHeight/2)-(tempY/2);}else{xPos = arguments[0];yPos = arguments[1];}cx=xPos;cy=yPos;showChromeless();focus()};\n\
			self.setURL = function(){b.all.canvas.URL=arguments[0];showChromeless()};\n\
			self.closeChromeless = function(){opener=self;self.close()};\n\
			self.dragChromeless = function(){m = (arguments[0])?1:0};\n\
			function setUpContent(){\n\
			objContent.parentWindow.resizeChromeless = self.resizeChromeless;\n\
			objContent.parentWindow.moveChromeless = self.moveChromeless;\n\
			objContent.parentWindow.setURL = self.setURL;\n\
			objContent.parentWindow.closeChromeless = self.closeChromeless;\n\
			objContent.parentWindow.dragChromeless = self.dragChromeless;\n\
			};\n\
			cclose.onclick=function(){opener=self;self.close()};\n\
			cminimize.onclick=function(){if(tempOpener&&!tempOpener.closed){tempOpener.window.focus()}else{opener.blur();blur()}};\n\
			var m=ox=oy=ix=iy=0;\n\
			ctitle.onmousedown=cmove.onmousedown=cmove2.onmousedown=function(){m=1};\n\
			ctitle.onmouseup=cmove.onmouseup=cmove2.onmouseup=function(){m=0};\n\
			document.body.onclick=function(){if (m){ focus();cx=ix+event.screenX-ox;cy=iy+event.screenY-oy;c.show(cx,cy,cw,ch) }else {ix=cx; iy=cy; ox=event.screenX; oy=event.screenY } };\n\
			setInterval("document.body.click()",20);\n\
			onfocus=function(){showChromeless();focus()}\n\
			</script>\n\
			</body>\n\
			</html>\n\
			';
			chromelessWW.document.write(parentSource);
			chromelessWW.document.close();
			chromelessWW.document.title = title;
			chromelessWW.focus();
		}
	}
	////////////////////////////
	//     PUBLIC METHODS    ///
	////////////////////////////
	this.openChromeless = openChromeless;
	this.closeChromeless = closeChromeless;
	this.minimizeChromeless = minimizeChromeless;
	this.setURL = setURL;
	this.resizeChromeless = resizeChromeless;
	this.moveChromeless = moveChromeless;
}


function createChromeless(m)
{
	var mm = m;

		myChromeless = new ChromelessWindow(mm);
		myChromeless.openChromeless();
}
function DanyVOTE(x)
{
//alert(x);
var argv = document[x].elmt.length;
var results = "" ;
//alert(eval(argv))
if (document[x].elmt[0].checked) {results +=   document[x].elmt[0].value + "=1"}
					else {results +=   document[x].elmt[0].value + "=0"};
					
for (var i = 1; i < argv; i++) {
if (document[x].elmt[i].checked) {results += ";" +  document[x].elmt[i].value + "=1"}
					else {results += ";" +  document[x].elmt[i].value + "=0"};


								}


vid = document[x].vote_id.value;
title = document[x].title.value;
MyUrl = "vote.asp?title='" + title + "'&vote_id=" + vid + "&results=" + results;var ns6 = document.getElementById && !document.all;
var ie4 = document.all;

if(ns6){window.open(MyUrl,"results","width=400,height=400")};
if(ie4){window.open(MyUrl,"results","width=400,height=400")};//{createChromeless(MyUrl)};
//messageWindow("results",results)
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}