(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
jQuery.preLoadImages("purple.png", "bowling_site/gfx/bowling/overlay/purple.png");

function sb_msg(msg){
	alert(msg);
}
function sb_confirm(msg){
	/*var flag=false;
	$("#dialog-confirm").dialog({
			resizable: false,
			height:140,
			modal: true,
			autoOpen: false,
			buttons: {
				'No': function() {
					$(this).dialog('option','ret',false);
					$(this).dialog('close');
				},
				'Yes': function() {
					$(this).dialog('option','ret',true);
					$(this).dialog('close');
				}
			}
	});
	$("#dialog-confirm").html(msg);
	$("#dialog-confirm").dialog('open');
	return $(this).dialog('option','ret');*/
	return confirm(msg);
}
var sysTimeout;
function showLoading(id){
	var content='<div class="loadingScreen" id="loadingScreen" style="width:'+$('#'+id).width()+'px;height:'+$('#'+id).height()+'px"></div>';
	//alert(content);
	//alert($('#'+id).height());
	$('#'+id).prepend(content);
}



function cssTest(){
	//alert('b');
	//$('#testDiv').css($('#testDiv2').css());
	el1=document.getElementById('testDiv_mce_ifr').document.getElementById('testTarget');
	el2=document.getElementById('');
	el1.css(el2.css());

}
jQuery.fn.css2 = jQuery.fn.css;
jQuery.fn.css = function() {
if (arguments.length) return jQuery.fn.css2.apply(this, arguments);
alert('a');
var attr = ['font-family','font-size','font-weight','font-style','color',
    'text-transform','text-decoration','letter-spacing','word-spacing',
    'line-height','text-align','vertical-align','direction','background-color',
    'background-image','background-repeat','background-position',
    'background-attachment','opacity','width','height','top','right','bottom',
    'left','margin-top','margin-right','margin-bottom','margin-left',
    'padding-top','padding-right','padding-bottom','padding-left',
    'border-top-width','border-right-width','border-bottom-width',
    'border-left-width','border-top-color','border-right-color',
    'border-bottom-color','border-left-color','border-top-style',
    'border-right-style','border-bottom-style','border-left-style','position',
    'display','visibility','z-index','overflow-x','overflow-y','white-space',
    'clip','float','clear','cursor','list-style-image','list-style-position',
    'list-style-type','marker-offset'];
var len = attr.length, obj = {};
for (var i = 0; i < len; i++) 
    obj[attr[i]] = jQuery.fn.css2.call(this, attr[i]);
return obj;
}

// jquery start
$(function(){
	
	$('#testClick').click(function(){
		alert('c');
		cssTest();
	});
	
	
     
     
});
function closeSysMsg(){
	clearTimeout('sysTimeout');
	//$('#sysMsg').dialog("close");
	$('#sysMsg').hide();
}
function showSysMsg(p){
	clearTimeout('sysTimeout');
	/*$('#sysMsg').dialog({
		autoOpen: false,
		modal: false,
		title: 'Wiadomość systemowa'
	});
	$('#sysMsg').html(p.msg);
	$('#sysMsg').dialog("open");*/
	$('#sysMsg').html(p.msg);
	$('#sysMsg').show(100);
	$('#sysMsg').click(function(){
		closeSysMsg();
	});
	sysTimeout=setTimeout("closeSysMsg()",5000);
}

function getScrollHeight()
{
   var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;
           
   return h ? h : 0;
}

