////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////                                           //////////////////////////////////////////////////////////////
//////////////////////////////////////          Start of  images popup        //////////////////////////////////////////////////////////////
//////////////////////////////////////                                           ///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



Xoffset=-60;    // modify these values to ...
Yoffset= 20;    // change the popup position.

var old,skn,iex=(document.all),yyy=-1000;

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all

if (ns4)
{
skn=document.dek
}
else if (ns6)
{
skn=document.getElementById("dek").style;
}
else if (ie4)
{
skn=document.getElementById("dek").style;
}
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_mouse;

function popup(msg,bak){
var content="<TABLE  WIDTH=650 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
 if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
 if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}

function get_mouse(e){
iPosx = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX;
iPosy = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY;
iPx = (document.layers) ? e.pageX : event.clientX;
iPy = (document.layers) ? e.pageY : event.clientY;

skn.top=iPosy+yyy;
skn.left=iPosx+Xoffset;

}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}






////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
///////////////////////////////////////////////











var tableWidth=220;
var tableHeight=20;
var seventeenth=0;
var fontFamily='arial';
var fontSize=16;
var fontColor='#FF0000';
var leftabsposition=-90;
var seventeenth3=20;
var eighteenth3;
var toppositoin=0;
var leftposition=0;
var fdsfda19,fdsfda20;
var fdsfda21=0;
var fdsfda22=0;
var fdsfda23=0;
var fdsfda24;
var fdsfda25='';
var fdsfda26='';
var fdsfda27='';
var fdsfda28='';
var DimgWidth=220;


function fdsfda30(fdsfda36,img,imgWidth) 
{
imgWidth=parseInt(imgWidth);
if(imgWidth<100)
imgWidth=DimgWidth;

fdsfda25='<table align="center"width='+tableWidth+' height='+tableHeight+' cellspacing=0 cellpadding=0><tr><td align="center"valign=middle" style="background-color:#F2CB6E"><fieldset><legend ><b>مجال التنمية للتطوير والاستثمار العقاري </legend><table   align="center"dir=rtl  cellspacing=0 cellpadding="10" bgcolor="" width='+tableWidth+' height='+tableHeight+'>';
if(img!="")
{
fdsfda25+='<td align=center>';
fdsfda25+='<img src='+img+' width='+imgWidth+'    >';
fdsfda25+='</td></tr>';
}
if(fdsfda36!="c")
{
fdsfda25+='<tr><td align=center style="padding=5px;font-family:'+fontFamily+';color:'+fontColor+';font-size:'+fontSize+';font-weight:bold" width=100% >';
fdsfda25+=fdsfda36.substring(0,150)+"....<br><span style=font-size:16px;color:#333333>للمزيد اضغط على الرابط</span>";
fdsfda25+='</td></tr></table></td></tr></table>';
}
}







function fdsfda31(fdsfda36,img,imgWidth)
 {

if (fdsfda21<=fdsfda24.length-1) 
{
fdsfda21++;fdsfda22=fdsfda21-1;



fdsfda27=fdsfda24.substring(0,fdsfda22);
fdsfda28=fdsfda24.substring(fdsfda22,fdsfda21);
fdsfda30(fdsfda36,img,imgWidth);
if (document.all) 
{

fdsfda32.innerHTML=fdsfda25;
}
if (document.layers) 
{
document.fdsfda32.document.write(fdsfda25);document.fdsfda32.document.close();
}
}
else {clearTimeout(eighteenth3);
}
}

function fdsfda33()
 {
 clearTimeout(eighteenth3);fdsfda21=0;fdsfda22=0;
if (document.all) {document.all.fdsfda32.style.visibility='hidden';document.all.fdsfda34.style.visibility='hidden';}
if (document.layers) {document.fdsfda32.visibility='hidden';document.fdsfda34.visibility='hidden';}
}

function fdsfda35(fdsfda36,img,imgWidth) 
{
if(fdsfda36=="")
fdsfda36="عفوا لا توجد بانات توضيحيه <br>أضغط للمزيد";
fdsfda24=fdsfda36;

img=img;
fdsfda21=0;
fdsfda22=0;
leftposition=fdsfda19+leftabsposition;
toppositoin=fdsfda20+seventeenth3;
if (document.all) 
{	
document.all.fdsfda32.style.posLeft=leftposition;
document.all.fdsfda32.style.posTop=toppositoin;
document.all.fdsfda34.style.posLeft=leftposition;
document.all.fdsfda34.style.posTop=toppositoin;
document.all.fdsfda32.style.visibility='visible';
document.all.fdsfda34.style.visibility='visible';
fdsfda31(fdsfda36,img,imgWidth);
}

}

function set_position(fdsfda38,fdsfda39){
	fdsfda19 = fdsfda38;fdsfda20 = fdsfda39;}
function fdssda(e){iPosx = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX;iPosy = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY;iPx = (document.layers) ? e.pageX : event.clientX;iPy = (document.layers) ? e.pageY : event.clientY;

set_position(iPosx,iPosy);
}

if (document.layers){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = fdssda;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////                                           //////////////////////////////////////////////////////////////
//////////////////////////////////////          End of  images popup        //////////////////////////////////////////////////////////////
//////////////////////////////////////                                           ///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  Start 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  Start 
////////////////////////////////// Rainbow  Rainbow  Rainbow  Rainbow ////////////////////////////////////////////////////  Start 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  Start 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  Start 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  Start 

function toSpans(span) {
  var str=span.firstChild.data;
  var a=str.length;
  span.removeChild(span.firstChild);
  for(var i=0; i<a; i++) {
    var theSpan=document.createElement("SPAN");
    theSpan.appendChild(document.createTextNode(str.charAt(i)));
    span.appendChild(theSpan);
  }
}

function RainbowSpan(span, hue, deg, brt, spd, hspd) {
    this.deg=(deg==null?360:Math.abs(deg));
    this.hue=(hue==null?0:Math.abs(hue)%360);
    this.hspd=(hspd==null?3:Math.abs(hspd)%360);
    this.length=span.firstChild.data.length;
    this.span=span;
    this.speed=(spd==null?50:Math.abs(spd));
    this.hInc=this.deg/this.length;
    this.brt=(brt==null?255:Math.abs(brt)%256);
    this.timer=null;
    toSpans(span);
    this.moveRainbow();
}

RainbowSpan.prototype.moveRainbow = function() {
  if(this.hue>359) this.hue-=360;
  var color;
  var b=this.brt;
  var a=this.length;
  var h=this.hue;

  for(var i=0; i<a; i++) {

    if(h>359) h-=360;

    if(h<60) { color=Math.floor(((h)/60)*b); red=b;grn=color;blu=0; }
    else if(h<120) { color=Math.floor(((h-60)/60)*b); red=b-color;grn=b;blu=0; }
    else if(h<180) { color=Math.floor(((h-120)/60)*b); red=0;grn=b;blu=color; }
    else if(h<240) { color=Math.floor(((h-180)/60)*b); red=0;grn=b-color;blu=b; }
    else if(h<300) { color=Math.floor(((h-240)/60)*b); red=color;grn=0;blu=b; }
    else { color=Math.floor(((h-300)/60)*b); red=b;grn=0;blu=b-color; }

    h+=this.hInc;

    this.span.childNodes[i].style.color="rgb("+red+", "+grn+", "+blu+")";
  }
  this.hue+=this.hspd;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End -->
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End -->
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End -->
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End -->
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End -->



function confirmdelete(msg)
{
x=confirm("هل  تريد الحذف")
	if(x==true)
	{
	window.location=msg;
	}
	
	else
	{
	return false
	}
}


function show_hide_tab(tabno)
{
document.getElementById("tabno1").style.display="none";
document.getElementById("tabno2").style.display="none";
document.getElementById("tabno3").style.display="none";
document.getElementById("tabno"+tabno).style.display="block";
document.getElementById("tabno11").src="images/icons_027_03.jpg";
document.getElementById("tabno12").src="images/icons_027_02.jpg";
document.getElementById("tabno13").src="images/icons_027_01.jpg";
document.getElementById("tabno1"+tabno).src="images/icons_0288_0"+(4-tabno)+".jpg";
}

function show_hide(tabno)
{
	
if(document.getElementById(tabno).style.display=="none")
{
document.getElementById(tabno).style.display="block";
document.getElementById(tabno+'1').style.display="none";
}
else
{
document.getElementById(tabno).style.display="none";
document.getElementById(tabno+'1').style.display="block";
}
}

function validate_login()
{
msg1="من فضلك قم بادخال البريد الالكتروني ";	
msg2="من فضلك قم بادخال كلمه المرور";	


e_mail=document.getElementById("e_mail");
	
	if(e_mail.value=="")
	{
	alert(msg1);
	e_mail.focus();
	return false;
	}
	
	pass_word=document.getElementById("pass_word");
	
	if(pass_word.value=="")
	{
	alert(msg2);
	pass_word.focus();
	return false;
	}

}

function numonly(detectnumber)
{
var strstr=detectnumber.value;

   var ValidChars = "0123456789";
   var IsNumber=true;
   var Charr;
 fff=0;
   for (i = 0; i < strstr.length && IsNumber == true; i++) 
      { 
      Charr = strstr.charAt(i); 
      if (ValidChars.indexOf(Charr) == -1) 
         {
 		 fff=1;
         }
      }
	  if (fff==1) 
	  {
    alert("أرقام فقط ");
	detectnumber.value="";
	detectnumber.focus();
	}
	if(detectnumber.value.length!=0 &&(detectnumber.value.length>13 || detectnumber.value.length<8 ))
	{
    alert("من فضلك ادخل رقم صحيح");
	detectnumber.focus();
	}
   }
   
   

<!--
var http = createRequestObject();

function createRequestObject(){
    var request_;
    var browser = navigator.appName;
    
    if(browser =="Microsoft Internet Explorer" || typeof ActiveXObject !="undefined" ){
        request_ = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        request_ = new XMLHttpRequest();
    }
    return request_;
}


/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

function show_categories(cat_id){

    http.open('get', 'get_cat.php?cat_id='+cat_id);
	    http.onreadystatechange = get_cat_list1;
    http.send(null);
}

function get_cat_list1()
{
    
    if(http.readyState == 1)
    {
        document.getElementById('category_selection').innerHTML = '<div style="color:#FFFFFF">Loading....</div>';
    }   
   
    if(http.readyState == 4){
       if(http.status == 200 ){
          var response = http.responseText;
          document.getElementById('category_selection').innerHTML = response;

       }

}
}


                      ////////////////////////////////////////////////////////////////////
                 /////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////


function show_sub_cat(cat_id){

    http.open('get', 'get_main_cat.php?cat_id='+cat_id);
	    http.onreadystatechange = get_cat_list;
    http.send(null);
}

function get_cat_list()
{
    
    if(http.readyState == 1)
    {
        document.getElementById('category_selection2').innerHTML = '<div style="color:#ff0000">Loading....</div>';
    }   
   
    if(http.readyState == 4){
       if(http.status == 200 ){
          var response = http.responseText;
          document.getElementById('category_selection2').innerHTML = response;

       }

}
}


                      ////////////////////////////////////////////////////////////////////
                 /////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////


function set_city(country_id){

    http.open('get', 'set_city.php?country_id='+country_id);
	    http.onreadystatechange = handle_city;
    http.send(null);
}


function set_cityy(country_id){

    http.open('get', 'set_cityy.php?country_id='+country_id);
	    http.onreadystatechange = handle_city;
    http.send(null);
}





function handle_city()
{
    
    if(http.readyState == 1)
    {
        document.getElementById('city_region').innerHTML = '<div style="color:#FFFFFF">Loading....</div>';
    }   
   
    if(http.readyState == 4){
       if(http.status == 200 ){
          var response = http.responseText;
          document.getElementById('city_region').innerHTML = response;

       }

}
}







function set_city2(country_id){

    http.open('get', 'set_city2.php?country_id='+country_id);
	    http.onreadystatechange = handle_city2;
    http.send(null);
}

function handle_city2()
{
    
    if(http.readyState == 1)
    {
        document.getElementById('city_region2').innerHTML = '<div style="color:#FFFFFF">Loading....</div>';
    }   
   
    if(http.readyState == 4){
       if(http.status == 200 ){
          var response = http.responseText;
          document.getElementById('city_region2').innerHTML = response;

       }

}
}






var message="Function Disabled!";
///////////////////////////////////

//first, tell the browsers to react to the event
if( document.captureEvents && Event.KEYUP ) {
  //remove this part if you do not need Netscape 4 to work
  document.captureEvents( Event.KEYUP );
}
/* this next line tells the browser to detect a keyup
event over the whole document and when it detects it,
it should run the event handler function 'alertkey' */
document.onkeyup = alertkey;

//now create the event handler function to process the event
function alertkey(e) {
  if( !e ) {
    //if the browser did not pass the event information to the
    //function, we will have to obtain it from the event register
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return;
    }
  }
  if( typeof( e.keyCode ) == 'number'  ) {
    //DOM
    e = e.keyCode;
  } else if( typeof( e.which ) == 'number' ) {
    //NS 4 compatible
    e = e.which;
  } else if( typeof( e.charCode ) == 'number'  ) {
    //also NS 6+, Mozilla 0.9+
    e = e.charCode;
  } else {
    //total failure, we have no way of obtaining the key code
    return;
  }
  if(e==27) 
  window.location="index.php"
//  else
  //window.alert('The key pressed has keycode ' + e + ' and is key ' + String.fromCharCode( e ) );
  
}
// --> 

<!--
var message="Not allowed   \r\n  غير مسموح"
var testresults



function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
//document.onmousedown=click;
// -->

			function applyblur(object)
				{
				object.style.filter= "Alpha(Opacity=80, FinishOpacity=5, Style=2, StartX=20, StartY=40, FinishX=0, FinishY=0)"
				}
				
				function unapplyblur(object)
				{
				object.style.filter= ""
				}
				
				
				
function chn_dir(marqi)
{
if(marqi=="right")
document.getElementById("marqi").direction="right";
if(marqi==="left")
document.getElementById("marqi").direction="left";
}				


function delthis(path)
{

if(confirm("are you sure"))
window.location=path;
else
return false;
}


var testresults

function checkemail(mailobject){
var str=mailobject.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str) || str=="")
testresults=true
else{
alert("البريد الالكتروني غير صحيح")
mailobject.focus()
testresults=false
}
return (testresults)
}


<!--
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_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_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];}
}
//-->

function PopupPic(sPicURL) {
     window.open( "popup.htm?"+sPicURL, "mido",  
     "resizable=1,HEIGHT=10,WIDTH=10");
   }



