/*
					 _____ _   ___ _ _____                      
					|_   _(_) /   (_)_   _|                     
					  | |  _ / /| |_  | |   ___  ___  _ __ ___  
					  | | | / /_| | | | |  / __|/ _ \| '_ ` _ \ 
					  | | | \___  | | | |_| (__| (_) | | | | | |
					  \_/ |_|   |_/_| \_(_)\___|\___/|_| |_| |_|
					  
										\\\ /// 
										( @ @ ) 
/*===============================....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 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 lightup(imageobject, opacity){
if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5)
imageobject.style.MozOpacity=opacity/100
else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4)
imageobject.filters.alpha.opacity=opacity
}

function astmCopy(myprefix){
Copied = eval ('document.astm_copy.' + myprefix + '.createTextRange();');
Copied.execCommand("Copy");
eval ('document.astm_copy.' + myprefix + '.select();');
alert('تم نسخ الرابط بنجاح');
}

function IMgSwap(ID,pic){
document.getElementById(ID).src=pic;
}

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:right; width:250'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
return false;
}
}

function astm_fet(x){
if(x==1){
document.getElementById('astm_fet_1').style.display='';
document.getElementById('astm_fet_2').style.display='none';
document.getElementById('astm_fet_3').style.display='none';
document.getElementById('astm_fet_4').style.display='none';
document.getElementById('astm_fet_5').style.display='none';
return false
}else if(x==2){
document.getElementById('astm_fet_1').style.display='none';
document.getElementById('astm_fet_2').style.display='';
document.getElementById('astm_fet_3').style.display='none';
document.getElementById('astm_fet_4').style.display='none';
document.getElementById('astm_fet_5').style.display='none';
return false
}else if(x==3){
document.getElementById('astm_fet_1').style.display='none';
document.getElementById('astm_fet_2').style.display='none';
document.getElementById('astm_fet_3').style.display='';
document.getElementById('astm_fet_4').style.display='none';
document.getElementById('astm_fet_5').style.display='none';
return false
}else if(x==4){
document.getElementById('astm_fet_1').style.display='none';
document.getElementById('astm_fet_2').style.display='none';
document.getElementById('astm_fet_3').style.display='none';
document.getElementById('astm_fet_4').style.display='';
document.getElementById('astm_fet_5').style.display='none';
return false
}else if(x==5){
document.getElementById('astm_fet_1').style.display='none';
document.getElementById('astm_fet_2').style.display='none';
document.getElementById('astm_fet_3').style.display='none';
document.getElementById('astm_fet_4').style.display='none';
document.getElementById('astm_fet_5').style.display='';
return false
}
}

var currfetPic=1;
function astmFetTimer(){
astm_fet(currfetPic);
setTimeout('astmFetTimer()',3300); 
if(currfetPic<5){currfetPic++;}else{currfetPic=1;}
}

/////////////
function astm_news(x){
if(x==1){
document.getElementById('astm_news_1').style.display='';
document.getElementById('astm_news_2').style.display='none';
document.getElementById('astm_news_3').style.display='none';
document.getElementById('astm_news_4').style.display='none';
document.getElementById('astm_news_5').style.display='none';
return false
}else if(x==2){
document.getElementById('astm_news_1').style.display='none';
document.getElementById('astm_news_2').style.display='';
document.getElementById('astm_news_3').style.display='none';
document.getElementById('astm_news_4').style.display='none';
document.getElementById('astm_news_5').style.display='none';
return false
}else if(x==3){
document.getElementById('astm_news_1').style.display='none';
document.getElementById('astm_news_2').style.display='none';
document.getElementById('astm_news_3').style.display='';
document.getElementById('astm_news_4').style.display='none';
document.getElementById('astm_news_5').style.display='none';
return false
}else if(x==4){
document.getElementById('astm_news_1').style.display='none';
document.getElementById('astm_news_2').style.display='none';
document.getElementById('astm_news_3').style.display='none';
document.getElementById('astm_news_4').style.display='';
document.getElementById('astm_news_5').style.display='none';
return false
}else if(x==5){
document.getElementById('astm_news_1').style.display='none';
document.getElementById('astm_news_2').style.display='none';
document.getElementById('astm_news_3').style.display='none';
document.getElementById('astm_news_4').style.display='none';
document.getElementById('astm_news_5').style.display='';
return false
}
}

var currPic=1;
function astmTimer(){
astm_news(currPic);
setTimeout('astmTimer()',3000); 
if(currPic<5){currPic++;}else{currPic=1;}
}

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/plus.gif';
tpic.title="فتح";
} else {
tdiv.style.display = '';
tpic.src = 'images/min.gif';
tpic.title="اغلاق";
}
}

function astm_contact_menu(kind,astmid){
if(kind=="0"){
for(i=1;i<=astmid;i++){
document.getElementById('menu'+i).style.display='';
document.getElementById('astmmenu'+i).src='images/min.gif';
}
}else{
for(i=1;i<=astmid;i++){
document.getElementById('menu'+i).style.display='none';
document.getElementById('astmmenu'+i).src='images/plus.gif';
}
}
}

function astm_Ser(){
if (document.FormSer.Ser.value=="" || document.FormSer.Ser.value=="مفردات البحث"){
alert("من فضلك اكتب مفردات البحث")
document.FormSer.Ser.focus()
return false
}
}

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_forget(){
str = document.formforget.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك أدخل البريد الالكتروني بشكل صحيح');
document.formforget.email.focus();
return false;
}
}

function astm_register(x){
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
}
if (document.astm_form.sex.value==""){
alert("من فضلك اختار الجنس")
document.astm_form.sex.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.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(x=="Add"){
if (document.astm_form.register_cod.value==""){
alert("من فضلك أدخل رمز التأكيد")
document.astm_form.register_cod.focus()
return false
}
}
}

function astm_print(){window.print();}

function astmComment(){
if (document.addComment.name.value==""){
alert("من فضلك ادخل اسمك")
return false
}
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 astm_AddNews(x){
if (document.astm_form.name.value==""){
alert("من فضلك ادخل عنوان "+x);
document.astm_form.name.focus()
return false
}
if(x=="الديوان"){
if (document.astm_form.peot.value==""){
alert("من فضلك اختار الشاعر");
document.astm_form.peot.focus()
return false
}
}
if (document.astm_form.note.value==""){
alert("من فضلك ادخل تفاصيل "+x);
document.astm_form.note.focus()
return false
}
}

function astm_video(){
if(document.formVideo.name.value==""){
alert('من فضلك ادخل اسم الفديو');
document.formVideo.name.focus();
return false;
}	
if(document.formVideo.sec.value==""){
alert('من فضلك اختار القسم');
document.formVideo.sec.focus();
return false;
}	
if(document.formVideo.url.value==""){
alert('من فضلك ادخل رابط الفديو');
document.formVideo.url.focus();
return false;
}	
if(document.formVideo.note.value==""){
alert('من فضلك ادخل الوصف');
document.formVideo.note.focus();
return false;
}	
}

function astm_gallery(){
if(document.astm_form.sec.value==""){
alert("من فضلك اختار القسم المراد اضافة الصور له");
document.astm_form.sec.focus()
return false
}
if(document.astm_form.filepic.value==""){
alert("من فضلك اختار الصورة المراد اضافتها");
document.astm_form.filepic.focus()
return false
}
if(document.astm_form.note.value==""){
alert("من فضلك اكتب التعليق المراد اضافته على الصوره");
document.astm_form.note.focus()
return false
}
}

function astm_contact(){
if (document.formContact.name.value==""){
alert("من فضلك اكتب اسمك");
document.formContact.name.focus()
return false
}
if (document.formContact.city.value==""){
alert("من فضلك اكتب المدينه")
document.formContact.city.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 <="9"){
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
}
}
