jQuery(document).ready(function() {
/************************************************************/
/************************************************************/
function defaults() {
	jQuery("tr:nth-child(even)").addClass("zebra");
	/*jQuery("*:last-child").addClass("last");
	/*jQuery("*:first-child").addClass("first");*/
	jQuery(".portletBodyContainer *:last-child").addClass("last");
	jQuery(".pageTools li:last-child").addClass("last");
	jQuery(".breadcrumb-pageToolsContainer li:last-child").addClass("last");
	jQuery(".resultsTable tr:last-child").addClass("last");


}

   $('.field-clear').show();
    $('.field-field').hide();
    $('.field-clear').focus(function() {
	    $(this).hide();
	    $(this).next('.field-field').show();
	    $(this).next('.field-field').focus();
    });
    $('.field-field').blur(function() {
	    if($(this).val() == '') {
		    $(this).hide();
		    $(this).prev('.field-clear').show();
	    }
    });

	$(function() {
   		 $("#registertypes").tabs("div.description", {event:'mouseover'});
		})
/************************************************************/
function toggler() {
	$("ul.topHeaderOptions").toggler(/*{
		toggleContainer: ".topHeaderAdvancedSearchContainer",
		position: "left",
		positionForward: 0,
		positionBack: 45
	}*/);
}
/************************************************************/

$(function() {
    $("ul.customeTabs").tabs("div.customePanes > div");
});

/************************************************************/
function dropMenu() {
	$("ul.mainNav").dropMenu();
}

/************************************************************/



var increase=1
var decrease=1
		$(".resetFont").click(function(){
		$('.sizable').css('font-size', '');
		$('.sizable').css('line-height', '');
		 increase = 1 ;
	     decrease = 1 ;
	  });

	  // Increase Font Size
	  $(".increaseFont").click(function(){
		var currentFontSize = $('.sizable').css('font-size');

		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var stringEnding = currentFontSize.slice(-2);
	    ieFontSize  = currentFontSize.replace("px", "");
		ieFontSize  = parseInt(currentFontSize);
		if(ieFontSize == 8)
		{
		  currentFontSizeNum = 11;
		}
		else if (ieFontSize == 15){
		    currentFontSizeNum = 13;
		}

	    if (increase == 3){return false;}
	    else {
	        currentFontSizeNum = currentFontSizeNum + 1;
	        var newFontSize = currentFontSizeNum + stringEnding;
	        $('.sizable').css('font-size', newFontSize);
	        increase = increase + 1 ;
	        decrease = decrease - 1 ;
	    }
	  });

	  // Decrease Font Size
	  $(".decreaseFont").click(function(){
		var currentFontSize = $('.sizable').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var stringEnding = currentFontSize.slice(-2);

		ieFontSize  = currentFontSize.replace("px", "");
		ieFontSize  = parseInt(currentFontSize);
		if(ieFontSize == 15)
		{
		  currentFontSizeNum = 13;
		}

		if(ieFontSize == 8)
		{
		    currentFontSizeNum = 11;
		}


		 if (decrease == 3){return false;}
	     else {
	        currentFontSizeNum = currentFontSizeNum - 1;
	        var newFontSize = currentFontSizeNum + stringEnding;
	        $('.sizable').css('font-size', newFontSize);
	        decrease = decrease + 1 ;
	        increase = increase - 1 ;
	    }

		return false;
	  });





/************************************************************/
defaults();
toggler();
dropMenu();
getArabicName();
/************************************************************/
/************************************************************/
});
var addthis_config = {
     ui_language: "ar"
}



/************* book mark ***********/


/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
}
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function Trim(str)
{
    while (str.substring(0,1) == ' ') // check for white spaces from beginning
    {
        str = str.substring(1, str.length);
    }

    while (str.substring(str.length-1, str.length) == ' ') // check white space from end
    {
        str = str.substring(0,str.length-1);
    }
    return str;
}

