
	// buttons
$(".buttonface").click(function() {
	if ($(this).attr("href"))
		return;
		// hack to trigger onsubmit as naturally as possible
	$(this).parents("form").append("<input type='submit' style='display:none;' id='_submit' />");
	$("#_submit").click();
	$("#_submit").remove();
});

$(".buttondiv").click(function() {
    if ($(this).find("a").attr("href"))
        document.location.href =  $(this).find("a").attr("href");
        
        //return;
        // hack to trigger onsubmit as naturally as possible
    else
        {
        $(this).parents("form").append("<input type='submit' style='display:none;' id='_submit' />");
        $("#_submit").click();
        $("#_submit").remove();
        }
});


	// table striping
function stripeTables()
{
	$("table.common tr:even").addClass("even");
	$("table.common tr:odd").addClass("odd");
}
stripeTables();

try
{
  Ajax.onupdate.push(stripeTables());
}
catch(e)
{

}
  
	// signs ajax
$(document).ready(function() {
	
	$(".showSign").mouseover(function() {
		if ($(this).attr("_sign_loaded")==true)
			return;
		var id = $(this).attr('id');
		var oid = $(this).attr('oid');

			// append div
		var str = "<div id='sign_"+id+"' style='display:none; width:140px; height:100px; position:absolute;'>";
		str += "</div>";
		$('body').append(str);
		
			// load ajax
		if (oid == 1)
			$('#sign_'+id).load('http://www.lamed.co.il/sign.php', { 'oper' : 'get_img', 'oid' : id } );
		else
			$('#sign_'+id).load('http://www.lamed.co.il/sign.php', { 'oper' : 'get_img', 'id' : id } );
		
			// position and display div
		var pos = $(this).position();
		$('#sign_'+id).css ({ 'left' : (pos.left-250)+'px', 'top' : (pos.top)+'px' });
		$('#sign_'+id).fadeIn('slow');
		
		$(this).attr('_sign_loaded', true);
	}).mouseout(function(){
		var id = $(this).attr('id');
		var showsign = this;
		$('#sign_'+id).fadeOut('slow', function() {
			$('#sign_'+id).remove();
			$(showsign).attr('_sign_loaded', false);
		});
	});

});
