var ie=(document.all)?true:false;
var ns=(document.layers)?true:false;
var oNewWindow;

$.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {	
	 $('<img />')
	    .attr('src',arguments[i])
	    .load(function(){
	        // Your other custom code
	    });
  }
}

//------------------------------------------------------------------
function openNewWindow(URLtoOpen, windowName, windowFeatures) 
{ 
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}
//------------------------------------------------------------------
function toggleVisibility(me)
{
	if (me.style.display=="block")
	{
		me.style.display="none";
	}else {
		me.style.display="block";
	}
}
//------------------------------------------------------------------
function popup(URLtoOpen,Width,Height,Scroll) 
{ 	
    var myWidth = 0, myHeight = 0;
      
	if( typeof( window.innerWidth) == 'number' ) 
	{
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	}
		
	x=(myWidth/2)-(Width/2);	
	y=(myHeight/2)-(Height/2);	
	
	newWindow=window.open(URLtoOpen,'Popup','scrollbars='+Scroll+',width='+Width+',height='+Height+',top='+y+',left='+x);
}
//------------------------------------------------------------------
function Blank(href)
{
	window.open(href,'_blank');
	return false;
}
//------------------------------------------------------------------
function sendFormSzukaj()
{
	var frm=document.frmSzukaj;	
	frm.action='szukaj/'+frm.selectSzukaj.value+'/q/'+frm.q.value+'/';
}
