	//-----------------------in design.TPL.htm
	function validation(){
			if (document.form26.domain_name.value==''){
				alert('أدخل اسم النطاق');
				document.form26.domain_name.focus();
				return false;
			}
			
		   TheValue = document.form26.domain_name.value;
		   TheLength = TheValue.length;
		
		   for (i = 0; i <= TheLength-1; i++) {
				  if (TheValue.charAt(i) == '!' || TheValue.charAt(i) == '@' || TheValue.charAt(i)=='#' || TheValue.charAt(i)=='$'
						  || TheValue.charAt(i)=='%' || TheValue.charAt(i)=='^' || TheValue.charAt(i)=='&' || TheValue.charAt(i)=='*' || TheValue.charAt(i)=='('
						  || TheValue.charAt(i)==')' || TheValue.charAt(i)=='_' || TheValue.charAt(i)=='+' || TheValue.charAt(i)=='=' || TheValue.charAt(i)=='?' 
						  || TheValue.charAt(i)=='>' || TheValue.charAt(i)=='<' || TheValue.charAt(i)==',' || TheValue.charAt(i)=='.' || TheValue.charAt(i)=='/'){
							alert("اسم النطاق يمكن أن يحتوي على أحرف و أرقام و الرمز - فقط ");
							document.form26.domain_name.focus();
							return false
		          }
		   }
	}
	//----------------form in domain_form.TPL.htm
	function validation2(){
			if (document.form1.domain_name.value==''){
				alert('أدخل اسم النطاق');
				document.form1.domain_name.focus();
				return false;
			}
			
		   TheValue = document.form1.domain_name.value;
		   TheLength = TheValue.length;
		
		   for (i = 0; i <= TheLength-1; i++) {
				  if (TheValue.charAt(i) == '!' || TheValue.charAt(i) == '@' || TheValue.charAt(i)=='#' || TheValue.charAt(i)=='$'
						  || TheValue.charAt(i)=='%' || TheValue.charAt(i)=='^' || TheValue.charAt(i)=='&' || TheValue.charAt(i)=='*' || TheValue.charAt(i)=='('
						  || TheValue.charAt(i)==')' || TheValue.charAt(i)=='_' || TheValue.charAt(i)=='+' || TheValue.charAt(i)=='=' || TheValue.charAt(i)=='?' 
						  || TheValue.charAt(i)=='>' || TheValue.charAt(i)=='<' || TheValue.charAt(i)==',' || TheValue.charAt(i)=='.' || TheValue.charAt(i)=='/'){
							alert("اسم النطاق يمكن أن يحتوي على أحرف و أرقام و الرمز - فقط ");
							document.form1.domain_name.focus();
							return false
		          }
		   }
	}
	
	//-------------------log_in.tpl.htm
	function validation3(){
			if (document.form3.username.value==''){
				alert('أدخل اسم المستخدم');
				document.form3.username.focus();
				return false;
			}
			if (document.form3.password.value==''){
				alert('أدخل كلمة السر');
				document.form3.password.focus();
				return false;
			}
			if (document.form3.password.value.length<6){
				alert('كلمة السر لا يمكن أن تكون أقل من 6 أحرف');
				return false;
			}
	}		

	function validation4(){
			if (document.form2.domains.value==''){
				alert('أدخل أسماء النطاقات التي ترغب بفحص إمكانية حجزها');
				document.form2.domains.focus();
				return false;
			}
	}
	function validation5(){
			if (document.form1.old_password.value==''){
				alert('أدخل كلمة السر القديمة');
				document.form1.old_password.focus();
				return false;
			}
			if (document.form1.new_password.value==''){
				alert(' أدخل كلمة السر الجديدة');
				document.form1.new_password.focus();
				return false;
			}
			if (document.form1.confirm.value==''){
				alert('أدخل تأكيد كلمة السر');
				document.form1.confirm.focus();
				return false;
			}
			if (document.form1.new_password.value.length<6 || document.form1.confirm.value.length<6 || document.form1.old_password.value.length<6){
				alert('كلمة السر لا يمكن أن تكون أقل من 6 أحرف');
				return false;
			}
			if (document.form1.confirm.value!=document.form1.new_password.value){
				alert('تأكد من كلمة السر');
				return false;
			}
	}		
	function hide_show(tag_id){
			if(tag_id.style.display=="block"){
					tag_id.style.display='none';
					if(tag_id==dns){
							document.dns_img.src='images/2.gif';
					}
					//if(tag_id==url){
							//document.url_img.src='images/2.gif';
					//}
					if(tag_id==email_table){
							document.email_img.src='images/2.gif';
					}
					if(tag_id==whois){
							document.whois_img.src='images/2.gif';
					}
			}
			else{
					tag_id.style.display='block';
					if(tag_id==dns){
							document.dns_img.src='images/3.gif';
					}
					///if(tag_id==url){
							//document.url_img.src='images/3.gif';
					///}
					if(tag_id==email_table){
							document.email_img.src='images/3.gif';
					}
					if(tag_id==whois){
							document.whois_img.src='images/3.gif';
					}
			}
	}
//======================================================================
	function host2_tpl_htm(){
			if(document.host_form.own[0].checked==true){
				if(document.host_form.res_domain_name.value==''){
					alert('اختر أحد النطاقات من القائمة');
					return false;
				}	
			}
			else if(document.host_form.own[1].checked==true){
					if(document.host_form.cust_domain_name.value==''){
							alert('الرجاء إدخال اسم النطاق');
							return false;
					}	
					else{
						   TheValue = document.host_form.cust_domain_name.value;
						   TheLength = TheValue.length;
						   for (i = 0; i <= TheLength-1; i++) {
								  if (TheValue.charAt(i) == '!' || TheValue.charAt(i) == '@' || TheValue.charAt(i)=='#' || TheValue.charAt(i)=='$'
										  || TheValue.charAt(i)=='%' || TheValue.charAt(i)=='^' || TheValue.charAt(i)=='&' || TheValue.charAt(i)=='*' || TheValue.charAt(i)=='('
										  || TheValue.charAt(i)==')' || TheValue.charAt(i)=='_' || TheValue.charAt(i)=='+' || TheValue.charAt(i)=='=' || TheValue.charAt(i)=='?' 
										  || TheValue.charAt(i)=='>' || TheValue.charAt(i)=='<' || TheValue.charAt(i)==',' || TheValue.charAt(i)=='/'){
											alert("اسم النطاق يمكن أن يحتوي على أحرف و أرقام و الرمز - فقط");
											document.host_form.cust_domain_name.focus();
											return false
								  }
						   }
					}
			}
			else{
					alert('الرجاء إدخال اسم النطاق أو اختر أحد نطاقاتك المحجوزة');
					return false;
			}
			if(document.host_form.username.value==''){
					alert('الرجاء إدخال اسم مستخدم');
					document.host_form.username.focus();
					return false;
			}
	}
//===============================================res_domain.TPL.htm
	function CheckAll()
	{
	var intmax = 0;
	
	intmax = document.checkdomain.elements.length-1;
	
	for(var j = 0; j <= intmax;j++)
	 {
		if(document.checkdomain[j].type=="checkbox")
		{
		  if(document.checkdomain[j].checked!=true)
			 {
			  document.checkdomain[j].checked=true;
			 }
		  else if (document.checkdomain[j].checked==true)
			{
			 document.checkdomain[j].checked=false;
			}
		}
	 }
	
	}
//=======================================================activate
	function valid_activate(){
			if (document.form1.username.value==''){
				alert('أدخل اسم المستخدم');
				document.form1.username.focus();
				return false;
			}
			
			if (document.form1.activation_number.value==''){
				alert('أدخل رقم تفعيل حسابك');
				document.form1.activation_number.focus();
				return false;
			}
	}
//=========================================================
	function host3_tpl_htm(){
			if (document.host3_form.domain_name.value==''){
				alert('الرجاء إدخال اسم النطاق');
				document.host3_form.domain_name.focus();
				return false;
			}
			if (document.host3_form.username.value==''){
				alert('الرجاء إدخال اسم مستخدم لوحة التحكم');
				document.host3_form.username.focus();
				return false;
			}
	}
//============================================support form support.TPL.htm page
	function support(){
			if (document.support_form.name.value==''){
				alert('الرجاء إدخال الاسم الكامل');
				document.support_form.name.focus();
				return false;
			}
			if (document.support_form.email.value==''){
				alert('تأكد من إدخال عنوان بريدك الالكتروني بشكل صحيح');
				document.support_form.email.focus();
				return false;
			}
			if (document.support_form.question.value==''){
				alert('الرجاء إدخال نص الاستفسار');
				document.support_form.question.focus();
				return false;
			}
			if (document.support_form.title.value==''){
				alert('الرجاء إدخال موضوع الاستفسار');
				document.support_form.title.focus();
				return false;
			}
	}
//==========================================  add question about same subject
	function other_question(){
			if (document.support2.question2.value==''){
				alert('الرجاء إدخال نص الاستفسار');
				document.support2.question2.focus();
				return false;
			}
	}
//==========================================   email validation in mailing list
	eml_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	function emailCheck(thisForm) {
			if (eml_val.test(thisForm)) {
			return true
			}
			alert("تأكد من إدخال عنوان بريدك الاكتروني بشكل صحيح ...")
			//thisForm.emailAddr.focus()
			//thisForm.emailAddr.select()
			return false
	}
	//======================================== calculate points
	function calc(){
			if(document.calcForm.type.value!='ch'){  
					//var value=(document.calcForm.points.value)/(document.calcForm.type.value);
					var value=roundit((document.calcForm.points.value)/(document.calcForm.type.value),2);
					if(navigator.appName=='Microsoft Internet Explorer'){
							document.getElementById("calced").innerText=value;
					}
					else{
							document.getElementById("calced").textContent=value;
					}
					Index = document.calcForm.type.selectedIndex;
					if(navigator.appName=='Microsoft Internet Explorer'){
							poi.innerText=document.calcForm.points.value+' نقطة '+' تعادل :';
							type.innerText=document.calcForm.type[Index].text;
					}
					else{
							document.getElementById("poi").textContent=document.calcForm.points.value+' نقطة '+' تعادل :';
							document.getElementById("type").textContent='   '+document.calcForm.type[Index].text;
					}
			}
	}
	//==========================================  points new window
	function points_window(points_amount){
			open('points.php?amount='+points_amount, "","toolbar=no,scrollbars=yes,height=550,width=300,location=no,directories=no,status=no,menubar=no,screenX=300,screenY=150")
	}
	
	//=========================================  rounding
	function roundit(Num, Places) {
	   if (Places > 0) {
		  if ((Num.toString().length - Num.toString().lastIndexOf('.')) > (Places + 1)) {
			 var Rounder = Math.pow(10, Places);
			 return Math.round(Num * Rounder) / Rounder;
		  }
		  else return Num;
	   }
	   else return Math.round(Num);
	}
