function checkConfirm( goToUrl, confirmMessage ) {
	Check = confirm(confirmMessage);
	if(Check == true) {
		document.location.href = goToUrl;
	}
}
function checkConfirmForm( formName, confirmMessage ) {
	Check = confirm( unescape( confirmMessage ) );
	if(Check == true) {
		eval("document.forms." + formName + ".submit();");
	}
}
function DoSubmit( myFormName, mySelectField ) {
	myValue = eval("document.forms." + myFormName + "." + mySelectField + ".options[document.forms." + myFormName + "." + mySelectField + ".selectedIndex].value");
	if ( myValue != "---" ) {
		eval("document.forms." + myFormName + ".submit()");
	}
	else {
		eval("document.forms." + myFormName + "." + mySelectField + ".selectedIndex = 0");
	}
}
function Hide( elementId ) {
	document.getElementById(elementId).style.visibility="hidden";
}
function DoDelete( myDeleteUrl, myMessage ) {
	Check = confirm(myMessage);
	if(Check == true) {
		document.location.href = myDeleteUrl;
	}
}
function IsValidEmail(strFormName, strFieldName){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = eval("document." + strFormName + "." + strFieldName + ".value");

   // search email text for regular exp matches
	if (strEmail.search(validRegExp) == -1) {
	  alert('Bitte geben Sie eine gültige E-Mail Adresse ein');
	  eval("document." + strFormName + "." + strFieldName + ".focus()");
	  return false;
	} 
	return true; 
}
function CheckAllCheckboxes( _form )
{
	for (var x = 0; x < _form.elements.length; x++)
	{
		var y = _form.elements[x];
		if ( y.name.indexOf('admin_statUserSelection') != -1 )
		{
			y.checked = _form.ALLUSERS.checked;
		}
	}
}
function IsValidPrice(strPriceToCheck){
  validRegExp = /^[0-9]{1,}(|,{0,1}[0-9]{2})$/;

   // search price text for regular exp matches
	if (strPriceToCheck.search(validRegExp) == -1 || strPriceToCheck == 0) {
	  return false ;
	} else
	{
		return true ;
	}
}
function IsValidPosInteger(strIntToCheck){
  validRegExp = /^[0-9]{1,}$/;

   // search text for regular exp matches
	if (strIntToCheck.search(validRegExp) == -1 ) {
	  return false ;
	} else
	{
		return true ;
	}
}
function ToggleImage(imgId, newUrl)
{
	document.getElementById( imgId ).src = newUrl ;
}
