/**
 * @author Rafał Oleśkowicz
 * użycie: <a href='javascript:potwierdzenie("Czy napewno usunąć?","usunmenu");'>usuń</a>
 * użycie: <a href='#' onclick='potwierdzenie("Czy napewno usunąć?","usunmenu");'>usuń</a>
 */
function potwierdzenie(pytanie,akcja)
{
	var answer = confirm(pytanie)
	if(answer)
		window.location=akcja;
	return void(null);
}

function pokazpotwierdzenie(warstwanosna,pytanietext,akcjatext,poziom)
{
	//defaultowy poziom to taki w ktorym sie znajdujemy
	if(!poziom || poziom=="")poziom=".";
	//wgrywam flashe
	swfobject.embedSWF(poziom+"/media/desktop/potwierdzenie.swf","pot", "410", "130", "9.0.0",poziom+"/media/desktop/expressInstall.swf",{pytanie:pytanietext,warstwa:warstwanosna,akcja:akcjatext},{wmode:"transparent",quality:"high"},{id:warstwanosna});
	//ustalam pozycje
	document.getElementById(warstwanosna).style.top=Math.round((wysokoscbody()-130)/2)+"px";
	document.getElementById(warstwanosna).style.left=Math.round((szerokoscbody()-410)/2)+"px";
	//wyswietlam warstwe
	document.getElementById(warstwanosna).style.display="block";	
}

function zamknijpotwierdzenie(warstwa)
{
	document.getElementById(warstwa).style.display="none";
}

function wykonajpotierdzenie(warstwa,akcja)
{
	zamknijpotwierdzenie(warstwa);
	window.location=akcja;
}

function wysokoscbody()
{
	if( typeof( window.innerWidth ) == 'number' )
		myHeight = window.innerHeight;
	else
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			myHeight = document.documentElement.clientHeight;
		else
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			        myHeight = document.body.clientHeight;
	return myHeight; 
}
function szerokoscbody()
{
	if( typeof( window.innerWidth ) == 'number' )
		myWidth=window.innerWidth;
	else
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			myWidth=document.documentElement.clientWidth; 
		else
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			        myWidth=document.body.clientWidth;
	return myWidth;
}
