function internalLink(hash){ 
	if ( /Konqueror|Safari|KHTML/.test(navigator.userAgent ) ) {
		df=document.createElement('form');
		df.setAttribute("method","get");
		df.setAttribute("action", "#"+hash);
		document.body.appendChild(df);
		df.submit();
		document.body.removeChild(df);
	} else
			document.location.href = "#"+hash;
		return false;
}

function wopen(sciezka,szerokosc,wysokosc){
	window.status="";
	var okno = open(sciezka,"DisplayWindow","scrollbars=yes,toolbar=no,directories=no,menubar=no, width=" + szerokosc + ", height="+wysokosc);
	okno.moveTo((screen.availWidth/2)-(szerokosc/2),(screen.availHeight/2)-(wysokosc/2));
	okno.focus();
}

/* -----------------------------------*/
/* --->>> onDOMReady Extension <<<----*/
/* -----------------------------------*/
// Adapted from DOM Ready extension by Dan Webb
// http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype
// which was based on work by Matthias Miller, Dean Edwards and John Resig
//
// Usage:
//
// Event.onReady(callbackFunction);
Object.extend(Event, {
  _domReady : function() {
    if (arguments.callee.done) return;
    arguments.callee.done = true;

    if (Event._timer)  clearInterval(Event._timer);
    
    Event._readyCallbacks.each(function(f) { f() });
    Event._readyCallbacks = null;
    
  },
  onReady : function(f) {
    if (!this._readyCallbacks) {
      var domReady = this._domReady;
      
      if (domReady.done) return f();
      
      if (document.addEventListener)
        document.addEventListener("DOMContentLoaded", domReady, false);
        
        /*@cc_on @*/
        /*@if (@_win32)
            var dummy = location.protocol == "https:" ?  "https://javascript:void(0)" : "javascript:void(0)";
            document.write("<script id=__ie_onload defer src='" + dummy + "'><\/script>");
            document.getElementById("__ie_onload").onreadystatechange = function() {
                if (this.readyState == "complete") { domReady(); }
            };
        /*@end @*/
        
        if (/WebKit/i.test(navigator.userAgent)) { 
          this._timer = setInterval(function() {
            if (/loaded|complete/.test(document.readyState)) domReady(); 
          }, 10);
        }
        
        Event.observe(window, 'load', domReady);
        Event._readyCallbacks =  [];
    }
    Event._readyCallbacks.push(f);
  }
});

function changeColorOver(elem, clr, brclr){
	elem.style.backgroundColor = brclr;
	elem.style.color = clr;
}

function openPrint(url, width, height){
	window.status='Drukowanie';
	var okno = window.open(url,"DisplayWindow","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=no,width=" + width + ", height="+height);
	okno.moveTo((screen.availWidth/2)-(width/2),(screen.availHeight/2)-(height/2));
	okno.focus();
}





