function getAdDate(){
   today = new Date();
   date = today.getDate();
   weekday = today.getDay();
   sCurDate = "";

   if (weekday == 6) sCurDate += ('السبت');
   if (weekday == 0) sCurDate += ('الأحد');
   if (weekday == 1) sCurDate += ('الإثنين');
   if (weekday == 2) sCurDate += ('الثلاثاء');
   if (weekday == 3) sCurDate += ('الأربعاء');
   if (weekday == 4) sCurDate += ('الخميس');
   if (weekday == 5) sCurDate += ('الجمعة');
   //document.write(', ', date,' ');
   sCurDate += " " + date + " ، ";

   month = today.getMonth();
   if (month == 0) sCurDate += ('يناير');
   if (month == 1) sCurDate += ('فبراير');
   if (month == 2) sCurDate += ('مارس');
   if (month == 3) sCurDate += ('أبريل');
   if (month == 4) sCurDate += ('مايو');
   if (month == 5) sCurDate += ('يونيو');
   if (month == 6) sCurDate += ('يوليو');
   if (month == 7) sCurDate += ('أغسطس');
   if (month == 8) sCurDate += ('سبتمبر');
   if (month == 9) sCurDate += ('أكتوبر');
   if (month == 10) sCurDate += ('نوفمبر');
   if (month == 11) sCurDate += ('ديسمبر');

   year=today.getYear();
   if (year<=99) sCurDate +=  " " + (' 19', year);
   if (year>=2000) sCurDate +=  " " + (year);
   //document.write (year);

   return sCurDate;
}

function xlaunch(sURL, sName, sFeatures, sParentName) {
  //var oWin = showModalDialog(sURL, sName, sFeatures);
  var oWin = open(sURL, sName, sFeatures);
  if (oWin.opener == null){
 	oWin.opener = window;
	oWin.opener.name = sParentName;
	oWin.window.focus();
  }
  return oWin;
}

function printArtical(iID){
	myRemote = xlaunch('print.php?rpt=' +iID,
	 'myRemote',
	 'height=600,width=800,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0',
	 'myWindo');
}

function sendArtical(iID,sTitle){
	myRemote = xlaunch('./send/?id=' +iID+ '&title=' + sTitle,
	 'myRemote',
	 'height=280,width=453,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0',
	 'myWindo');
}

function addComments(iID,sTitle){
	myRemote = xlaunch('comments.php?rpt=' +iID+ '&title=' + sTitle,
	 'myRemote',
	 'height=233,width=453,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0',
	 'myWindo');
	
}


function isEmail(varX)
   {
   if (document.forms[0].elements[varX].value.indexOf ('@',0) == -1 || 
       document.forms[0].elements[varX].value.indexOf ('.',0) == -1)
      {
      //alert("\nThis is not a valid E-Mail address. \n\nPlease re-enter valid e-mail address.")
      document.forms[0].elements[varX].select();
      document.forms[0].elements[varX].focus();
      return false;
      }
   else
      {
      return true;
      }
   }

function isEmpty( varX ){	// Returns false if empty
  if (document.forms[0].elements[varX].value == "") 
      {
      document.forms[0].elements[varX].focus();
      return true; 
      }
 else return false;
}


var ErrInvalidEmail = "خطأ في العنوان البريدي \n";
var ErrEmptyField = 'يمكنك التسجيل لاستقبال رسائلنا الالكترونية و اخبار تحديث الموقع';
ErrEmptyField += "\n\nفضلاً سجل اسمك  و بريدك الالكتروني";

function mailinFormCheck(){
    var x 
    // check filling up the form
    for (x=0; x<4; x++) {
     switch(x) 
          {
            case 0: 
            case 1: 
	if ( isEmpty(x) ) {
	    alert( ErrEmptyField );
              	    return false;
	    break;
	}
          }
    }
    
    // check email format validity
    if ( isEmail(1) ){  
    	if(! isEmail(1) ) {
     		alert(ErrInvalidEmail);
			document.forms[0].elements[1].focus();
			return false;
		}
	}
	else{
   		alert( ErrInvalidEmail );
		document.forms[0].elements[1].focus();
		return false;
	}



}

