	
	//fce otevre novy vokno jestlize normal je false tak se nezobrazi zadne listy ani menu ani status bar, jenom scrollbary
	function cWin(url, name, w, h, resizable, menubar, toolbar) {
		var menub = (menubar == true) ? "yes" : "no";
		var toolb = (toolbar == true) ? "yes" : "no"; 
		var resiz = (resizable == true) ? "yes" : "no";
		
		//window.open(url,name,'status=no,width='+w+',height='+h+',resizable=no,menubar=no,scrollbars=yes,toolbar=no');
		sReturnedValue = window.open(url,name,'status=no,width='+w+',height='+h+',resizable='+resiz+',menubar='+menub+',scrollbars=yes,toolbar='+toolb);
	}
	
	//zobrazi confirm box
	function ask(str) {
		if (window.confirm(str)) { return true; }
		return false;
	}
	
	//funkce reloadne na zadane URL
	function reload(url) {
		window.location = url;
	}
	
	//funkce zjisti typ prohlizece a vrati: mozilla|explorer|opera
	function browser() {	
		//mozilla firebird 0.6.1	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1
		//eplorer 6.0.2600				Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 
		//opera 7.11							Opera/7.11 (Windows NT 5.1; U) [en] 
		
		if (navigator.userAgent.indexOf("Opera") > -1) { browser = "opera"; }
		else if (navigator.userAgent.indexOf("MSIE") > -1) { browser = "explorer"; }
		else if (navigator.userAgent.indexOf("Mozilla") > -1 || navigator.userAgent.indexOf("Gecko") > -1) { browser = "mozilla"; }
		
		if (navigator.userAgent.indexOf("Win") > -1) { platform = "win"; }
		else if (navigator.userAgent.indexOf("Mac") > -1) { platform = "mac"; }
		
		return browser;
	}
	 function ccWin() {
					sReturnedValue = window.open('/_MMP/fl_<?=$lang;?>.html','flash','status=no,width=800,height=600,resizable=no,menubar=no,scrollbars=no,toolbar=no');
				}
	
	function countit(obj, max_char_length){
	if (obj.value.length > max_char_length) {
		obj.value = obj.value.substring(0,max_char_length);
		return false;
	}
	
	document.getElementById('counter').innerHTML = max_char_length - obj.value.length;
}

function add_more(id, idcko, text, pocet)
{
    var ni = document.getElementById(id);
    var d_pocet = document.getElementById('pocet').value;
    if (d_pocet != '') {
      pocet = d_pocet;
    }
    pocet++;
    
		  var newdiv = document.createElement('div');
		  var divIdName = 'file_'+idcko+'_div';
		  newdiv.setAttribute('id',divIdName);
		  newdiv.innerHTML = '<p><span id="file-' + pocet + '"><input size="50" type="text" name="' + text +'[' + pocet + ']" /><br /></span></p>';
		  ni.appendChild(newdiv);
		  
		  document.getElementById('pocet').value = pocet
}

function show_reg_input()
{
  var pass        = false;
  var pass_price  = false;
  
  clear_pass('reg-pass');
  clear_pass('reg-pass-price');
  
  $( ".reg-popl:checked" ).each(function(){
    var value = $(this).attr('rel');
      
    if (value == 2)
    {
      pass = true;
    }
    else if (value == 3)
    {
      pass_price = true;
    }
  });

  if (pass || pass_price)
  {
    show_pass('reg-pass');
  }
  
  if (pass_price)
  {
    show_price('reg-pass-price');
  }
}
function show_pass(id)
{
  var str = '<strong>'+$("#"+id).attr('rel')+'*</strong> <input type="text" name="reg-pass" value="" size="15" /><input type="hidden" name="hid-reg-pass" value="true" />';
  $('#'+id).html(str);
}

function show_price(id)
{
  var str = '<strong>'+$("#"+id).attr('rel')+'*</strong> <input type="text" name="reg-pass-price" value="" size="15" /><input type="hidden" name="hid-reg-pass-price" value="true" />';
  $('#'+id).html(str);
}
function clear_pass(id)
{
  $('#'+id).html('');
}