function showhidefn(name3) {
/*	var y="For more details, Click here ";
var x="&nbsp;&nbsp;(Hide Details)";*/
	if(document.getElementById(name3).style.display=="none")
	{
		
		for(i=1; i<=3;i++)
		{ 

			document.getElementById('doc'+ i).style.display = "none";
		}

	document.getElementById(name3).style.display="inline";

	} 
		
}
function john(val,ido)
{
//alert ('aaa');
document.getElementById(ido).value= document.getElementById(ido).value + val;
}
function fn()
{
do {

//alert('john');
	var y;
		y=document.getElementById('nam').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("Please enter your Name");
			document.getElementById('nam_lb').style.color="#FF0100"; 
			document.getElementById('nam').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('nam').value;
		if((p.length!=0))
		{
			document.getElementById('nam_lb').style.color="#8B8B8B"; 		
		}
///////////////////////////////////////////////////////////////

var y;
		y=document.getElementById('zipc').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert('Please enter zip code');
			document.getElementById('zipc_lb').style.color="#FF0100"; // b
			document.getElementById('zipc').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('zipc').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('zipc').value);
			if(isNaN(b))
		{
			alert('Number only, Please');
			document.getElementById('zipc_lb').style.color="#FF0100";// 
			document.getElementById('zipc').value="";
			document.getElementById('zipc').focus();
			return false;
			break;
		}
		else
			document.getElementById('zipc_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}
		
//////////////////////////////////////////////////////////////
		var y;

		y=document.getElementById('country').value;
		if(document.getElementById('country').value!="0")
		{	
									document.getElementById('country_lb').style.color="#8B8B8B"; 	// yrg3 eswed	

		}
		else
		{
	alert('Please select your Country');
			document.getElementById('country_lb').style.color="#FF0100";// b3d el error el lon yt3'yr  a7mr
			document.getElementById('country').focus();
			return false;
			break;
		}
		var p;
		p=document.getElementById('country').value;
		if((p.length!=0))
		{
			document.getElementById('country_lb').style.color="#8B8B8B"; 	
		}
////////////////////////////////////////////////////////////////////////////////////\

	var y;
		y=document.getElementById('univ').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("Please enter Institution or University");
			document.getElementById('univ_lb').style.color="#FF0100"; 
			document.getElementById('univ').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('univ').value;
		if((p.length!=0))
		{
			document.getElementById('univ_lb').style.color="#8B8B8B"; 		
		}
		
//////////////////////////////////////////////////////////////////////////////////
var y;
		y=document.getElementById('pho').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert('Please enter your Phone Number');
			document.getElementById('pho_lb').style.color="#FF0100"; // b
			document.getElementById('pho').focus();
			return false;
			break;
		}
		var p;
		p=document.getElementById('pho').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('pho').value);
			if(isNaN(b))
		{
			alert('Number only, Please');
			document.getElementById('pho_lb').style.color="#FF0100";// 
			document.getElementById('pho').value="";
			document.getElementById('pho').focus();
			return false;
			break;
		}
		else
			document.getElementById('pho_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}

///////////////////////////////////////////////////////////

	//////////////////////////////////////////////////////
			var p
		p=document.getElementById('fax').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('fax').value);
			if(isNaN(b))
		{
			alert('Fax -->  Number only, Please');
			document.getElementById('fax_lb').style.color="#FF0100";// 
			document.getElementById('fax').value="";
			document.getElementById('fax').focus();
			return false;
			break;
		}
		else
			document.getElementById('fax_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}
//////////////////////////////////////////////////////////////////		
		var y;
		y=document.getElementById('add1').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("Please enter your address");
			document.getElementById('add1_lb').style.color="#FF0100"; 
			document.getElementById('add1').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('add1').value;
		if((p.length!=0))
		{
			document.getElementById('add1_lb').style.color="#8B8B8B"; 		
		}
////////////////////////////////////////////////////////////////
		var y;
		y=document.getElementById('usnam').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("Please enter username");
			document.getElementById('usnam_lb').style.color="#FF0100"; 
			document.getElementById('usnam').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('usnam').value;
		if((p.length!=0))
		{
			document.getElementById('usnam_lb').style.color="#8B8B8B"; 		
		}
////////////////////////////////////////////////////////////////
var y;
		y=document.getElementById('emal').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("Please enter your E-Mail");
			document.getElementById('emal_lb').style.color="#DC0A15"; 
			document.getElementById('emal').focus();
			return false;
			break;
		}
	var p
	p=document.getElementById('emal').value;
		
var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
		if((p.length!=0)&&pattern.test(p))
		{
			document.getElementById('emal_lb').style.color="#003366"; 		
		}

else
		   {
			    alert('Please enter a valid E-Mail Address');
				document.getElementById('emal_lb').style.color="#DC0A15"; 
			    document.getElementById('emal').focus();
				return false;
				break;
    		}
			
					/////////////////////////////////////////////////////////////////////////////////////
					var invalid = " "; // Invalid character is a space
					var minLength = 6; // Minimum length
					var pw1 = document.forma.pasw.value;
					var pw2 = document.forma.pasw2.value;
					// check for a value in both fields.
					if (pw1 == '' || pw2 == '') 
								{
												alert('Please enter your password twice.');
								
												document.getElementById('pasw_lb').style.color="#FF0000"; 
												document.getElementById('pasw').focus();
												return false;
								}
					// check for minimum length
					if (document.forma.pasw.value.length < minLength)
								{
								alert('Your password must be at least ' + minLength + ' characters long. Try again.');
								document.getElementById('pasw').focus();
								return false;
								}
					// check for spaces
					if (document.forma.pasw.value.indexOf(invalid) > -1)
								{
										
									alert("Sorry, spaces are not allowed.");
									document.getElementById('pasw').focus();
									return false;
									}
					else 
					{
							if (pw1 != pw2)
								{
					
									   alert ("You did not enter the same new password twice. Please re-enter your password.");
										document.getElementById('pasw').value="";
										document.getElementById('pasw2').value="";
										document.getElementById('pasw').focus();
										return false;
									}
					}
										//////////////////////////////////////////////////////
	if (document.forma.sam.checked != true)
			{
		//	alert ('aaa');
			do {
					var y;
						y=document.getElementById('snam').value
						if((y.length==0) || (y.charAt(0)==' '))
						{
							alert("Please enter your Name");
							document.getElementById('snam_lb').style.color="#FF0100"; 
							document.getElementById('snam').focus();
							return false;
							break;
						}
						var p
						p=document.getElementById('snam').value;
						if((p.length!=0))
						{
							document.getElementById('snam_lb').style.color="#8B8B8B"; 		
						}
					////////////////////////////////////////////////////////		
					///////////////////////////////////////////////////////////////
					
					var y;
							y=document.getElementById('szipc').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert('Please enter zip code');
								document.getElementById('szipc_lb').style.color="#FF0100"; // b
								document.getElementById('szipc').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('szipc').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('szipc').value);
								if(isNaN(b))
							{
								alert('Number only, Please');
								document.getElementById('szipc_lb').style.color="#FF0100";// 
								document.getElementById('szipc').value="";
								document.getElementById('szipc').focus();
								return false;
								break;
							}
							else
								document.getElementById('szipc_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
							
												////////////////////////////////////////////////////////////////////////////////////\
					
						var y;
							y=document.getElementById('suniv').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("Please enter Institution or University");
								document.getElementById('suniv_lb').style.color="#FF0100"; 
								document.getElementById('suniv').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('suniv').value;
							if((p.length!=0))
							{
								document.getElementById('suniv_lb').style.color="#8B8B8B"; 		
							}
							

						
					//////////////////////////////////////////////////////////////
							var y;
					
							y=document.getElementById('scountry').value;
							if(document.getElementById('scountry').value!="0")
							{
														document.getElementById('scountry_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
					
							}
							else
							{
						alert('Please select your Country');
								document.getElementById('scountry_lb').style.color="#FF0100";// b3d el error el lon yt3'yr  a7mr
								document.getElementById('scountry').focus();
								return false;
								break;
							}
							var p;
							p=document.getElementById('scountry').value;
							if((p.length!=0))
							{
								document.getElementById('scountry_lb').style.color="#8B8B8B"; 	
							}
						
							
				var y;
							y=document.getElementById('sadd1').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("Please enter your address");
								document.getElementById('sadd1_lb').style.color="#FF0100"; 
								document.getElementById('sadd1').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('sadd1').value;
							if((p.length!=0))
							{
								document.getElementById('sadd1_lb').style.color="#8B8B8B"; 		
							}
					////////////////////////////////////////////////////////////////

		
		
		
		
		
							
						//////////////////////////////////////////////////////////////////////////////////
					var y;
							y=document.getElementById('spho').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert('Please enter your Phone Number');
								document.getElementById('spho_lb').style.color="#FF0100"; // b
								document.getElementById('spho').focus();
								return false;
								break;
							}
							var p;
							p=document.getElementById('spho').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('spho').value);
								if(isNaN(b))
							{
								alert('Number only, Please');
								document.getElementById('spho_lb').style.color="#FF0100";// 
								document.getElementById('spho').value="";
								document.getElementById('spho').focus();
								return false;
								break;
							}
							else
								document.getElementById('spho_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
							
	
						
							/////////////////////////////////////////////////////////
														var p;
							p=document.getElementById('spho2').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('spho2').value);
								if(isNaN(b))
							{
								alert('Number only, Please');
								document.getElementById('spho2_lb').style.color="#FF0100";// 
								document.getElementById('spho2').value="";
								document.getElementById('spho2').focus();
								return false;
								break;
							}
							else
								document.getElementById('spho2_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
								
													var y;
							y=document.getElementById('semal').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("Please enter your E-Mail");
								document.getElementById('semal_lb').style.color="#DC0A15"; 
								document.getElementById('semal').focus();
								return false;
								break;
							}
						var p
						p=document.getElementById('semal').value;
							
					var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
							if((p.length!=0)&&pattern.test(p))
							{
								document.getElementById('semal_lb').style.color="#003366"; 		
							}
					
					else
							   {
									alert('Please enter a valid E-Mail Address');
									document.getElementById('semal_lb').style.color="#DC0A15"; 
									document.getElementById('semal').focus();
									return false;
									break;
								}
								
					/////////////////////////////////////////////////////////////////////////////////////

					
						
						//////////////////////////////////////////////////////
								var p;
							p=document.getElementById('sfax').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('sfax').value);
								if(isNaN(b))
							{
								alert('Fax -->  Number only, Please');
								document.getElementById('sfax_lb').style.color="#FF0100";// 
								document.getElementById('sfax').value="";
								document.getElementById('sfax').focus();
								return false;
								break;
							}
							else
								document.getElementById('sfax_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
					//////////////////////////////////////////////////////////////////	
					
			} while(0)
		}

					
 

	
	
	
	
	
	
	
	
	
	
	
	}
	while(0)
}








function fn_ar()
{
do {

//alert('john');
	var y;
		y=document.getElementById('nam').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("من فضلك ادخل الاسم");
			document.getElementById('nam_lb').style.color="#FF0100"; 
			document.getElementById('nam').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('nam').value;
		if((p.length!=0))
		{
			document.getElementById('nam_lb').style.color="#8B8B8B"; 		
		}
///////////////////////////////////////////////////////////////

var y;
		y=document.getElementById('zipc').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert('من فضلك ادخل الرقم الكودي');
			document.getElementById('zipc_lb').style.color="#FF0100"; // b
			document.getElementById('zipc').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('zipc').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('zipc').value);
			if(isNaN(b))
		{
			alert('عفواً ، أرقام فقط');
			document.getElementById('zipc_lb').style.color="#FF0100";// 
			document.getElementById('zipc').value="";
			document.getElementById('zipc').focus();
			return false;
			break;
		}
		else
			document.getElementById('zipc_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}
		
//////////////////////////////////////////////////////////////
		var y;

		y=document.getElementById('country').value;
		if(document.getElementById('country').value!="0")
		{	
									document.getElementById('country_lb').style.color="#8B8B8B"; 	// yrg3 eswed	

		}
		else
		{
	alert('من فضلك ادخل المدينة');
			document.getElementById('country_lb').style.color="#FF0100";// b3d el error el lon yt3'yr  a7mr
			document.getElementById('country').focus();
			return false;
			break;
		}
		var p;
		p=document.getElementById('country').value;
		if((p.length!=0))
		{
			document.getElementById('country_lb').style.color="#8B8B8B"; 	
		}
////////////////////////////////////////////////////////////////////////////////////\

	var y;
		y=document.getElementById('univ').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("من فضلك ادخل المعهد او الجامعة");
			document.getElementById('univ_lb').style.color="#FF0100"; 
			document.getElementById('univ').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('univ').value;
		if((p.length!=0))
		{
			document.getElementById('univ_lb').style.color="#8B8B8B"; 		
		}
		
//////////////////////////////////////////////////////////////////////////////////
var y;
		y=document.getElementById('pho').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert('من فضلك ادخل رقم التليفون');
			document.getElementById('pho_lb').style.color="#FF0100"; // b
			document.getElementById('pho').focus();
			return false;
			break;
		}
		var p;
		p=document.getElementById('pho').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('pho').value);
			if(isNaN(b))
		{
			alert('عفواً ، أرقام فقط');
			document.getElementById('pho_lb').style.color="#FF0100";// 
			document.getElementById('pho').value="";
			document.getElementById('pho').focus();
			return false;
			break;
		}
		else
			document.getElementById('pho_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}

///////////////////////////////////////////////////////////

	//////////////////////////////////////////////////////
			var p
		p=document.getElementById('fax').value;
		if((p.length!=0))
		{
		b=parseInt(document.getElementById('fax').value);
			if(isNaN(b))
		{
			alert('عفواً ، أرقام فقط');
			document.getElementById('fax_lb').style.color="#FF0100";// 
			document.getElementById('fax').value="";
			document.getElementById('fax').focus();
			return false;
			break;
		}
		else
			document.getElementById('fax_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
		}
//////////////////////////////////////////////////////////////////		
		var y;
		y=document.getElementById('add1').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("من فضلك ادخل العنوان");
			document.getElementById('add1_lb').style.color="#FF0100"; 
			document.getElementById('add1').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('add1').value;
		if((p.length!=0))
		{
			document.getElementById('add1_lb').style.color="#8B8B8B"; 		
		}
////////////////////////////////////////////////////////////////
/*		var y;
		y=document.getElementById('usnam').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("من فضلك ادخل اسم المستخدم");
			document.getElementById('usnam_lb').style.color="#FF0100"; 
			document.getElementById('usnam').focus();
			return false;
			break;
		}
		var p
		p=document.getElementById('usnam').value;
		if((p.length!=0))
		{
			document.getElementById('usnam_lb').style.color="#8B8B8B"; 		
		}
		
		*/
		
		var pattern=/^([a-zA-Z-_.-])+$/;
var p=document.getElementById('usnam').value;
		


		if((p.length!=0)&&pattern.test(p))
		{
					document.getElementById('usnam_lb').style.color="#8B8B8B"; 			
		}
		
		else
		   {
			alert("من فضلك ادخل اسم المستخدم باللغة الانجليزية");
			document.getElementById('usnam_lb').style.color="#FF0100"; 
			document.getElementById('usnam').focus();

		document.getElementById('usnam').value = document.getElementById('usnam').value.replace(/[^A-z]/g,"");			
			return false;
			break;			   



    		}
		
		
		
////////////////////////////////////////////////////////////////
var y;
		y=document.getElementById('emal').value
		if((y.length==0) || (y.charAt(0)==' '))
		{
			alert("من فضلك ادخل البريد الالكتروني");
			document.getElementById('emal_lb').style.color="#DC0A15"; 
			document.getElementById('emal').focus();
			return false;
			break;
		}
	var p
	p=document.getElementById('emal').value;
		
var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
		if((p.length!=0)&&pattern.test(p))
		{
			document.getElementById('emal_lb').style.color="#003366"; 		
		}

else
		   {
			    alert('من فضلك ادخل البريد الالكتروني بطريقة صحيحة');
				document.getElementById('emal_lb').style.color="#DC0A15"; 
			    document.getElementById('emal').focus();
				return false;
				break;
    		}
			
					/////////////////////////////////////////////////////////////////////////////////////
					var invalid = " "; // Invalid character is a space
					var minLength = 6; // Minimum length
					var pw1 = document.forma.pasw.value;
					var pw2 = document.forma.pasw2.value;
					// check for a value in both fields.
					if (pw1 == '' || pw2 == '') 
								{
												alert('من فضلك ادخل كلمة المرور و تأكيده');
								
												document.getElementById('pasw_lb').style.color="#FF0000"; 
												document.getElementById('pasw').focus();
												return false;
								}
					// check for minimum length
					if (document.forma.pasw.value.length < minLength)
								{
								alert('عفواً، كلمة الر لا تقل عن ' + minLength + ' حرف.');
								document.getElementById('pasw').focus();
								return false;
								}
					// check for spaces
					if (document.forma.pasw.value.indexOf(invalid) > -1)
								{
										
									alert("عفواً ، غير مسموح بالمساحات");
									document.getElementById('pasw').focus();
									return false;
									}
					else 
					{
							if (pw1 != pw2)
								{
					
									   alert ("عفواً ، تأكيد كلمة السر غير صحيح");
										document.getElementById('pasw').value="";
										document.getElementById('pasw2').value="";
										document.getElementById('pasw').focus();
										return false;
									}
					}
										//////////////////////////////////////////////////////
	if (document.forma.sam.checked != true)
			{
		//	alert ('aaa');
			do {
					var y;
						y=document.getElementById('snam').value
						if((y.length==0) || (y.charAt(0)==' '))
						{
							alert("من فضلك ادخل الاسم");
							document.getElementById('snam_lb').style.color="#FF0100"; 
							document.getElementById('snam').focus();
							return false;
							break;
						}
						var p
						p=document.getElementById('snam').value;
						if((p.length!=0))
						{
							document.getElementById('snam_lb').style.color="#8B8B8B"; 		
						}
					////////////////////////////////////////////////////////		
					///////////////////////////////////////////////////////////////
					
					var y;
							y=document.getElementById('szipc').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert('من فضلك ادخل الرقم الكودي');
								document.getElementById('szipc_lb').style.color="#FF0100"; // b
								document.getElementById('szipc').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('szipc').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('szipc').value);
								if(isNaN(b))
							{
								alert('عفواً ، أرقام فقط');
								document.getElementById('szipc_lb').style.color="#FF0100";// 
								document.getElementById('szipc').value="";
								document.getElementById('szipc').focus();
								return false;
								break;
							}
							else
								document.getElementById('szipc_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
							
												////////////////////////////////////////////////////////////////////////////////////\
					
						var y;
							y=document.getElementById('suniv').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("من فضلك ادخل المعهد او الجامعة");
								document.getElementById('suniv_lb').style.color="#FF0100"; 
								document.getElementById('suniv').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('suniv').value;
							if((p.length!=0))
							{
								document.getElementById('suniv_lb').style.color="#8B8B8B"; 		
							}
							

						
					//////////////////////////////////////////////////////////////
							var y;
					
							y=document.getElementById('scountry').value;
							if(document.getElementById('scountry').value!="0")
							{
														document.getElementById('scountry_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
					
							}
							else
							{
						alert('من فضلك ادخل المدينة');
								document.getElementById('scountry_lb').style.color="#FF0100";// b3d el error el lon yt3'yr  a7mr
								document.getElementById('scountry').focus();
								return false;
								break;
							}
							var p;
							p=document.getElementById('scountry').value;
							if((p.length!=0))
							{
								document.getElementById('scountry_lb').style.color="#8B8B8B"; 	
							}
						
							
				var y;
							y=document.getElementById('sadd1').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("من فضلك ادخل العنوان");
								document.getElementById('sadd1_lb').style.color="#FF0100"; 
								document.getElementById('sadd1').focus();
								return false;
								break;
							}
							var p
							p=document.getElementById('sadd1').value;
							if((p.length!=0))
							{
								document.getElementById('sadd1_lb').style.color="#8B8B8B"; 		
							}
					////////////////////////////////////////////////////////////////

		
		
		
		
		
							
						//////////////////////////////////////////////////////////////////////////////////
					var y;
							y=document.getElementById('spho').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert('من فضلك ادخل رقم التليفون');
								document.getElementById('spho_lb').style.color="#FF0100"; // b
								document.getElementById('spho').focus();
								return false;
								break;
							}
							var p;
							p=document.getElementById('spho').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('spho').value);
								if(isNaN(b))
							{
								alert('عفواً ، أرقام فقط');
								document.getElementById('spho_lb').style.color="#FF0100";// 
								document.getElementById('spho').value="";
								document.getElementById('spho').focus();
								return false;
								break;
							}
							else
								document.getElementById('spho_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
							
	
						
							/////////////////////////////////////////////////////////
														var p;
							p=document.getElementById('spho2').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('spho2').value);
								if(isNaN(b))
							{
								alert('عفواً ، أرقام فقط');
								document.getElementById('spho2_lb').style.color="#FF0100";// 
								document.getElementById('spho2').value="";
								document.getElementById('spho2').focus();
								return false;
								break;
							}
							else
								document.getElementById('spho2_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
								
													var y;
							y=document.getElementById('semal').value
							if((y.length==0) || (y.charAt(0)==' '))
							{
								alert("من فضلك ادخل البريد الالكتروني");
								document.getElementById('semal_lb').style.color="#DC0A15"; 
								document.getElementById('semal').focus();
								return false;
								break;
							}
						var p
						p=document.getElementById('semal').value;
							
					var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
							if((p.length!=0)&&pattern.test(p))
							{
								document.getElementById('semal_lb').style.color="#003366"; 		
							}
					
					else
							   {
									alert('من فضلك ادخل البريد الالكتروني بطريقة صحيحة');
									document.getElementById('semal_lb').style.color="#DC0A15"; 
									document.getElementById('semal').focus();
									return false;
									break;
								}
								
					/////////////////////////////////////////////////////////////////////////////////////

					
						
						//////////////////////////////////////////////////////
								var p;
							p=document.getElementById('sfax').value;
							if((p.length!=0))
							{
							b=parseInt(document.getElementById('sfax').value);
								if(isNaN(b))
							{
								alert('عفواً ، أرقام فقط');
								document.getElementById('sfax_lb').style.color="#FF0100";// 
								document.getElementById('sfax').value="";
								document.getElementById('sfax').focus();
								return false;
								break;
							}
							else
								document.getElementById('sfax_lb').style.color="#8B8B8B"; 	// yrg3 eswed	
							}
					//////////////////////////////////////////////////////////////////	
					
			} while(0)
		}

					
 

	
	
	
	
	
	
	
	
	
	
	
	}
	while(0)
}
//////////////////
// register.php page to send password by e-mail to user.
/*
function fn()
{
do {


		}
//  if checked use the same user information if not do validation on the lower form		
		if (!forma.sam.checked){
			
			do {

				var x2;
				x2=forma.snam.value;
				if((x2.length==0) || (x2.charAt(0)==' '))
				{
					alert("Enter your name please.");
					forma.snam.value="";			
					forma.snam.focus();
					return false;
					break;
				}

				var z2;
				z2=forma.suniv.value;
				if((z2.length==0) || (z2.charAt(0)==' '))
				{
					alert("Enter your University name please.");
					forma.suniv.value="";
					forma.suniv.focus(); 	
					return false;
					break;
				}

				var c2;
				c2=forma.sadd1.value;
				if((c2.length==0) || (c2.charAt(0)==' '))
				{
					alert("Enter your address please.");
					forma.sadd1.value="";			
					forma.sadd1.focus();
					return false;
					break;
				}

				var r2;
				r2=forma.semal.value;
				if((r2.length==0) || (r2.charAt(0)==' '))
				{
					alert("Your e-mail address please.");
					forma.semal.value=''; 
					forma.semal.focus(); 
					return false;
					break;
				}

				   if (forma.semal.value.indexOf('@',0)==-1 ||
			       forma.semal.value.indexOf('@',0)== 0 ||
			       forma.semal.value.indexOf('.',0)==-1 ||
		   	       forma.semal.value.indexOf('.',0)== 0) 
				   {
					    alert("Invalid e-mail address.");
		//			    forma.emal.value="";
					    forma.semal.focus();
						return false;
						break;
		    		}
			
	
				var y2;
				y2=forma.szipc.value;
				if((y2.length==0) || (y2.charAt(0)==' '))
				{
					alert("Zip code please.");
					forma.szipc.value=""; 
					forma.szipc.focus(); 
					return false;
					break;
				}
		
					if(forma.scountry.value==0)
				{
					alert("Please select Shipping Country");
					forma.scountry.focus(); 
					return false;
					break;
				}

				var b2;
				b2=forma.spho.value;
				if((b2.length==0) || (b2.charAt(0)==' '))
				{
					alert("Please put your phone number.");
					forma.spho.value="";
					forma.spho.focus(); 
					return false;
					break;
				}		
					b2=parseInt(forma.spho.value);
					if(isNaN(b2))
				{
					alert("numbers only, please.");
					forma.spho.value="";
					forma.spho.focus();
					return false;
					break;
				}

					cc2=parseInt(forma.spho2.value);
					if(forma.spho2.value!=0 && isNaN(cc2))
				{
					alert("numbers only, please.");
					forma.spho2.value="";
					forma.spho2.focus();
					return false;
					break;
				}

					cc3=parseInt(forma.sfax.value);
					if(forma.sfax.value!=0 && isNaN(cc3))
				{
					alert("numbers only, please.");
					forma.sfax.value="";
					forma.sfax.focus();
					return false;
					break;
				}


			} while(0)		// end do loop
							
		}					// end if checked condition

							/*		else { alert("Checked");
									return false;
									}
							
	} while(0)
}

*/

// signin.php page to log User In.
function loginn()
{
do {

		var x;
		x=forma.usernam.value;
		if((x.length==0) || (x.charAt(0)==' '))
		{
			alert(errorMsg0);
			forma.usernam.value="";			
			forma.usernam.focus();
			return false;
			break;
		}

		var z;
		z=forma.passwrd.value;
		if((z.length==0) || (z.charAt(0)==' '))
		{
			alert(errorMsg1);
			forma.passwrd.value="";
			forma.passwrd.focus(); 	
			return false;
			break;
		}

	} while(0)
}

// signin.php page to send password by e-mail to user.
function sndpsw() {
		
	do
	{
		f=forma.usernam.value;
		if((f.length==0) || (f.charAt(0)==' '))
		{
			alert("Enter your username please");
			forma.usernam.value="";			
			forma.usernam.focus();
			return false;
		}
		else {
		moni=window.open('emailsend.php?usernam='+f+'','geo','width=300, height=100, status=0, scrollbars=0, left=200, top=100');
		moni.focus();
		}
	} while(0)
}

// admin.php page to send password by e-mail to admin.
function sndpsw2() {
		
	do
	{
		f=forma.usernam.value;
		if((f.length==0) || (f.charAt(0)==' '))
		{
			alert("Enter your username please");
			forma.usernam.value="";			
			forma.usernam.focus();
			return false;
		}
		else {
		moni=window.open('emailsend2.php?usernam='+f+'','geo','width=300, height=100, status=0, scrollbars=0, left=200, top=100');
		moni.focus();
		}
	} while(0)
}


function sendorder(){

		//alert('Thank you for placing an order with Leila Books.\n    An e-mail confirmation has been sent to you.\n             We will contact you very soon.');
		window.open='send.php';
		
}
// uploading file check
function uplod(){
	do {
		ff=formi.userfile.value;
		if((ff.length==0) || (ff.charAt(0)==' '))
		{
			alert(errorMsg2);
			formi.userfile.value="";			
			return false;
		}
	} while (0)
}
