var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

var win=null;
function NewWindow2(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function remove_element( elId, areaName ) {
	var curArea = "";
	var curElement = "";

	if( curArea = document.getElementById(areaName) ) {
		if( curElement = document.getElementById(elId) ) {
			curArea.removeChild(curElement);
			delete curElement;
		}
	}

	curElement = null;
	curArea = null;
}


function add_xfoto() {
	var d_div = document.getElementById( 'div_xfoto' );
	var nd = document.createElement('div');
	g_counter_xfoto++;

	nd.innerHTML =
		"<input type=\"hidden\" name=\"h_f[" + g_counter_xfoto + "]\" value=\"" + g_counter_xfoto + "\">" +
		"popis: <input name=\"i_f_popis" + g_counter_xfoto + "\" value=\"\" class=\"input_filter\" type=\"text\" size=\"5\" style=\"width: 140px;\" />&nbsp;&nbsp;&nbsp;&nbsp;" +
		"fotka: <input class=\"input_e\" type=\"file\" name=\"f_foto" + g_counter_xfoto + "\" size=\"5\" style=\"width: 80px;\" alt=\"\" />&nbsp;&nbsp;&nbsp;&nbsp;" +
		"<br />";

	d_div.appendChild(nd);

}

