/*									    \\\ /// 
										( @ @ ) 
/*===============================....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 MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

<!--------------------------->
 message = "  ^" +
                "^"
  scrollSpeed = 0
  lineDelay   = 0
  txt         = ""
  function scrollText(pos) {
    if (message.charAt(pos) != '^') {
      txt    = txt + message.charAt(pos)
      status = txt
      pauze  = scrollSpeed
    }
    else {
      pauze = lineDelay
      txt   = ""
      if (pos == message.length-1) pos = -1
    }
    pos++
    setTimeout("scrollText('"+pos+"')",pauze)
  }
scrollText(0)
<!--------------------------->
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 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(form_addArticle.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:295'  onblur=\"this.className='field'\"  onfocus=\"this.className='field2'\"/>";
		return false;
	}
}


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 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_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_print(){window.print();}

function astm_tellfriend(){
str = document.form_tell.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1)
{
alert ('من فضلك ادخل البريد الالكتروني بشكل صحيح');
document.form_tell.email.focus();
return false;
}
}

function astm_SER(){
if(document.formSER.SER.value=="" || document.formSER.SER.value=="........مفردات البحث"){
alert("من فضلك ادخل مفردات البحث")
document.formSER.SER.focus()
return false
}
}

function astm_login(){
if (document.FormLog.UserName.value=="" || document.FormLog.UserName.value=="اسم المستخدم"){
alert("من فضلك اكتب اسم المستخدم")
document.FormLog.UserName.focus()
return false
}

if (document.FormLog.PassWord.value=="" || document.FormLog.PassWord.value=="كلمة السر"){
alert("من فضلك اكتب كلمة السر")
document.FormLog.PassWord.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.pass2.value !== document.formRegister.pass.value){
alert("من فضلك تأكد من ان كلمة السر متساوية مع تأكيد كلمة السر")
document.formRegister.pass2.focus()
return false
}

if (document.formRegister.nationality.value==""){
alert("من فضلك اختار الجنسية")
document.formRegister.nationality.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.email2.value !== document.formRegister.email.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 <= "10"){
alert("من فضلك ادخل رقم الجوال الصحيح")
document.formRegister.mobile.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_vote(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 highlight(tag1,tag2){
h=tag1 + document.form_addArticle.newpage.value + tag2
document.form_addArticle.newpage.value=h
document.form_addArticle.newpage.focus()
}
function view_box(){
var x
x=document.form_addArticle.newpage.value
open('toolbox_view.php?views='+x+'','k','width=500,height=400,scrollbar=1,status=0');
}

function astm_show_comment(x){
if(x==1){
 document.getElementById('show_com').style.display='block';
 return false
}else{
 document.getElementById('show_com').style.display='none';
 return false
}
}

function astm_article(){
if (document.form_addArticle.name.value==""){
alert("من فضلك اكتب اسم المقالة")
document.form_addArticle.name.focus()
return false
}

if (document.form_addArticle.newpage.value==""){
alert("من فضلك اكتب المقالة")
document.form_addArticle.newpage.focus()
return false
}

}


function astm_Course(){
if (document.formCourse.kind.value==""){
alert("من فضلك اختار الدورة المراد التسجيل لها")
document.formCourse.kind.focus()
return false
}

if (document.formCourse.name.value==""){
alert("من فضلك اكتب اسمك")
document.formCourse.name.focus()
return false
}
if (document.formCourse.city.value==""){
alert("من فضلك اكتب مدينتك")
document.formCourse.city.focus()
return false
}

if (document.formCourse.address.value==""){
alert("من فضلك اكتب العنوان")
document.formCourse.address.focus()
return false
}

str = document.formCourse.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك ادخل البريد الالكتروني بشكل صحيح');
document.formCourse.email.focus();
return false;
}

if(document.formCourse.mobile.value!=""){
if(isNaN(document.formCourse.mobile.value)){
alert("من فضلك اكتب رقم الهاتف ارقام")
document.formCourse.mobile.focus()
return false
}
if(document.formCourse.mobile.value.length <= "10"){
alert("من فضلك ادخل رقم الهاتف الصحيح")
document.formCourse.mobile.focus()
return false
}
}
}

function astm_comment(){
/*
if (document.formcomment.name.value==""){
alert("من فضلك اكتب اسمك")
document.formcomment.name.focus()
return false
}
*/
if (document.formcomment.comment.value==""){
alert("من فضلك اكتب التعليق")
document.formcomment.comment.focus()
return false
}
}

function astm_maillist(){
if (document.formmaillist.name.value=="" || document.formmaillist.name.value=="الاسم"){
alert("من فضلك اكتب اسمك")
document.formmaillist.name.focus()
return false
}

if((document.formmaillist.email.value=="" && document.formmaillist.phone.value=="") || (document.formmaillist.email.value=="" && document.formmaillist.phone.value=="الجوال")){
alert("من فضلك اكتب بريدك الالكتروني")
document.formmaillist.email.focus()
return false
}

if(document.formmaillist.email.value!==""){
str = document.formmaillist.email.value;
if (str.indexOf('@') == -1 || str.indexOf('.') == -1){
alert ('من فضلك ادخل البريد الالكتروني بشكل صحيح');
document.formmaillist.email.focus();
return false;
}
}

if(document.formmaillist.phone.value!=="" ||document.formmaillist.phone.value!=="الجوال"){
if(isNaN(document.formmaillist.phone.value)){
alert("من فضلك اكتب رقم الجوال ارقام")
document.formmaillist.phone.focus()
return false
}
if(document.formmaillist.phone.value.length <= "10"){
alert("من فضلك ادخل رقم الجوال الصحيح \n مثل 966555881000")
document.formmaillist.phone.focus()
return false
}
}

if (document.formmaillist.kind.value==""){
alert("من اختار حالة الاشتراك")
document.formmaillist.kind.focus()
return false
}
}

function astm_contact(){
if (document.formContact.name.value==""){
alert("من فضلك اكتب اسمك")
document.formContact.name.focus()
return false
}
/*
if (document.formContact.job.value==""){
alert("من فضلك اكتب الوظيفة")
document.formContact.job.focus()
return false
}
*/
/*
if (document.formContact.organization.value==""){
alert("من فضلك اكتب جهة العمل")
document.formContact.organization.focus()
return false
}
*/
/*
if (document.formContact.country.value==""){
alert("من فضلك اختار الدولة")
document.formContact.country.focus()
return false
}
*/
/*
if (document.formContact.address.value==""){
alert("من فضلك اكتب العنوان")
document.formContact.address.focus()
return false
}
*/

if(document.formContact.phone.value!=""){
if(isNaN(document.formContact.phone.value)){
alert("من فضلك اكتب رقم الهاتف ارقام")
document.formContact.phone.focus()
return false
}
if(document.formContact.phone.value.length <= "10"){
alert("من فضلك ادخل رقم الهاتف الصحيح")
document.formContact.phone.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.fax.value!=""){
if(isNaN(document.formContact.fax.value)){
alert("من فضلك اكتب رقم الفاكس ارقام")
document.formContact.fax.focus()
return false
}
if(document.formContact.fax.value.length <= "10"){
alert("من فضلك ادخل رقم الفاكس الصحيح")
document.formContact.fax.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.msg.value==""){
alert("من فضلك اكتب نص الرسالة")
document.formContact.msg.focus()
return false
}

}
