// JavaScript Document



function linki(d1 , d2)

{



d1 = document.getElementById(d1).value;

d2 = document.getElementById(d2).value;


	r = '<a href="http://'+d1+'"  target="_blanc" class="alinkFile">'+d2+'</a>';

	 modul['linki'] = r ;

	

modul('linki');

popup.cancel();

}


function linki_e(d1 )
{


d1 = document.getElementById(d1).value;



	r = '<a href="mailto:'+d1+'"  target="_blanc" class="alinkFile">'+d1+'</a>';

	 modul['linki_e'] = r ;

	

modul('linki_e');

popup.cancel();

}


function linki_w(d1 , d2, d3)
{


var selected_id = document.getElementById(d1).selectedIndex;
var id = document.getElementById(d1).options[selected_id].value;

d2 = document.getElementById(d2).value;
var selected = document.getElementById(d3).selectedIndex;
var style = document.getElementById(d3).options[selected].value;

	r = '<a href="index.php?page='+id+'" style="'+style+'; color:blue; font-family:Tahoma; font-size:12px; font-weight:bold; ;" >'+d2+'</a>';
	 modul['linki_w'] = r ;
	
modul('linki_w');
popup.cancel();
}



function content(d1)

{



var d1 = d1;

	if(d1 == 1)

	{

		r = '<table width="600" border="1">';

		r += '<tr>';

		r += '		<td colspan="2" height="120" align="left" valign="top">&nbsp;</td>  ';

		r += '	  </tr>';

		r += '	  <tr >';

		r += '		<td width="200" height="400" align="left" valign="top">&nbsp;</td>';

		r += '		<td width="400" height="400" align="left" valign="top">&nbsp;</td>';

		r += '	  </tr>';

		r += '	  <tr>';

		r += '		<td colspan="2" height="70" align="left" valign="top">&nbsp;</td>';

		r += '	  </tr>';

		r += '	</table>';

		 modul['content_1'] = r ;

		

	modul('content_1');

	popup.cancel();

	}

}

function zmianaWielkosciCzcionki()
{

		var selected = document.getElementById('czcionkasize').selectedIndex;
		var size = document.getElementById('czcionkasize').options[selected].value;
		editor.command('fontsize', size);

}



function zmianaRodzinyCzcionki()
{
		var selected = document.getElementById('czcionka').selectedIndex;
		var name = document.getElementById('czcionka').options[selected].value;
		editor.command('fontname', name);
}

function setcolor(color_value)
{
	editor.command('forecolor', color_value);
	document.getElementById('color_picker').style.display='none';
}

function changepg_style(font, size , color, d1)
{
editor.command('fontname', font);	
editor.command('fontsize', size);
editor.command('forecolor', color);	
	if(d1 != 0)
	{
	editor.command(''+d1+'', null)
	}
		
}

//Obsluga modulow

function modul(genius) {



var genius = genius;

if (document.getElementById('edytor2').contentDocument)

	{  

		var iframe = document.getElementById('edytor2').contentDocument;

	} 

	else 

	{

		var iframe = document.frames['edytor2'].document;

	}

	

	var new_element = iframe.createElement("div");

	new_element.innerHTML = modul[genius];

	



	iframe.body.appendChild(new_element);

	

	popup.cancel();



}

function validate()
{
	if(document.kontakt.imie.value.length<1)
	{
	window.alert("Podaj imie"),
	document.kontakt.imie.focus()
	;return false;
	}
	
	
	if(document.kontakt.nazwisko.value.length<1)
	{
	window.alert("Podaj nazwisko"),
	document.kontakt.nazwisko.focus()
	;return false;
	}
	

	if(document.kontakt.login.value.length<5)
	{
	window.alert("Podaj login ( min. 5 znaków )"),
	document.kontakt.login.focus()
	;return false;
	}
	
	if(document.kontakt.pass_1.value.length<5)
	{
	window.alert("Podaj hasło ( min. 5 znaków )"),
	document.kontakt.pass_1.focus()
	;return false;
	}
	
	if(document.kontakt.pass_2.value.length<5)
	{
	window.alert("Powtórz hasło ( min. 5 znaków )"),
	document.kontakt.pass_2.focus()
	;return false;
	}
	
	if(document.kontakt.pass_1.value != document.kontakt.pass_2.value)
	{
	window.alert("Hasła nie pasują"),
	document.kontakt.pass_1.focus()
	;return false;
	}
	
	
	
	
	return true;
	
	

}

var ie = navigator.appName == "Microsoft Internet Explorer";

function viewHTMLcode() {
if(ie)
document.getElementById("edytortekstu").text.value = parent.frames["edytor2"].document.body.innerHTML;
else
document.getElementById("edytortekstu").text.value = parent.document.getElementById("edytor2").contentDocument.body.innerHTML;
document.getElementById("edytor2").style.display = 'none';
document.getElementById("back").style.display = 'block';
document.getElementById("viewHTML").style.display = 'none';
document.getElementById("edytortekstu").text.style.display = 'block';
document.getElementById("edytortekstu").text.style.height = document.getElementById("edytor2").style.height;
}

function backview() {
if(ie)
parent.frames["edytor2"].document.body.innerHTML = document.getElementById("edytortekstu").text.value;
else
parent.document.getElementById("edytor2").contentDocument.body.innerHTML = document.getElementById("edytortekstu").text.value;
document.getElementById("edytor2").style.display = 'block';
document.getElementById("back").style.display = 'none';
document.getElementById("viewHTML").style.display = 'block';
document.getElementById("edytortekstu").text.style.display = 'none';
document.getElementById("edytor2").style.height = document.getElementById("edytortekstu").text.style.height;
}
