function showSource() {
	var oDiv=document.getElementById("pp_boks_source");
	/*var content="<table><tr><td>";
	content += "<textarea cols='15' rows='6'></textarea>";
	content += "</td></tr></table>";
	content += "";
	oDiv.innerHTML=content;

	var od1=document.createElement("div");	
	var od1txt=document.createTextNode("Kod w w sekcji <head>");
		od1.appendChild(od1txt);
		oDiv.appendChild(od1);
	var	otxt1=document.createElement("textarea");
		otxt1.setAttribute("cols","45");
		otxt1.setAttribute("rows","1");
		oDiv.appendChild(otxt1);
	var od2=document.createElement("div");
		oDiv.appendChild(od2);
	var od2txt = document.createTextNode("Modyfikacja znacznika <body>");
		od2.appendChild(od2txt);
	var otxt2 = document.createElement("textarea");	
		otxt2.setAttribute("cols","45");
		otxt2.setAttribute("rows","1");
		oDiv.appendChild(otxt2);
	var od3=document.createElement("div");
		oDiv.appendChild(od3);
	var od3txt = document.createTextNode("Kod HTML na strone.");
		od3.appendChild(od3txt);
	var otxt3 = document.createElement("textarea");	
		otxt3.setAttribute("cols","45");
		otxt3.setAttribute("rows","10");
		oDiv.appendChild(otxt3);
	var od4=document.createElement("div");
		oDiv.appendChild(od4);
	var od4txt = document.createTextNode("Style");
		od4.appendChild(od4txt);
	var otxt4 = document.createElement("textarea");	
		otxt4.setAttribute("cols","45");
		otxt4.setAttribute("rows","10");
		oDiv.appendChild(otxt4);
		
	var od5 = document.createElement("div");
		od5.setAttribute("style","cursor:pointer; text-align:right; width:100%;padding-right:20px;");
		od5.setAttribute("class","pp_zwin");
		od5.setAttribute("onclick","hideSource();");
	var od5txt = document.createTextNode("zwin");
		od5.appendChild(od5txt);
		oDiv.appendChild(od5);	
	*/
	oDiv.style.display="block";			
}
function hideSource() {
	var oDiv = document.getElementById("pp_boks_source");
		oDiv.style.display="none";
}
function menu(id) {
	$("#tabsF li.active a#" + id + " span").css("background-position", "100% -40px;");
	$("#tabsF li.active a#" + id).css("background-position", "0% -40px;");
}

/**
 * walidacja selecta czy został ustawiony dodaje clase do styli  gdy jest błąd
 * @param name nazwa selecta
 * @param domyslna_wartosc domyślna wartość pola
 * @param dodaj_styl klasa która jest dodawana do styli
 * @return true gdy zmieniony  lub false gdy nie zmie
 */
function validate_select(name,domyslna_wartosc,dodaj_styl){
    var wybrane = $("select[@name="+name+"] option:selected").val();
    if(wybrane!=domyslna_wartosc){
        //$("select[@name="+name+"]").removeClass(dodaj_styl);
        return true;
    }
    else{
        //$("select[@name="+name+"]").addClass(dodaj_styl);
        return false;
    }
}

/**
 * usuwa puste znaki
 * @param stringToTrim
 */
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}