function confirmSubmit(infotext)
{
  var agree=confirm(infotext);
  if (agree){
    return true ;
  } else {
    return false ;
  }
}

// general submit form function
function submitForm(_formName, _actionName, _actionValue)
{ 	
  	var actionName = document.getElementById(_actionName) ;
  	
  	if(actionName == null)
  	{
  		alert("Error: you have to define hidden action variable") ;
  		return ;
	}
  	actionName.value = _actionValue ;
  	document.forms[_formName].submit();

}

function submitenter(myfield,e)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)
	{
	   myfield.form.submit();
	   return false;
	}
	else
	   return true;
}

function showhide(id) 
{
	if(document.getElementById(id).style.display=='none')
	{
		document.getElementById(id).style.display='block';
	}
	else
		document.getElementById(id).style.display='none';
}

function openpopup(url)
{
	window.open(url,'popUpWindow','height=1000,width=1200,left=0,top=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}

function addtofavorite(adres,opis)
{
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(opis, adres,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( adres, opis); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}

function TakeMonth(date)
{
	jQuery.ajax
	({	
		type: "POST",
		url: "/takemonth.php",	        
		data: "date="+date,
		success: function(msg)
		{		
			jQuery('#contentContainer').html(msg);
		}		
	});
}

function ResizeDoc(height)
{
	swf = document.getElementById('FlashMenu');
	swf.height = height;
}
