// JavaScript Document

jQuery.fn.tinymce=jQuery.fn.tinyMCE=jQuery.fn.TinyMCE=function(d,e){return this.each(function(i){var a,b,c=this.id=this.id||this.name||(this.className||'jMCE')+i;if(d&&Object===d.constructor){e=d;d=null}if(!d&&tinyMCE.get(c)){d='remove';b=true}switch(d){case'remove':a='mceRemoveControl';break;case'toggle':a='mceToggleEditor';break;default:a='mceAddControl'}tinyMCE.settings=e;tinyMCE.execCommand(a,false,c);if(b)$(this).tinyMCE(e)})};

//podstawowe

function addF(){
var title = document.title; 
var url = location.href;
if (window.sidebar) { // Mozilla Firefox Bookmark
	window.sidebar.addPanel(title, url,"");
} else if( window.external ) { // IE Favorite
	window.external.AddFavorite( url, title); }
else if(window.opera && window.print) { // Opera Hotlist
	return true;
}	

}

function setH(){
var url = location.href;
if (document.all) {
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage(url);
}else if (window.sidebar){
	if(window.netscape){
    	try{
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        }
		
		catch(e){
			alert("Poziom zabezpieczeń w Twojej przeglądarce uniemożliwia wykonanie tej czynności.");
		}
	}
	
	var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
	prefs.setCharPref("browser.startup.homepage",url);
}

}


function zmien_stan(id){
	//alert(id)
	var pole=$("#"+id);
	if(pole.attr('stan')=='1'){
		$("#"+id).slideUp('slow');
		pole.attr('stan','0');
	}else {
		$("#"+id).slideDown("slow");
		pole.attr('stan','1');
	}
}

function mod_s(sc,id) {
	window.open(sc+"h/mod_strona.php?id="+id,"strona","status=no,toolbar=no,scrollbars=yes,width=750,height=720,left=0,top=50");
}

function mod_gal(id,sc) {
	window.open(sc+"h/mod_gal.php?id="+id,"strona","status=no,toolbar=no,scrollbars=yes,width=750,height=720,left=0,top=50");
}

function flash(w, h, path){

var f='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,29,0" width="'+w+'" height="'+h+'">'
+'<param name="movie" value="'+path+'" />'
+'<param name="quality" value="high" />'
+'<param name="menu" value="0" />'
+'<param name="wmode" value="opaque" />'
+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0" wmode="transparent"></embed>'
+'</object>';

return f;

 
}


function gup(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
