
extArray = new Array(".gif", ".jpg", ".png");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Please only upload files that end in types:  " 
+ (extArray.join("  ")) + "\nPlease select a new "
+ "file to upload and submit again.");
}
function GetXmlHttpObject() {
	var objXMLHttp=null;
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}

function openModalWindow(ty) {
 sURL = "extra/"+ ty +".php" + document.location.search;
 vArguments = arguments;
 sFeatures = "dialogHeight:180px; dialogWidth:350px; center:yes; help:no; resizable:no; status:no; scroll:no";
 return window.showModalDialog(sURL, vArguments, sFeatures);
}


function getCities(country,root) {
	if(root=='' || root==null)
	{var url = "cities.php";}
	else
	{
   var url = root+"cities.php";
	}
   var city = document.getElementById("cityId");
 
   while(city.hasChildNodes()){
        for(var i = 0; i < city.childNodes.length; i++){
            city.removeChild(city.firstChild);
        }
}
	
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			//responseDiv.innerHTML = xmlHttp.responseText;
			//alert (xmlHttp.responseText);
			var splitString = xmlHttp.responseText.split("*");
            var count = splitString.length-1 ;
           	var c = new Array();		
			for(var i = 0; i < count; i++){
			 c=splitString[i].split("_");			  
			  city.options[i]= new Option(c[1], c[0]);
            }
			
			
		}
	}
	
 
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
	xmlHttp.send("country=" + country );

}

function getAdsPart(part,action) {
  
   var url   = "part.php";
   var id    = document.getElementById("adsPart");
   var adsId = document.getElementById("ads1");	
	
	if(part == 3 ){		 
		
	  	 id.style.display   = "block";
		 adsId.style.display= "none";
		
	}else if(part < 3) {
		id.style.display="none";
		adsId.style.display= "block";
		
		xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null) {
				alert ("Browser does not support HTTP Request");
				return;
			}
			
			xmlHttp.onreadystatechange=function() {
				adsId.innerHTML = '<img src="../images/loading.gif" />';
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
								
					adsId.innerHTML = xmlHttp.responseText;				
					
				}
			}
			 
			xmlHttp.open('POST', url, true);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
			xmlHttp.send("part=" + part );
	}
}

function joinmail(action,mailing) {
   var url = "joinmail.php";
   var vars = "";
   mailing.action.value = action;
  
  for(i=0; i < mailing.length; i++) {
		//mailing[i].disabled=true;
		//if(mailing[i].type=="submit" || mailing[i].type=="reset" || mailing[i].type=="button") continue;
	//	if(mailing[i].type=="radio" && mailing[i].checked==false) continue;
		
		vars = vars + mailing[i].name + '=' + mailing[i].value;
		
		if(i < mailing.length - 1)
			vars = vars + '&';
	     }
		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			//responseDiv.innerHTML = xmlHttp.responseText;
			alert (xmlHttp.responseText);
			//var splitString = xmlHttp.responseText.split("*");
           mailing.mname.value = '';
		   mailing.memail.value = '';
		  

			
		}
	}
	
 
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
	xmlHttp.send(vars);

}
function joinsms(action,sms) {
   var url = "joinsms.php";
   var vars = "";
  sms.action.value = action;
  
  for(i=0; i < sms.length; i++) {
		//mailing[i].disabled=true;
		//if(mailing[i].type=="submit" || mailing[i].type=="reset" || mailing[i].type=="button") continue;
	//	if(mailing[i].type=="radio" && mailing[i].checked==false) continue;
		
		vars = vars + sms[i].name + '=' + sms[i].value;
		
		if(i < sms.length - 1)
			vars = vars + '&';
	     }
		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			//responseDiv.innerHTML = xmlHttp.responseText;
			alert (xmlHttp.responseText);
			//var splitString = xmlHttp.responseText.split("*");
           sms.name.value = '';
		   sms.mobile.value = '';
		  

			
		}
	}
	
 
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
	xmlHttp.send(vars);

}

function changeStatus(st){
var _select = document.getElementById("sts");

if(st == 0){
 while(_select.hasChildNodes()){
        for(var i = 0; i < _select.childNodes.length; i++){
            _select.removeChild(_select.firstChild);
        }
 } 
 for(var i=0; i < 4 ;i++) {
  _select.options[i]= new Option(origOptions[i], i);     
 }    
}else {

while(_select.hasChildNodes()){
        for(var i = 0; i < _select.childNodes.length; i++){
            _select.removeChild(_select.firstChild);
        }
}
 for(var i=0; i < 4 ;i++) {
  _select.options[i]= new Option(origOptions1[i], i);     
 }

}

}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function CountWords (this_field, show_word_count, show_char_count) {
if (show_word_count == null) {
show_word_count = true;
}
if (show_char_count == null) {
show_char_count = false;
}
var char_count = this_field.value.length;
var fullStr = this_field.value + " ";
var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
var splitString = cleanedStr.split(" ");
var word_count = splitString.length -1;
if (fullStr.length <2) {
word_count = 0;
}
/*if (word_count == 1) {
wordOrWords = " word";
}
else {
wordOrWords = " words";
}
if (char_count == 1) {
charOrChars = " character";
} else {
charOrChars = " characters";
}
if (show_word_count & show_char_count) {
alert ("Word Count:\n" + "    " + word_count + wordOrWords + "\n" + "    " + char_count + charOrChars);
}
else {
if (show_word_count) {
alert ("Word Count:  " + word_count + wordOrWords);
}
else {
if (show_char_count) {
alert ("Character Count:  " + char_count + charOrChars);
      }
   }
}*/
return word_count;
}

function alpha(iVal) {
	oB = document.getElementsByTagName('body');
	if (iVal > 0) {
		filter = 'Alpha(opacity="'+iVal+'")';
		opacity = iVal/100;
	} else {
		filter = opacity = "";
	}
	oB[0].style.filter = filter;
	oB[0].style.MozOpacity = opacity;
	oB[0].style.opacity = opacity;
}
function popup_window(url,w,h) { 

var width=w;  var height=h;  var from_top=250;  var from_left=300;  var toolbar='no';  var location='no';  var directories='no';  var status='no';  var menubar='no';  var scrollbars='yes';  var resizable='no';  var atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';  atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;  atts+=',location='+location+',directories='+directories+',status='+status;  atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable; 
window.open(url,'win_name',atts); 
}
function CheckFieldL(fn,wn,rn,mc) {
  var len = fn.value.length;
  if (len > mc) {
    fn.value = fn.value.substring(0,mc);
    len = mc;
  }
  document.getElementById(wn).innerHTML = len;
  document.getElementById(rn).innerHTML = mc - len;
}

function Length(fn,wn,mc) {
  var len = fn.value.length;
  //if (len < mc) {
 //   fn.value = fn.value.substring(0,mc);
 //   len = mc;
  //}
  document.getElementById(wn).innerHTML = len;
  //document.getElementById(rn).innerHTML = mc - len;
}
function CheckFLength(len,mc) {  
   if (len < mc) {
    return false ; 
   }
  return true;
 }



function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val) {
	
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
	val.value = "";
	
  }
  return false;
}


function Check(oF) {
	for(i = 0; i < oF.length; i++) {
		e = oF.elements[i];
		if(e.type == 'checkbox' && e.name != 'allbox' && e.checked){
			
			return true;
			}		
	}
return false;
}



function CheckAll(oF) {
	for(i=0; i<oF.length; i++) {
		e = oF.elements[i];
		if(e.type == 'checkbox' && e.name != 'allbox') {
			if(oF.allbox.checked)
				e.checked = true;
			else
				e.checked = false;
		}
	}
}

function Reset(oF) {
	for(i=0; i<oF.length; i++) {
		e = oF.elements[i] ;
		if(e.type == 'checkbox')
			e.checked = false;
		else
			e.value = '';
	}
}


function CheckBox(oF, obj) {
	var count = 0;
	var len = 0;
	for(i = 0; i < oF.length; i++) {
		e = oF.elements[i];
		if(e.type == 'checkbox' && e.name != 'allbox' && e.checked)
			count++;
		if(e.type == 'checkbox' && e.name != 'allbox')
			len++;
	}
	if(oF.allbox.checked  && obj.checked == false)
		oF.allbox.checked = false;
	else if(oF.allbox.checked == false  && obj.checked == true && count == len)
		oF.allbox.checked = true;
}


function confirm_del() {
  var con=window.confirm("?? E??I ?E?C? ????E C???? ?"); 
  return con;
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
 var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");


  return (!r1.test(str) && r2.test(str));
}

function submitbutton(action,oF){
	oF.action.value = action;
	oF.submit();	
	oF.onsubmit = null;
}

function submitF(oF){
	oF.submit();	
	oF.onsubmit = null;
}
function checkform(of){
 var check=true;
  if (of.name.value == ''){
    alert('C???C? ?IIC? C?? C???EII? C?IC?E ???');
	check=false; 
  }
  if (of.pass.value == ''){
    alert('C???C? ?IIC? ???E C?????C?IC?E ???');
	check=false; 
  }
return check;	
}

function CheckTextField(oF) {
	var valid = true ;
	for(i=0; i<oF.length; i++) {
		e = oF.elements[i] ;
		if(e.name == 'email' && !isEmail(e.value)) {
			valid = false ;
		} else 
		if(e.value == '' || e.value == null){
			valid = false ;
		}
	}
	return valid ;
}

function CheckOne(oF, obj) {
	var count = 0;
	var len = 0;
	for(i = 0; i < oF.length; i++) {
		e = oF.elements[i];
		if(e.type == 'checkbox' && e.checked && obj.checked == true)
			e.checked = false ;
	}
}

/*function CheckTF(oF) {
	var valid = true ;
	
		if(oF.msg.value == '' ){
		valid =false;	
		}
	return valid ;
}*/
function CheckTF(oF) {
	var valid = true ;	
		if(oF.msg.value == '' ){
		 valid =false;	
		}else if(oF.code.value != 'undefined' ){
			if(oF.code.value == ''){
			  valid =false;
			}
		}
	return valid ;
}

function getSMSPart(part) {
  
   var url   = "smspart.php";
  // var id    = document.getElementById("adsPart");
   var adsId = document.getElementById("ads1");	
	  	// id.style.display   = "block";
		// adsId.style.display= "none";
		adsId.innerHTML = '<img src="../images/loading.gif" />';
		xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null) {
				alert ("Browser does not support HTTP Request");
				return;
			}
			
			xmlHttp.onreadystatechange=function() {
				
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
					//alert(xmlHttp.responseText);			
					adsId.innerHTML = xmlHttp.responseText;				
					
				}
			}
			 
			xmlHttp.open('POST', url, true);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
			xmlHttp.send("part=" + part );
	//}
}


function getSMSbalance(idway,part) {
  
   var url   = "smsbalance.php";
  // var id    = document.getElementById("adsPart");
 //alert(part +' '+ idway);
   var adsId = document.getElementById("ads1");	
	  	// id.style.display   = "block";
		// adsId.style.display= "none";
		adsId.innerHTML = '<img src="../images/loading.gif" />';
		xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null) {
				alert ("Browser does not support HTTP Request");
				return;
			}
			
			xmlHttp.onreadystatechange=function() {
				
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
					//alert(xmlHttp.responseText);			
					//balance.value = $bal;				
					adsId.innerHTML = xmlHttp.responseText;	
				}
			}
			 
			xmlHttp.open('POST', url, true);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-1256');
			
			xmlHttp.send("part=" + part+"&idway=" + idway );
	//}
}

/****************************** check ln **************************/
function fnCheckTextEntered()
{
//debugger;
	var bCheckFeedbackTextSize = false;
	if(fnCheckLanguage())
	{
		var strComments = document.getElementById('txtComments').value;
		bCheckFeedbackTextSize = fnCheckFeedbackTextSize(strComments+1);
	}
	if(!bCheckFeedbackTextSize)
	{
		return false;
	}
}



//check the language (key pressed)
function fnCheckLanguage()
{
	var strHexPressedKeyCode = event.keyCode; 
	return CheckCharLanguage (strHexPressedKeyCode);
}



//check if the passed character is allowed or not
function CheckCharLanguage (strHexPressedKeyCode)
{
	try
	{
		//-- Allowed Ranges
		//edited By Haitham @ 14/11/2006
		if (((strHexPressedKeyCode >= parseInt("0x600"))  && (strHexPressedKeyCode <= parseInt("0x6FF"))) || ((strHexPressedKeyCode >= parseInt("0x30")) && (strHexPressedKeyCode <= parseInt("0x39")))|| ((strHexPressedKeyCode >= parseInt("0x20"))  && (strHexPressedKeyCode <= parseInt("0x2F"))) || ((strHexPressedKeyCode >= parseInt("0x3A"))  && (strHexPressedKeyCode <= parseInt("0x40"))) || ((strHexPressedKeyCode >= parseInt("0x5B"))  && (strHexPressedKeyCode <= parseInt("0x60"))) || ((strHexPressedKeyCode >= parseInt("0x7B"))  && (strHexPressedKeyCode <= parseInt("0x7F")))|| ((strHexPressedKeyCode >= parseInt("0x0"))  && (strHexPressedKeyCode <= parseInt("0x1F"))) || (strHexPressedKeyCode == parseInt("0x2019")) || (strHexPressedKeyCode == parseInt("0xD")))	
				{return true;}
		else
		{
			
			//alert ("??C? ?? E?ECEE C?C?? EC??UE C???E?E");
			//document.getElementById("dnameA").innerHTML=" ??C? ?? E?ECEE C?C?? EC??UE C???E?E."; 

			
		return false;
		}
		
		
	}
	catch (eX)
	{
		// do nothing 
	}
}
/******************************ln En****************************/
function fnCheckTextEntered2()
{
//debugger;
	var bCheckFeedbackTextSize = false;
	if(fnCheckLanguage2())
	{
		//var strComments = document.getElementById('txtComments').value;
		bCheckFeedbackTextSize = fnCheckFeedbackTextSize(strComments+1);
	}
	if(!bCheckFeedbackTextSize)
	{
		return false;
	}
}



//check the language (key pressed)
function fnCheckLanguage2()
{
	var strHexPressedKeyCode = event.keyCode; 
	return CheckCharLanguage2 (strHexPressedKeyCode);
}



//check if the passed character is allowed or not
function CheckCharLanguage2 (strHexPressedKeyCode)
{
	try
	{
		//-- Allowed Ranges
		//edited By Haitham @ 14/11/2006
		if (((strHexPressedKeyCode >= parseInt("0x600"))  && (strHexPressedKeyCode <= parseInt("0x6FF"))) || ((strHexPressedKeyCode >= parseInt("0x30")) && (strHexPressedKeyCode <= parseInt("0x39")))|| ((strHexPressedKeyCode >= parseInt("0x20"))  && (strHexPressedKeyCode <= parseInt("0x2F"))) || ((strHexPressedKeyCode >= parseInt("0x3A"))  && (strHexPressedKeyCode <= parseInt("0x40"))) || ((strHexPressedKeyCode >= parseInt("0x5B"))  && (strHexPressedKeyCode <= parseInt("0x60"))) || ((strHexPressedKeyCode >= parseInt("0x7B"))  && (strHexPressedKeyCode <= parseInt("0x7F")))|| ((strHexPressedKeyCode >= parseInt("0x0"))  && (strHexPressedKeyCode <= parseInt("0x1F"))) || (strHexPressedKeyCode == parseInt("0x2019")) || (strHexPressedKeyCode == parseInt("0xD")))	
				{
				//alert ("C???C? ?IIC? ??C C???? EC??UE C????????E");
				return false;}
		else
		{
			
			//alert ("C???C? ?IIC? ??C C???? EC??UE C???E?E");
			
		return true;
		}
		
		
	}
	catch (eX)
	{
		// do nothing 
	}
}



/****************************** SMS **************************/
 	function CheckFieldLL(fn,wn,rn,mc,oF) {
 	  var mL= 1;
 	  var arL= 70;
 	  var enL= 160;
 	  
 	  var arLL= 67;
 	  var enLL= 132;
 	  
 	  var ln = chAr() ;
	  var len = fn.value.length;
	  
	  if(ln == 'arabic'){
		  mL=len/arL;
		  
		  if(mL > 1) arL=arLL;
		  if((len%arL) > 0){ 
		    mL=(len/arL)+1;
		  }		  		    
		
	  }else if(ln == 'english'){
	       mL=len/enL;
		  
		  if(mL > 1) enL=enLL;
		  if((len%enL) > 0){ 
		    mL=(len/enL)+1;
		  }
	  }
	  oF.msgLenght.value = len;
	  oF.noMsg.value = mL;
	  
	  document.getElementById(wn).innerHTML = len;
	  document.getElementById(rn).innerHTML =parseInt(mL);
   } 
 	String.prototype.toHex = function () {return this.charCodeAt(0).toString(16);}

		function chAr(){		
		   var text = document.getElementById('text');		   
		   var ln =''; 	
		   t=text.value.charAt(0);	  
		   
		   if((t.toHex() >= 621) && (t.toHex() <= 652)){
		    ln='arabic' ;
		   }else {
		    ln='english' ;
		   }
		   
		  for(i = 0; i < text.value.length; i++){
		    temp = t=text.value.charAt(i);
		    
             if(temp.toHex() >= 621 && temp.toHex() <= 652){
		      ln='arabic' ;
		      break;
		     }

		    
		  }
		 
		   return ln;
}

// JavaScript Document
g_fReturnFunction="ajaxError";
g_sRowsIndex="";

function HId(G){try{GEId(G).style.display="none";}catch(e){}}
function GEId(H){try{return document.getElementById(H);}catch(e){}}
function GetEl(I){try{return document.getElementsByName(I)[0];}catch(e){}}
function GetElCol(J){try{return document.getElementsByName(J);}catch(e){}}var g_OBJRet=null;
function RegErr(rb,sb){try{rb.lastIndex=0;return rb.test(sb.value)?false:true;}catch(e){return false;}}
function RegErrRV(tb,ub){try{tb.lastIndex=0;return tb.test(ub.value)?true:false;}catch(e){return false;}}
function InStrErr(vb,wb){if(vb==null||wb==null)return false;if(IsEmpty(vb.value)||IsEmpty(wb.value))return false;return vb.value.toLowerCase().indexOf(wb.value.toLowerCase())<0?false:true;}
function CharInStr(xb,yb){var fR=false;if(IsEmpty(xb)||yb==null)return fR;if(IsEmpty(yb.value))return fR;for(var i=0;i<xb.length;i++){if(yb.value.indexOf(xb.charAt(i))!=-1){fR=true;break;}}return fR;}
function IsEmpty(s){return s==""?true:false;}
function Trim(s){if(typeof s!="string")return s;s=s.replace(/^\s+/g,"");return s.replace(/\s+$/g,"");}
function TrimInputSpaces(zb){try{zb.value=Trim(zb.value);}catch(e){}}

function isDateGood(iY,iM,iD) {
    var oD=new Date(iY,iM-1,iD);
    var oDMin=new Date(1879,11,30);
    var oDNow=new Date();
    return(oD>=oDMin&&oD<oDNow);
}
function isValidDate(iY,iM,iD){
    var oD=new Date(iY,(iM-1),iD);
    return(((iM-1)==oD.getMonth())&&(iD==oD.getDate())&&(iY==oD.getFullYear()));
}


function modalReturn(sRs) {
	window.returnValue=sRs;
	window.close();
}
function AddItem(Text,Value)
{
    var opt = document.createElement("option");
    document.getElementById("List2").options.add(opt);        // Assign text and value to Option object
    opt.text = Text;
    opt.value = Value;
}
//default items
function SetDefaultItems()
{
		AddItem("اعلى اعلان في الصفحة",1);
		AddItem("القائمة اليمنى - الإعلان الأول",2);
		AddItem("القائمة اليمنى - الإعلان الثاني",3);
		AddItem("القائمة اليمنى - الإعلان الثالث",4);
		
		AddItem("القائمة اليسرى - الإعلان الأول",5);
		AddItem("القائمة اليسرى - الإعلان الثاني",6);
		AddItem("القائمة اليسرى - الإعلان الثالث",7);
		AddItem("القائمة اليسرى - الإعلان الرابع",8);
		AddItem("القائمة اليسرى - الإعلان الخامس",9);
		
		AddItem("الصفحة الرئيسية-وسط الصفحة اعلى",10);
		AddItem("الصفحة الرئيسية- وسط الصفحة اسفل",11);
}
function ClearList2()
{
//	alert(form1.List1.options[form1.List1.selectedIndex].value);
	var s = adddemand.List2
	while (s.hasChildNodes())
	s.removeChild(s.childNodes[0]);
}
function getvalue()
{
	if(adddemand.List1.options[adddemand.List1.selectedIndex].value==0)
	{

		//alert('selsect 1');
		ClearList2();
		AddItem("اعلى اعلان في الصفحة",1);
		AddItem("القائمة اليمنى - الإعلان الأول",2);
		AddItem("القائمة اليمنى - الإعلان الثاني",3);
		AddItem("القائمة اليمنى - الإعلان الثالث",4);
		
		AddItem("القائمة اليسرى - الإعلان الأول",5);
		AddItem("القائمة اليسرى - الإعلان الثاني",6);
		AddItem("القائمة اليسرى - الإعلان الثالث",7);
		AddItem("القائمة اليسرى - الإعلان الرابع",8);
		AddItem("القائمة اليسرى - الإعلان الخامس",9);
		
		AddItem("الصفحة الرئيسية-وسط الصفحة اعلى",10);
		AddItem("الصفحة الرئيسية- وسط الصفحة اسفل",11);

	}
	else if(adddemand.List1.options[adddemand.List1.selectedIndex].value==1)
	{
		//alert('selsect 2');
		ClearList2();
			
		AddItem("اعلان فى اعلى الصفحة",111);
		AddItem("المشاغل ومراكز التجميل",22);
		AddItem("المراكز التجارية",33);
		AddItem("المتاجر النسائية",44);
		AddItem("الاعلانات المبوبة",66);
		AddItem("وسط الصفحة اعلى",77);
		AddItem("وسط الصفحة اسفل",88);
		AddItem("نهاية الصفحة",99);		
	}
		else if(adddemand.List1.options[adddemand.List1.selectedIndex].value==2)
	{
		//alert('selsect 2');
		ClearList2();
			
		AddItem("البنر الاول داخل جميع المشاغل العادي",101);
		AddItem("البنر الثانى داخل جميع المشاغل العادية",102);
		AddItem("البنر الثالث داخل جميع المشاغل العادية",103);
		AddItem("البنر الاول داخل جميع المراكز التجارية",104);
		AddItem("البنر الثانى داخل جميع المراكز التجارية",105);
		AddItem("البنر الثالث داخل جميع المراكز التجارية",106);
		AddItem("البنر الاول داخل جميع المتاجر المنزلية",107);
		AddItem("البنر الثانى داخل جميع المتاجر المنزلية",108);
		AddItem("البنر الثالث داخل جميع المتاجر المنزلية",109);

		
	}
	
		else if(adddemand.List1.options[adddemand.List1.selectedIndex].value==3)
	{
		//alert('selsect 2');
		ClearList2();
			
		AddItem("البنر الاول داخل جميع المشاغل الذهبية",1001);
		AddItem("البنر الثانى دلخ جميع المشاغل الذهبية",1002);
		AddItem("البنر الثالث داخل جميع المشاغل الذهبية",1003);
		AddItem("البنر الاول داخل جميع المراكز الذهبية",1004);
		AddItem("البنر الثانى داخل جميع المراكز الذهبية",1005);
		AddItem("البنر الثالث داخل جميع المراكز الذهبية",1006);
		AddItem("البنر الاول داخل جميع المتاجر الذهبية",1007);
		AddItem("البنر الثانى داخل جميع المتاجر الذهبية",1008);
		AddItem("البنر الثالث داخل جميع المتاجر الذهبية",1009);
		
		
	}
			else if(adddemand.List1.options[adddemand.List1.selectedIndex].value==4)
	{
		//alert('selsect 2');
		ClearList2();
			
		AddItem("مشغل ذهبي",1);
		AddItem("مركز تجارى ذهبى",2);
		AddItem("متجر منزلى ذهبى",3);
		

		
	}


}
function checkMshSMS(oF){

 var check = true ;

 var err= ''; 

  if (oF.name.value == ''){

   err='لم تقم بإدخال اسم اسمك ';

   check=false; 

   }

   if (oF.mobile.value == ''){

   err='لم تقم بإدخال رقم الجوال';

      check=false; 

   }

   

   if(!checknumber1(oF.mobile.value)){

	  err="";

	 check=false;    

   }



   if(!check){

    alert(err);

   } 

  

 return check;

}
