﻿$(document).ready(function(){
    $('#search_box .form-text').attr('value','بحث');
    $('#search_box .form-text').click(function(){
        if($(this).attr('value') == 'بحث')
            $(this).attr("value","");
    });
    $('#search_box .form-text').blur(function(){
        if($(this).attr('value') == '')
            $(this).attr('value','بحث');
    });
    $('#views-exposed-form-publication-page-1 .views-exposed-widgets .views-exposed-widget label').text(' إختر السنة ');
    $('#block-views-latest_events-block_1 .view-latest-events .more-link a').text('المزيد');
    $('#block-views-latest_news-block_1 .view-latest-news .more-link a').text('المزيد');
	//To re format the search page
	$('#content_wrapper .box em').each(function(){
		if($(this).text()=='"الحوت الأزرق"'){
			$(this).html('&nbsp;"مؤسسة عبد الحميد شومان"&nbsp;');
		}else if($(this).text() == 'الحوت الأزرق'){
			$(this).html("&nbsp;مؤسسة عبد الحميد شومان&nbsp;");
		}else if($(this).text() == "الحوت OR الأزرق"){
			$(this).html("&nbsp;مؤسسة OR عبد الحميد شومان&nbsp;");
		}else if($(this).text() == 'حوت أزرق'){
			$(this).html("عبد الحميد شومان");
		}
	});
	
	
/* 	$('#events .block-event caption').html('<a href="/ar/event" id="go_to_events"></a>'+($('#events .block-event caption').html()));
	$('#events .block-event .event-block caption .prev').css({'top':'-7px'});
	$('#events .block-event .event-block caption > a').css({'top':'-9px'});
	$('#events .block-event .event-block caption .next').css({'top':'-7px'});
	$('#go_to_events').css({
		'display':'block',
		'height':'36px',
		'position':'relative',
		'left':'0',
		'top':'0'
	}); */
	
	
	
	$('#edit-submit-publication').val('دخول');
	
	// Number validation
	$("#edit-simple-tel").keypress(function (e){
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
		return false;
	  }
	});
	
	$('.agreement-on').text("بتاريخ");
	$('.agreement-with').text('مع');
	$('#edit-event-type-select option[value="event"]').text('الفعالية');
	$('#edit-submitted-preferred-language-for-receiving-data option:eq(0)').attr('selected','');
	$('#edit-submitted-preferred-language-for-receiving-data option:eq(1)').attr('selected','selected');
	
	
	/*
	**_________________________ SMTP Authentication form modify__________________________________|
	$('#print-mail-form #edit-fld-from-addr-wrapper #edit-fld-from-addr').attr('value','web@web.shoman.org');
	*/
	$('#print-mail-form #edit-fld-from-addr-wrapper').hide();
});
