var Riyadh = new Array("SelectArea","Rowdah-1","Rowdah-2","Rabwah","Oruba","Makkah-Rd","King-Saud-University","Hai-al-Mohammadia","Dohra-al-Badia","Warehouse");
var Jeddah = new Array("Select Area", "Halaga","Hai-al-salama");
var Makkah = new Array("Select Area","Al-Azeezia");
var Qassim = new Array("Select Area","Buraidah", "Al-Ras");
var Hail = new Array("Select Area","Hail");
var AlJouf = new Array("Select Area","Sakaka");

var CityName = "---";
var areaName = "***";
function swapOptions(the_array_name)
    {
    var numbers_select = window.document.myform.Areas;
    var the_array = eval(the_array_name);
    CityName = the_array_name;
    setOptionText(window.document.myform.Areas,the_array);
}

function setOptionText(the_select, the_array)
    {
    	the_select.length=the_array.length;
    	for (c=0; c < the_array.length; c++)
      	  {
      	  the_select.options[c].text = the_array[c];
	    }
   }
//-->

	function changeAddress(the_selected_name) { 
	
	areaName = the_selected_name;
		
	if ((CityName=="Riyadh")&&(areaName=="Rowdah-1")) {
	window.document.myform.address.value = " Address : Al Ahsa Street Bin Ali \n";
	window.document.myform.address.value += "               , Riyadh \n";
	window.document.myform.address.value += " Phone no : +966-1-4934793";
	}

	if ((CityName=="Riyadh")&&(areaName=="Rowdah-2")) {
	window.document.myform.address.value = " Address : Abdul Rehman Al Ghafqi Street \n";
	window.document.myform.address.value += "               , Riyadh \n";
	window.document.myform.address.value += " Phone no : +966-1-2085044";
	}

	if ((CityName=="Riyadh")&&(areaName=="Rabwah")) {
	window.document.myform.address.value = " Address : Rabwah Vegetable Market \n";
	window.document.myform.address.value += "               , Riyadh \n";
	window.document.myform.address.value += " Phone no : +966-1-4961743";
	}

	if ((CityName=="Riyadh")&&(areaName=="Oruba")) {
	window.document.myform.address.value = " Address : Oruba Street \n";
	window.document.myform.address.value += "               , Riyadh \n";
	window.document.myform.address.value += " Phone no : +966-1-4608089";
	}

	if ((CityName=="Riyadh")&&(areaName=="Makkah-Rd")) {
	window.document.myform.address.value = " Address : On Main Highway Makkah Rd,  \n";
	window.document.myform.address.value += "              Near Sallum Traffic signal,Dirab, Riyadh \n";
	window.document.myform.address.value += "Phone no : +966-1-4229512";
	}

	if ((CityName=="Riyadh")&&(areaName=="King-Saud-University")) {
	window.document.myform.address.value = " Address : Inside Al Jomaiah Super Market,  \n";
	window.document.myform.address.value += "             , Riyadh \n";
	window.document.myform.address.value += "Phone no : +966-1-4682833";
	}

	if ((CityName=="Riyadh")&&(areaName=="Hai-al-Mohammadia")) {
	window.document.myform.address.value = " Address : On Main Road \n";
	window.document.myform.address.value += "              , Near Ministry of foriegn affairs, Riyadh \n";
	window.document.myform.address.value += "Phone no : ";
	}

	if ((CityName=="Riyadh")&&(areaName=="Dohra-al-Badia")) {
	window.document.myform.address.value = " Madina Munawara Street \n";
	window.document.myform.address.value += "             , Riyadh \n";
             window.document.myform.address.value += "Phone no : +966-1-2672461";
	}

	if ((CityName=="Riyadh")&&(areaName=="Warehouse")) {
	window.document.myform.address.value = "Address : Watania Main Warehouse,  \n";
	window.document.myform.address.value += "              Sulai - near Nadec Company, Riyadh \n";               
	window.document.myform.address.value += "Phone no. 1: +966-1-2705225 or +966-1-2433368 \n";
	window.document.myform.address.value += "Fax no. : +966-1-2433367";
	}
	  
	if ((CityName=="Jeddah")&&(areaName=="Halaga")) {
	window.document.myform.address.value = " Address : Ummalqura RD. Opp Halaga West Entrance \n";						window.document.myform.address.value += "               , Jeddah  \n";
	window.document.myform.address.value += "Phone no : +966-2-6930289 ";
	}
	
	if ((CityName=="Jeddah")&&(areaName=="Hai-al-salama")) {
	window.document.myform.address.value = " Address : Abdul Rahman al Sudairi St \n";
	window.document.myform.address.value += "              Near Al shoaibi Mosque, Jeddah \n";
	window.document.myform.address.value += "Phone no : +966-2-6915082 ";
	}

	if ((CityName=="Makkah")&&(areaName=="Al-Azeezia")) {
	window.document.myform.address.value = " Address : Al Azeezia main Road \n";
	window.document.myform.address.value += "              Beside Fakieh Mosque, Makkah Mukaramah \n";
	window.document.myform.address.value += "Phone no : +966-4-5593993 ";
	}

	if ((CityName=="Qassim")&&(areaName=="Buraidah")) {
	window.document.myform.address.value = " Address : Inside Al Rajhi Khaini Group \n";
	window.document.myform.address.value += "              on Main road, Buraidah, Qassim \n";
	window.document.myform.address.value += "Phone no : +966-6-3823777 ";
	}
	
	if ((CityName=="Qassim")&&(areaName=="Al-Ras")) {
	window.document.myform.address.value = " Address : Inside Vegetable Market \n";
	window.document.myform.address.value += "             Opp STC. Al Ras, Qassim \n";
	window.document.myform.address.value += "Phone no : +966-6-3339181 \n";
	}

	if ((CityName=="Hail")&&(areaName=="Hail")) {
	window.document.myform.address.value = " Address : Near Nasriyah Market, \n";
	window.document.myform.address.value += "             on Talateen Road - Hai Al Jameein, Hail \n";
	window.document.myform.address.value += "Phone no : +966-6-5314338 \n";
	}

	if ((CityName=="AlJouf")&&(areaName=="Sakaka")) {
	window.document.myform.address.value = " Address : On Main Highway  \n";
	window.document.myform.address.value += "             beside Al-Jouf Vegetable Market, Al Jouf \n";
	window.document.myform.address.value += "Phone no : +966-4-6245972 \n";
	}
}

function openMap() {

 if(document.myform.Areas.selectedIndex==0){
 alert (" please choose the Location ");
 document.myform.Areas.focus();
 }  

if (areaName=="Rowdah-1"){
window.open('maps/rawda1.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,height= 400'); 
}

if (areaName=="Rowdah-2"){
window.open('maps/rawda2.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Rabwah"){
window.open('maps/rabwa.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Oruba"){
window.open('maps/oroba.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Makkah-Rd"){
window.open('maps/riyadh_makkahrd.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550, height=400');
}

if (areaName=="King-Saud-University"){
window.open('maps/riyadh_ksu.html','MAP','toolbar=no, directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Hai-al-Mohammadia"){
window.open('maps/mohammadia.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Dohra-al-Badia"){
window.open('maps/map_riyadh_badea.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=415');
}

if (areaName=="Warehouse"){
window.open('maps/riyadh_wh.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}


if (areaName=="Halaga"){
window.open('maps/JeddahHalaqa.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Hai-al-salama"){
window.open('maps/Jeddah_salama.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Al-Azeezia"){
window.open('maps/Map_Makkah.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Buraidah"){
window.open('maps/Buraidah.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}

if (areaName=="Al-Ras"){
window.open('maps/Map_AlRass.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=398');
}

if (areaName=="Hail"){
window.open('maps/Map_Hail.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=396');
}

if (areaName=="Sakaka"){
window.open('maps/Map_sakaka_Jouf.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=555,   height=412');
}

if (areaName=="Head-Office"){
window.open('maps/riyadh_hq.html','MAP','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=550,   height=400');
}
}
