
var show_dialog_script = "";
var show_dialog_open;
var window_height;
var window_width;

function show_dialogxx(xlink, xtitle, xwidth, xheight){ 
var yhtml =jQuery.trim(xlink);
var yurl ;



var xh = $(window).height()*95/100;
var xw = $(window).width()*95/100;


if (parseInt(xheight) > parseInt(xh)) xheight = parseInt(xh);
if (parseInt(xwidth) > parseInt(xw)) xwidth = parseInt(xw);


  if (yhtml.indexOf("link:") != -1) {
     yurl = (yhtml.substring(5)+"?rnd="+Math.random().toString().substring(6));
    if (yhtml.indexOf("?") != -1)  yurl = (yhtml.substring(5)+"&rnd="+Math.random().toString().substring(6));

  }

if (yhtml.indexOf("link:") != -1) {
		  yhtml = $.ajax({
		                 url: yurl,
		                 async: false  
		                 }).responseText.replace(/\n/g,'');
                             }

$('#divortasaha').html(jQuery.trim(yhtml));
if (xtitle.length>3) $('#divortatitle').html(xtitle);
$('#basic-modal-content').modal({autoPosition: true,

                                  containerCss:{height:xheight,width:xwidth},
                                  onOpen: function (dialog) {
                                                    dialog.data.show();
                                                    dialog.overlay.slideDown('slow', function () {
                                                            show_dialog_open = 1;
                                                            dialog.container.slideDown('slow');
                                                             yhtml = null;
                                                    });
                                                 yhtml = null;
                                                },
                                  onClose: function (dialog) {
                                                            dialog.container.slideUp('slow', function () {
                                                                    dialog.overlay.slideUp('slow', function () {
                                                                            $.modal.close();
                                                                            if (show_dialog_script.length > 5) setTimeout(show_dialog_script ,500 );
                                                                            show_dialog_script="";
                                                                            show_dialog_open = 0;
                                                                    });
                                                            });
                                                        }
});

								

}

function create_tabtab(xleague_id) {

  $('#tabMenu'+xleague_id+' > li').click(function(){
    if (!$(this).hasClass('click')) {    
      $('#tabMenu'+xleague_id+' > li').removeClass('click');
	  $('#tabMenu'+xleague_id+' > li').children().removeClass('click');
      $(this).addClass('click');	
	  $(this).children().addClass('click');	
	
	
    $('#tabtabBody'+xleague_id+' div').hide();
    $('#tabtabBody'+xleague_id+' div:eq(' + $('#tabMenu'+xleague_id+' > li').index(this) + ')').show();
  }

  });

  $('#tabtabBody'+xleague_id+' li').click(function(){
    window.location = $(this).children().attr('href');
  }); 
} 

