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=480,width=640,left=0,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
}

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

function TextCounter(field, countfield, maxlimit) 
{
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else 
		countfield.value = maxlimit - field.value.length;
}

function DelayDownload(file, delay)
{
	setTimeout("window.open('"+file+"','Download')", delay);   
}

function Redirect(href)
{
	window.location.href=href;
}




