
$('<span id="hint" class="hint"></span>').appendTo("body");
//  اداة التلمحي ماذا؟
//$('<table  id="bk_what" style="direction:rtl; display:none; border: 1px solid #E70000; width:210px; position:absolute; left: 242px; top: 285px;background-color:#A60100; text-indent:5px;" cellpadding="0" cellspacing="0">\
//	<tr>\
//		<td style="text-align:right;height:10px" valign="bottom">\
//		<img src="images/corner-tooltip.gif" alt="" style="position:relative; top:-17px; left:-20px;"/></td>\
//	</tr>\
//	<tr>\
//		<td id="bk_tool_tip_what"></td>\
//	</tr>\
//</table>').appendTo("body");


$('<table cellpadding="0" cellspacing="0"  class="tool-tip">\
	<tr>\
		<td class="ui-tool-tip-corner-right-top"></td>\
		<td class="ui-tool-tip-top"><span class="ui-tool-tip-arrow-top"></span></td>\
		<td class="ui-tool-tip-corner-left-top"></td>\
	</tr>\
	<tr>\
		<td class="ui-tool-tip-right">\
		<span class="ui-tool-tip-arrow-right"></span></td>\
		<td class="ui-tool-tip-content"></td>\
		<td class="ui-tool-tip-left"><span class="ui-tool-tip-arrow-left"></span></td>\
	</tr>\
	<tr>\
		<td class="ui-tool-tip-corner-right-down">&nbsp;</td>\
		<td class="ui-tool-tip-down">\
		<span class="ui-tool-tip-arrow-down"></span></td>\
		<td class="ui-tool-tip-corner-left-down">&nbsp;</td>\
	</tr>\
</table>').appendTo("body");




function tolltip(e,src){
//	e = e ? e : window.event;
//
//	CSE = e.target ? e.target : e.srcElement;
//
//	$('span.ui-tool-tip-arrow-right,span.ui-tool-tip-arrow-top,span.ui-tool-tip-arrow-left').css("display","none");
//
//	var pos=$(CSE).offset();
//	$('.ui-tool-tip-content').html('<img id="tool-tip-imgs" src="'+src+'" style="max-height:200px;max-width:200px;"/>');
//	$('.tool-tip').fadeIn("slow").css({'left':pos.left-(($('#tool-tip-imgs').width()-($(CSE).width()))/2),'top':pos.top-(($('#tool-tip-imgs').height())),padding:0,margin:0}).animate({"top":"-=40px","left":"-=10px"},'slow');
//	$('span.ui-tool-tip-arrow-down').css("display","block");
//	$('span.ui-tool-tip-arrow-down').fadeIn("slow");
//
//	$(CSE).bind('mouseout',function(){
//		$('.tool-tip,span.ui-tool-tip-arrow-down').fadeOut("slow");
//		$('.tool-tip').stop(true,true);
//	
//	});


}


function tolltip_what(e,src){
	$('span.ui-tool-tip-arrow-right,span.ui-tool-tip-arrow-down,span.ui-tool-tip-arrow-left').css("display","none");

	e = e ? e : window.event;

	CSE = e.target ? e.target : e.srcElement;

	var pos=$(CSE).offset();


	$('.tool-tip').css({'left':pos.left- ($(CSE).width()/2),'top':pos.top+$(CSE).height()});
	$('.tool-tip').show();

	$('.ui-tool-tip-content').load(src,function(){
		$('.tool-tip,span.ui-tool-tip-arrow-top').show();
		$('span.ui-tool-tip-arrow-top').css("display","block");
	});
	$(CSE).hover(function(){
		$('.tool-tip,span.ui-tool-tip-arrow-top').show();
		$('span.ui-tool-tip-arrow-top').css("display","block");
	},
	function(){
		$('.tool-tip,span.ui-tool-tip-arrow-top').hide();
		
	}


	);



};



function bk_tool_tips(e,html){

	$('.ui-tool-tip-content').html(html);
	$('.tool-tip').fadeIn('slow').css({left:$(e).position().left+$(e).width()+10,top:$(e).position().top-$(e).height(),padding:5});

	$('span.ui-tool-tip-arrow-left').fadeIn('slow').css("display","block");
	var hint_timer=setTimeout(function(){
		$('.tool-tip,span.ui-tool-tip-arrow-left').fadeOut('slow');
	},8000);

	$(e).bind('blur',function(){
		$('.tool-tip,span.ui-tool-tip-arrow-left').fadeOut('slow');
		clearTimeout(hint_timer);
	});
}


//  لاستبدال حقل الباسسور بالنص
function replace(){
	var type=($(this).attr('type')=='password')?'text':'password';
	var title=($(this).attr('type')=='text')?'لمشاهدة الرقم السري يرجى النقرنقر مزدوج بالماوس':'لاخفاء الرقم السري يرجى النقر نقراء مزدوج بالماوس'
	$('#hint').html(title);
	$(this).parent().html('<input name="'+$(this).attr('name')+'"  style="width:'+$(this).width()+'px" class="'+$(this).attr('className')+'" type="'+type+'" value="'+$(this).val()+'"  onfocus="bk_tool_tips(this,\''+title+'\');"/>');
	$('form input[name="'+$(this).attr('name')+'"]').dblclick(replace);
	$('form input[name="'+$(this).attr('name')+'"]').focus();
}


// الازارير

$(document).ready(function(){

	$(".button").hover(function(){
		$("img",this)
		// first jump
		.animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
		// second jump
		.animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
		// the last jump
		.animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
	});





});


