/*									    \\\ /// 
										( @ @ ) 
/*===============================....o00o.(_).o00o...===============================*\
|| ################################################################################ ||
|| # 	       فكرة تقنية لتصميم وتطوير المواقع والاسكربتات الخاصة	 	          # ||
|| # --------------- هذا البرنامج من برمجة مبرمجي فكرة تقنية  ------------------  # ||
|| #    هذا الكود غير مسموح لك بالتعديل او التطوير علية الا بعد الموافقة على ذلك   # ||
|| #       من خلال فكرة تقنية ويمنع منعا باتا ازالة الحقوق البرمجية منة والا        # ||
|| #        ففكرة تقنية غير مسئولة عن الاضرار التى ستنتج عن ذلك مستقبلا 	          # ||
|| #		          جميع الحقوق محفوظة لفكرة تقنية 2009-2010                    # ||
|| # -------------  هذا البرنامج ليس مجاني | للاتصال بالدعم الفني ---------------- # ||
|| # 			      http://www.ti4it.com  | support@ti4it.com 		          # ||
|| ################################################################################ ||
\*==================================================================================*/
/*==================================================================================*\
|| ################################################################################ ||
|| # 			   Tecno Idea For Disigning & Developing WebSites		          # ||
|| # ------------------ Programming by  Tecno Idea Developers ------------------- # ||
|| #      This code is not Allowed you amendment or Development only after the    # ||
|| #	  approval from Tecno Idea and strictly prohibited the removal of         # ||
|| #      the rights to programming either Tecno Idea is not responsible          # ||
|| #	  for any damages will happen in the future                               # ||
|| #             All Copy rights Reserved To Tecno Idea 2009-2010                 # ||
|| # ---------- THIS IS NOT FREE SOFTWARE  | To Contact Support ----------------- # ||
|| # 			      http://www.ti4it.com  | support@ti4it.com 		          # ||
|| ################################################################################ ||
\*==================================================================================*/
function astm_expandIt(url,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 = url+'/images/plus.gif';
tpic.title="افتح";
} else {
tdiv.style.display = '';
tpic.src = url+'/images/min.gif';
tpic.title="اقفل";
}
}

function astm_contact_menu(url,kind,astmid){
if(kind=="0"){
for(i=1;i<=astmid;i++){
document.getElementById('menu'+i).style.display = '';
document.getElementById('astmmenu'+i).src= url+'/images/min.gif';
}
}else{
for(i=1;i<=astmid;i++){
document.getElementById('menu'+i).style.display = 'none';
document.getElementById('astmmenu'+i).src= url+'/images/plus.gif';
}
}
}

<!--------------------------------------------------------------------->
function ListFind(list,value){
  var i = 0;
  var delimiter = ',';
  var returnValue = -1;
  var _tempArray = new Array();
  if(ListFind.arguments.length == 3)
    delimiter = ListFind.arguments[2];
  _tempArray = list.split(delimiter);
  for(i = 0; i < _tempArray.length; i++)
  {
    if(_tempArray[i] == value)
    {
      returnValue = i;
      break;
    }
  }
  return returnValue;
}

function ListFindNoCase(list, value){
  var i = 0;
  var delimiter = ',';
  var returnValue = -1;
  var _tempArray = new Array();
  if(ListFindNoCase.arguments.length == 3)
    delimiter = ListFindNoCase.arguments[2].toLowerCase();
  list = list.toLowerCase();
  value = value.toLowerCase();
  _tempArray = list.split(delimiter);
  for(i = 0; i < _tempArray.length; i++)
  {
    if(_tempArray[i] == value)
    {
      returnValue = i;
      break;
    }
  }
  return returnValue;
}


function ListLast(list){
  var delimiter = ',';
  var returnValue = '';
  var _tempArray = new Array();
  if(ListLast.arguments.length == 2) delimiter = ListLast.arguments[1].toLowerCase();
  _tempArray = list.split(delimiter);
  if(_tempArray.length)
    returnValue = _tempArray[_tempArray.length - 1];
  else
    returnValue = list;
  return returnValue;
}

function astm_upload_pic(){
if(ListFind('gif,jpg,jpeg,bmp,png,GIF,JPG,JPEG,BMP,PNG', ListLast(astm_form.filepic.value, '.')) == -1){
alert('مسموح فقط بالامتدادت التالية  \n GIF,JPG,JPEG,BMP,PNG');
document.getElementById("filepic").outerHTML = "<input type='file' name='filepic' id='filepic'  onChange='return astm_upload_pic()' class='field' style='text-align:center; width:250'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}


function astm_upload_pic_1(){
if(ListFind('gif,jpg,jpeg,bmp,png,GIF,JPG,JPEG,BMP,PNG', ListLast(astmform.filepic_1.value, '.')) == -1){
alert('مسموح فقط بالامتدادت التالية  \n GIF,JPG,JPEG,BMP,PNG');
document.getElementById("filepic_1").outerHTML = "<input type='file' name='filepic_1' id='filepic_1'  onChange='return astm_upload_pic_1()' class='field' style='text-align:left; width:180'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}
function astm_upload_pic_2(){
if(ListFind('gif,jpg,jpeg,bmp,png,GIF,JPG,JPEG,BMP,PNG', ListLast(astmform.filepic_2.value, '.')) == -1){
alert('مسموح فقط بالامتدادت التالية  \n GIF,JPG,JPEG,BMP,PNG');
document.getElementById("filepic_2").outerHTML = "<input type='file' name='filepic_2' id='filepic_2'  onChange='return astm_upload_pic_2()' class='field' style='text-align:left; width:180'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}
function astm_upload_pic_3(){
if(ListFind('gif,jpg,jpeg,bmp,png,GIF,JPG,JPEG,BMP,PNG', ListLast(astmform.filepic_3.value, '.')) == -1){
alert('مسموح فقط بالامتدادت التالية  \n GIF,JPG,JPEG,BMP,PNG');
document.getElementById("filepic_3").outerHTML = "<input type='file' name='filepic_3' id='filepic_3'  onChange='return astm_upload_pic_3()' class='field' style='text-align:left; width:180'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}
function astm_upload_pic_4(){
if(ListFind('gif,jpg,jpeg,bmp,png,GIF,JPG,JPEG,BMP,PNG', ListLast(astmform.filepic_4.value, '.')) == -1){
alert('مسموح فقط بالامتدادت التالية  \n GIF,JPG,JPEG,BMP,PNG');
document.getElementById("filepic_4").outerHTML = "<input type='file' name='filepic_4' id='filepic_4'  onChange='return astm_upload_pic_4()' class='field' style='text-align:left; width:180'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}

<!--------------------------->
function clearf(object,text){ if(object.value == text){object.value = ""; object.focus();}} 
function setf(object,text){ if(object.value == ""){object.value = text; this.focus(); }}
<!--------------------------->
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function astm_Fav(x,y){
window.external.AddFavorite(x, y);
}

function astm_div_log(x){
if(x==1){
document.getElementById('show_form').style.display='';
document.getElementById('show_txt').style.display='none';
return false
}else{
document.getElementById('show_form').style.display='none';
document.getElementById('show_txt').style.display='';
return false
}
}

function astm_Tab(x){
document.getElementById('Tab_'+x).style.display='';
if(x>5){
for(i=6;i<=8;i++){
if(i!==x){
document.getElementById('Tab_'+i).style.display='none';	
}
}	
}else{
for(i=1;i<=5;i++){
if(i!==x){
document.getElementById('Tab_'+i).style.display='none';	
}
}		
}
}

function astm_DivId(x,y){
if(x=='1'){
document.getElementById(y).style.display='';
return false
}else{
document.getElementById(y).style.display='none';
return false
}
}

function AstmAlert(){
alert('يجب عليك تسجيل الدخول اولا');
}

function astm_log(){
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 astm_MailList(){
if ( (document.FormMailList.Mailbox_Name.value=="" || document.FormMailList.Mailbox_Name.value=="الاسم")){
alert("من فضلك اكتب اسمك")
document.FormMailList.Mailbox_Name.focus()
return false
}
if ( (document.FormMailList.Mailbox_Email.value=="" || document.FormMailList.Mailbox_Email.value=="البريد الالكتروني") && (document.FormMailList.Mailbox_Mobile.value=="" || document.FormMailList.Mailbox_Mobile.value=="رقم الجوال") ){
alert("من فضلك اكتب البريد الالكتروني او رقم الجوال")
document.FormMailList.Mailbox_Mobile.focus()
return false
}
if(document.FormMailList.Mailbox_Mobile.value!=="" && document.FormMailList.Mailbox_Mobile.value!=="رقم الجوال" && isNaN(document.FormMailList.Mailbox_Mobile.value)){
alert("من فضلك أدخل رقم الجوال ارقام")
document.FormMailList.Mailbox_Mobile.focus();
return false;
}
if(document.FormMailList.Mailbox_Email.value!=="" && document.FormMailList.Mailbox_Email.value!=="البريد الالكترونى"){
str = document.FormMailList.Mailbox_Email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك أدخل البريد الالكتروني بشكل صحيح');
document.FormMailList.Mailbox_Email.focus();
return false;
}
}
}

function astm_Register(){
if (document.formRegister.name.value==""){
alert("من فضلك أدخل اسم المتجر")
document.formRegister.name.focus()
return false
}
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.pass.value!==document.formRegister.pass2.value){
alert("من فضلك تأكد من ان كلمة السر متساوية مع تاكيد كلمة السر")
document.formRegister.pass2.focus()
return false
}
str = document.formRegister.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك أدخل بريدك الالكتروني الصحيح');
document.formRegister.email.focus();
return false;
}
if (document.formRegister.email.value!==document.formRegister.email2.value){
alert("من فضلك تأكد من ان البريد الالكتروني متساوى مع تأكيد البريد الالكترونى")
document.formRegister.email2.focus()
return false
}

if(document.formRegister.mobile.value!==""){
if(isNaN(document.formRegister.mobile.value)){
alert("من فضلك اكتب رقم الجوال ارقام")
document.formRegister.mobile.focus()
return false
}
if(document.formRegister.mobile.value.length<="9"){
alert("من فضلك أدخل رقم الجوال الصحيح")
document.formRegister.mobile.focus()
return false
}
}

if(document.formRegister.Agree_check.checked==""){
alert("من فضلك اختار الموافقة على اتفاقية الاستخدام")
document.formRegister.Agree_check.focus()
return false
}
if (document.formRegister.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.formRegister.register_cod.focus()
return false
}
}

function astm_Profile(){
if (document.astm_form.name.value==""){
alert("من فضلك أدخل اسم المتجر")
document.astm_form.name.focus()
return false
}
if (document.astm_form.user.value==""){
alert("من فضلك أدخل اسم المستخدم")
document.astm_form.user.focus()
return false
}
if (document.astm_form.pass.value==""){
alert("من فضلك أدخل كلمة السر")
document.astm_form.pass.focus()
return false
}
if (document.astm_form.pass.value!==document.astm_form.pass2.value){
alert("من فضلك تأكد من ان كلمة السر متساوية مع تاكيد كلمة السر")
document.astm_form.pass2.focus()
return false
}
str = document.astm_form.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك أدخل بريدك الالكتروني الصحيح');
document.astm_form.email.focus();
return false;
}
if (document.astm_form.email.value!==document.astm_form.email2.value){
alert("من فضلك تأكد من ان البريد الالكتروني متساوى مع تأكيد البريد الالكترونى")
document.astm_form.email2.focus()
return false
}

if(document.astm_form.mobile.value!==""){
if(isNaN(document.astm_form.mobile.value)){
alert("من فضلك اكتب رقم الجوال ارقام")
document.astm_form.mobile.focus()
return false
}
if(document.astm_form.mobile.value.length<="9"){
alert("من فضلك أدخل رقم الجوال الصحيح")
document.astm_form.mobile.focus()
return false
}
}

if (document.astm_form.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.astm_form.register_cod.focus()
return false
}
}


function astm_forget(){
str = document.formforget.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك أدخل البريد الالكتروني بشكل صحيح');
document.formforget.email.focus();
return false;
}
}

function astm_adv(){
if(document.astm_form.name.value==""){
alert(' من فضلك أدخل اسم الاعلان');
document.astm_form.name.focus();
return false;
}
if(document.astm_form.Sec.value==""){
alert(' من فضلك اختار القسم');
document.astm_form.Sec.focus();
return false;
}
if(document.astm_form.Country.value==""){
alert(' من فضلك اختار الدولة');
document.astm_form.Country.focus();
return false;
}
var radio_choice = false;
for (counter = 0; counter < document.astm_form.Kind.length; counter++){
if (document.astm_form.Kind[counter].checked)
radio_choice = true; 
}
if (!radio_choice){
alert('من فضلك اختار نوع العرض للاعلان');
return (false);
}
if(document.astm_form.note.value==""){
alert(' من فضلك اكتب تفاصيل الاعلان');
document.astm_form.note.focus();
return false;
}
if(document.astm_form.price.value=="" || isNaN(document.astm_form.price.value)){
alert(' من فضلك اكتب السعر ارقام');
document.astm_form.price.focus();
return false;
}
if (document.astm_form.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.astm_form.register_cod.focus()
return false
}
}

function astm_gallery(){
if (document.astmform.filepic_1.value!=="" && document.astmform.note_1.value==""){
alert("من فضلك اكتب تعليق");
document.astmform.note_1.focus()
return false
}
if (document.astmform.filepic_1.value=="" && document.astmform.note_1.value!==""){
alert("من فضلك اختار الصورة اولا حتى نتمكن من اضافة التعليق لها");
document.astmform.filepic_1.focus()
return false
}

if (document.astmform.filepic_2.value!=="" && document.astmform.note_2.value==""){
alert("من فضلك اكتب تعليق");
document.astmform.note_2.focus()
return false
}
if (document.astmform.filepic_2.value=="" && document.astmform.note_2.value!==""){
alert("من فضلك اختار الصورة اولا حتى نتمكن من اضافة التعليق لها");
document.astmform.filepic_2.focus()
return false
}

if (document.astmform.filepic_3.value!=="" && document.astmform.note_3.value==""){
alert("من فضلك اكتب تعليق");
document.astmform.note_3.focus()
return false
}
if (document.astmform.filepic_3.value=="" && document.astmform.note_3.value!==""){
alert("من فضلك اختار الصورة اولا حتى نتمكن من اضافة التعليق لها");
document.astmform.filepic_3.focus()
return false
}

if (document.astmform.filepic_4.value!=="" && document.astmform.note_4.value==""){
alert("من فضلك اكتب تعليق");
document.astmform.note_4.focus()
return false
}
if (document.astmform.filepic_4.value=="" && document.astmform.note_4.value!==""){
alert("من فضلك اختار الصورة اولا حتى نتمكن من اضافة التعليق لها");
document.astmform.filepic_4.focus()
return false
}
}

function astmComment(){
if (document.addComment.comment.value==""){
alert("من فضلك اكتب الرد")
document.addComment.comment.focus()
return false
}
if (document.addComment.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.addComment.register_cod.focus()
return false
}
}

function astmEmail(){
if (document.SendEmail.EmailTxt.value==""){
alert("من فضلك اكتب نص الرسالة")
document.SendEmail.EmailTxt.focus()
return false
}
if (document.SendEmail.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.SendEmail.register_cod.focus()
return false
}
}

function astm_Ser(){
if (document.FormSer.Ser.value=="" || document.FormSer.Ser.value=="مفردات البحث"){
alert("من فضلك اكتب مفردات البحث")
document.FormSer.Ser.focus()
return false
}
}


function astm_contact(){
if (document.formContact.name.value==""){
alert("من فضلك اكتب اسمك")
document.formContact.name.focus()
return false
}
if (document.formContact.country.value==""){
alert("من فضلك اختار الدولة")
document.formContact.country.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.mobile.value!=""){
if(isNaN(document.formContact.mobile.value)){
alert("من فضلك اكتب رقم الجوال ارقام")
document.formContact.mobile.focus()
return false
}
if(document.formContact.mobile.value.length <= "10"){
alert("من فضلك أدخل رقم الجوال الصحيح")
document.formContact.mobile.focus()
return false
}
}
if (document.formContact.msg.value==""){
alert("من فضلك اكتب نص الرسالة")
document.formContact.msg.focus()
return false
}
if (document.formContact.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.formContact.register_cod.focus()
return false
}
}
