function jsdel(url) {
    var answer = confirm("تحذير: لايمكن التراجع عن هذه الخطوة نهائيا وقد يتأكثر الموقع. هل ترغب في الحذف على مسئوليتك؟")
     if (answer){
         window.location = ""+ url +"";
     }
}

function validateEmail(emailAddress) {
   var match = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/.test(emailAddress);
   return match;
}

function ShowHide(varObjID){
   if(document.getElementById(varObjID).style.display=="none"){
      document.getElementById(varObjID).style.display="block";
      //funSImg(varObjID);
   }else{
      document.getElementById(varObjID).style.display="none";
   }
}

function ShowHidePrint(varObjID){
   if(document.getElementById(varObjID).style.display=="none"){
      document.getElementById('mainDV').style.display="none";
      document.getElementById(varObjID).style.display="block";
      //funSImg(varObjID);
   }else{
      document.getElementById(varObjID).style.display="none";
      document.getElementById('mainDV').style.display="block";
   }
}

function CheckContactForm(contactform){

        if (contactform.name.value == "" ) { alert( "الرجاء أدخل الإسم بالكامل" );
        contactform.name.focus();
        return false; }

        if (contactform.email.value == "" ) { alert( "أدخل البريد الإلكتروني" );
        contactform.email.focus();
        return false; }

        checkEmail = contactform.email.value
	if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
	{alert("البريد  الإلكتروني  خطأ!.");
	contactform.email.focus();
	return false; }


        if (contactform.subject.value == "" ) { alert( "من فضلك أكتب موضوع للرسالة" );
        contactform.subject.focus();
        return false; }

        if (contactform.msg.value == "" ) { alert( "أكتب الرسالة" );
        contactform.msg.focus();
        return false; }


   // return true;
}


function CheckTellform(tellform){

        if (tellform.name.value == "" ) { alert( "الرجاء أدخل الإسم بالكامل" );
        tellform.name.focus();
        return false; }

        if (tellform.email.value == "" ) { alert( "أدخل البريد الإلكتروني" );
        tellform.email.focus();
        return false; }

        checkEmail = tellform.email.value
	if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
	{alert("البريد  الإلكتروني  خطأ!.");
	tellform.email.focus();
	return false; }


        if (tellform.fname.value == "" ) { alert( "أدخل إسم صديقك" );
        tellform.fname.focus();
        return false; }



         if (tellform.femail.value == "" ) { alert( "أدخل البريد الالكتروني الخاص بصديقك" );
        tellform.femail.focus();
        return false; }

        checkEmail = tellform.femail.value
	if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
	{alert("البريد  الإلكتروني  خطأ!.");
	tellform.femail.focus();
	return false; }

   // return true;
}


function CheckCommform(commform){

        if (commform.name.value == "" ) { alert( "الرجاء أدخل الإسم بالكامل" );
        commform.name.focus();
        return false; }

        if (commform.email.value == "" ) { alert( "أدخل البريد الإلكتروني" );
        commform.email.focus();
        return false; }


        if (commform.country.value == "" ) { alert( "الرجاء أدخل الدولة" );
        commform.country.focus();
        return false; }

        if (commform.subject.value == "" ) { alert( "الرجاء أدخل الموضوع" );
        commform.subject.focus();
        return false; }

        if (commform.comment.value == "" ) { alert( "الرجاء أدخل نص التعليق" );
        commform.comment.focus();
        return false; }


   // return true;
}

   var newwindow;
     function popimg(url)
    {
        newwindow=window.open(url,'name','height=500,width=650,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
	if (window.focus) {newwindow.focus()}
    }


    function textCounter() {

    var field = document.newsf.hometext;
    var counter = document.getElementById('remChar');
    var maxlimit = 140;

      if(field.value.length > maxlimit)
        field.value = field.value.substring(0, maxlimit);

      else
        counter.innerHTML = maxlimit - field.value.length;
     }

	 

 /* TABBS BY MAAKING.COM */	 





var tabsClass = {

	tabSetArray: 	new Array(),

	classOn: 		"tabs_on",

	classOff: 		"tabs_off",



	addTabs: function (tabsContainer) {

		tabs = document.getElementById(tabsContainer).getElementsByTagName("div");

		for (x in tabs) {

			if (typeof(tabs[x].id) != "undefined") {

				this.tabSetArray.push(tabs[x].id);

			} else {}

		}

	},

	switchTab: function (element) {

		for (x in this.tabSetArray) {

			tabItem = this.tabSetArray[x];

			dataElement = document.getElementById(tabItem + "_data");
			//alert(dataElement);
			if (dataElement) {

				if (dataElement.style.display != "none") {

					dataElement.style.display = "none";

				} else {}

			} else {}

			tabElement = document.getElementById(tabItem);

			if (tabElement) {

				if (tabElement.className != this.classOff) {

					tabElement.className = this.classOff;

				} else {}

			} else {}

		}

		document.getElementById(element.id + "_data").style.display = "";

		element.className = this.classOn;

	}

};



var tabsClass2 = {

	tabSetArray: 	new Array(),
	classOn2: 		"tabs2_on",
	classOff2: 		"tabs2_off",
	addTabs2: function (tabsContainer) {
		tabs = document.getElementById(tabsContainer).getElementsByTagName("div");
		//alert(tabs);
		for (x in tabs) {
			if (typeof(tabs[x].id) != "undefined") {
				this.tabSetArray.push(tabs[x].id);
				//alert(tabs[x].id);
			} else {}
		}
	},
	switchTab2: function (element) {
		for (x in this.tabSetArray) {
			tabItem = this.tabSetArray[x];
			//alert(tabItem);
			dataElement = document.getElementById(tabItem + "_data2");
			//alert(dataElement);
			if (dataElement) {
				if (dataElement.style.display != "none") {
					dataElement.style.display = "none";
				} else {}
			} else {}
			tabElement = document.getElementById(tabItem);
			//alert(tabItem);
			if (tabElement) {
				if (tabElement.className != this.classOff2) {
					tabElement.className = this.classOff2;
				} else {}
			} else {}
		}
		document.getElementById(element.id + "_data2").style.display = "";
		//alert(element.id);
		element.className = this.classOn2;
	}

};

 /* end TABBS BY MAAKING.COM */		 
 
 
 // BBC Ticker startup
function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	// Locate base objects
	if (document.getElementById) {
		    theAnchorObject     = document.getElementById("tickerAnchor");
			runTheTicker();
		 }
	else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}
// Ticker main run loop
function runTheTicker()
{
	var myTimeout;
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	     = "<span class=\"tickls\">" + theLeadString + "</span>";
	}
	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = thePrefix +
	theStorySummary.substring(0,theCurrentLength) + whatWidget();
	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}
/* end bbc ticker */
