/*==================================================================================*\
|| ################################################################################ ||
|| # 			 Elbayt NetWork For Disigning & Developing WebSites				  #	|| 
|| # ---------------------------------------------------------------------------- # ||
|| # All PHP code in this file is ©2005-2006 written by Elbayt NetWork developers.# ||
|| # This file may not be redistributed in whole or significant part.			  # ||
|| # ------------------------ THIS IS NOT FREE SOFTWARE ------------------------- # ||
|| # 				 http://www.elbayt.net | astm_desig@hotmail.com 			  # ||
|| ################################################################################ ||
\*==================================================================================*/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function astm_expandIt(astm_id){
    var tdiv = document.getElementById(astm_id);
    var tpic = document.getElementById('astm'+astm_id);
    if (tdiv.style.display == '') {
        tdiv.style.display = 'none';
        tpic.src = 'images/ico_plus.gif';
		tpic.title="افتح";
    } else {
        tdiv.style.display = '';
        tpic.src = 'images/ico_minus.gif';
		tpic.title="اقفل";
    }
}

function EC(TheTR,img)
{
var DataTR = eval('document.all.' + TheTR);
if (DataTR.style.display=="block" || DataTR.style.display=="" )
{
DataTR.style.display="none";
}
else
{
DataTR.style.display="block";
}
}


function astm_login(){
if(document.formlog.User.value=="" || document.formlog.User.value=="اسم المستخدم"){
	alert('من فضلك اكتب اسم المستخدم');
	document.formlog.User.focus();
	return false;
	}	

if(document.formlog.Pass.value=="" || document.formlog.Pass.value=="كلمة السر"){
	alert('من فضلك اكتب كلمة السر');
	document.formlog.Pass.focus();
	return false;
	}	

}

function Checkuser()
{
var astm_user;
if (formregister.user.value == "")
 {
alert("من فضلك اكتب اسم المستخدم");
formregister.user.focus();
return (false);
 }
astm_user=formregister.user.value
open("check.php?astm_user="+astm_user+"","windowopen","toolbar=0,location=0,width=290,height=110,status=1");
}

function astm_register()
{
if (document.formregister.user.value=="")
{
alert("من فضلك اكتب اسم المستخدم")
document.formregister.user.focus()
return false
}

if (document.formregister.pass.value=="")
{
alert("من فضلك اكتب كلمة السر")
document.formregister.pass.focus()
return false
}

if(document.formregister.pass2.value !== document.formregister.pass.value){
alert('من فضلك تأكد من ان كلمة السر متطابقة مع تأكيد كلمة السر ');
document.formregister.pass2.focus();
return false;
}

if(document.formregister.name.value==""){
alert('من فضلك الاسم الثلاثى كاملا');
document.formregister.name.focus();
return false;
}

str = document.formregister.e_mail.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1)
{
alert ('من فضلك ادخل البريد الالكتروني بشكل صحيح');
document.formregister.e_mail.focus();
return false;
}

if(document.formregister.e_mail2.value !== document.formregister.e_mail.value){
alert('من فضلك تأكد من ان البريد الالكتروني متطابق مع تأكيد البريد الالكتروني');
document.formregister.e_mail2.focus();
return false;
}


if(document.formregister.country.value==""){
alert('من فضلك اختار الدولة');
document.formregister.country.focus();
return false;
}

}

function astm_forgetpass(){
if(document.forgetpass.email.value==""){
alert('من فضلك ادخل البريد الالكتروني المسجل بحسابك لدينا');
document.forgetpass.email.focus();
return false;
}
}

function astm_contactus(){
if(document.formcontact.name.value==""){
alert('من فضلك ادخل اسمك');
document.formcontact.name.focus();
return false;
}

str = document.formcontact.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1)
{
alert ('من فضلك ادخل البريد الالكتروني بشكل صحيح');
document.formcontact.email.focus();
return false;
}



if(document.formcontact.address.value==""){
alert('من فضلك اكتب العنوان ');
document.formcontact.address.focus();
return false;
}

if(document.formcontact.tell.value!==""){
	if(isNaN(document.formcontact.tell.value)){
alert('من فضلك اكتب رقم الهاتف ارقام');
document.formcontact.tell.focus();
return false;
	}
}

if(document.formcontact.fax.value!==""){
	if(isNaN(document.formcontact.fax.value)){
alert('من فضلك اكتب رقم الفاكس ارقام');
document.formcontact.fax.focus();
return false;
	}
}

if(document.formcontact.msg.value==""){
alert('من فضلك اكتب نص الرسالة');
document.formcontact.msg.focus();
return false;
}

}



function astm_SER(){
if(document.formser.SER.value=="" || document.formser.SER.value=="كلمات البحث"){
	alert('من فضلك اكتب مفردات البحث');
	document.formser.SER.focus();
	return false;
	}	
}

function astm_voit (x) 
{
	if(x==1)
	{
	 document.getElementById('show_vote').style.display='block';
	 document.getElementById('show_result').style.display='none';
	 return false
	}else{
	 document.getElementById('show_vote').style.display='none';
	 document.getElementById('show_result').style.display='block';
	 return false
	}
}

function astm_print()
{
	window.print();
} 


function astm_tellfriend(){
if(document.formtell.email.value==""){
	alert('من فضلك ادخل ايميل صديقك');
	document.formtell.email.focus();
	return false;
	}	
}

