var emailregexp = /^[\w\-\.]+@([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)*[a-zA-Z0-9]+-{0,1}[a-zA-Z0-9]+(-{0,1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,4}$/;
var daysInMonth = new Array();
	daysInMonth[1] = 31;
	daysInMonth[2] = 29;   // must programmatically check this
	daysInMonth[3] = 31;
	daysInMonth[4] = 30;
	daysInMonth[5] = 31;
	daysInMonth[6] = 30;
	daysInMonth[7] = 31;
	daysInMonth[8] = 31;
	daysInMonth[9] = 30;
	daysInMonth[10] = 31;
	daysInMonth[11] = 30;
	daysInMonth[12] = 31;

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;


function chkForm(frmname,lang) {
	return checkForm(frmname);
}

function chkInviteForm(frmname){
	var frm = eval('document.'+frmname);
	if(frm["tx-srfeuserregister-pi1-first_name"]){
		if (frm["tx-srfeuserregister-pi1-first_name"].value == "") {
			alert(invitemessages[0]);
			highlight(frm["tx-srfeuserregister-pi1-first_name"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-first_name"]);
	}
	if(frm["tx-srfeuserregister-pi1-last_name"]){
		if (frm["tx-srfeuserregister-pi1-last_name"].value == "") {
			alert(invitemessages[1]);
			highlight(frm["tx-srfeuserregister-pi1-last_name"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-last_name"]);
	}
	if(frm["tx-srfeuserregister-pi1-email"]){
		if (frm["tx-srfeuserregister-pi1-email"].value == "" || !frm["tx-srfeuserregister-pi1-email"].value.match(emailregexp)) {
			alert(invitemessages[2]);
			highlight(frm["tx-srfeuserregister-pi1-email"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-email"]);
	}
	if(frm["tx-srfeuserregister-pi1-password"]){
		if (frm["tx-srfeuserregister-pi1-password"].value == "") {
			alert(invitemessages[3]);
			highlight(frm["tx-srfeuserregister-pi1-password"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password"]);
	}
	if(frm["tx-srfeuserregister-pi1-password_again"]){
		if (frm["tx-srfeuserregister-pi1-password_again"].value == "") {
			alert(invitemessages[4]);
			highlight(frm["tx-srfeuserregister-pi1-password_again"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password_again"]);
		if (frm["tx-srfeuserregister-pi1-password_again"].value != frm["tx-srfeuserregister-pi1-password"].value) {
			alert(invitemessages[5]);
			highlight(frm["tx-srfeuserregister-pi1-password_again"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password_again"]);
	}
	if(frm["tx-srfeuserregister-pi1-company"]){
		if (frm["tx-srfeuserregister-pi1-company"].value == "") {
			alert(invitemessages[6]);
			highlight(frm["tx-srfeuserregister-pi1-company"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password"]);
	}
	return true;

}
function checkForm(frmname){
	var frm = eval('document.'+frmname);
	if(frm["tx-srfeuserregister-pi1-first_name"]){
		if (frm["tx-srfeuserregister-pi1-first_name"].value == "") {
			alert(messages[0]);
			highlight(frm["tx-srfeuserregister-pi1-first_name"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-first_name"]);
	}
	if(frm["tx-srfeuserregister-pi1-last_name"]){
		if (frm["tx-srfeuserregister-pi1-last_name"].value == "") {
			alert(messages[1]);
			highlight(frm["tx-srfeuserregister-pi1-last_name"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-last_name"]);
	}
	if(frm["tx-srfeuserregister-pi1-email"]){
		if (frm["tx-srfeuserregister-pi1-email"].value == "" || !frm["tx-srfeuserregister-pi1-email"].value.match(emailregexp)) {
			alert(messages[2]);
			highlight(frm["tx-srfeuserregister-pi1-email"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-email"]);
	}
	if(frm["tx-srfeuserregister-pi1-password"]){
		if (frm["tx-srfeuserregister-pi1-password"].value == "") {
			alert(messages[3]);
			highlight(frm["tx-srfeuserregister-pi1-password"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password"]);
	}
	if(frm["tx-srfeuserregister-pi1-password_again"]){
		if (frm["tx-srfeuserregister-pi1-password_again"].value == "") {
			alert(messages[4]);
			highlight(frm["tx-srfeuserregister-pi1-password_again"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password_again"]);
		if (frm["tx-srfeuserregister-pi1-password_again"].value != frm["tx-srfeuserregister-pi1-password"].value) {
			alert(messages[5]);
			highlight(frm["tx-srfeuserregister-pi1-password_again"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password_again"]);
	}
	if(frm["tx-srfeuserregister-pi1-company"]){
		if (frm["tx-srfeuserregister-pi1-company"].value == "") {
			alert(messages[6]);
			highlight(frm["tx-srfeuserregister-pi1-company"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-password"]);
	}
	if(frm["tx-srfeuserregister-pi1-address"]){
		if (frm["tx-srfeuserregister-pi1-address"].value == "") {
			alert(messages[7]);
			highlight(frm["tx-srfeuserregister-pi1-address"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-address"]);
	}
	if(frm["tx-srfeuserregister-pi1-zip"]){
		if (frm["tx-srfeuserregister-pi1-zip"].value == "") {
			alert(messages[8]);
			highlight(frm["tx-srfeuserregister-pi1-zip"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-zip"]);
	}
	if(frm["tx-srfeuserregister-pi1-city"]){
		if (frm["tx-srfeuserregister-pi1-city"].value == "") {
			alert(messages[9]);
			highlight(frm["tx-srfeuserregister-pi1-city"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-city"]);
	}
	if(frm["tx-srfeuserregister-pi1-static_info_country"]){
		if (frm["tx-srfeuserregister-pi1-static_info_country"].value == "") {
			alert(messages[10]);
			highlight(frm["tx-srfeuserregister-pi1-static_info_country"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-static_info_country"]);
	}
	if(frm["tx-srfeuserregister-pi1-telephone"]){
		if (frm["tx-srfeuserregister-pi1-telephone"].value == "") {
			alert(messages[11]);
			highlight(frm["tx-srfeuserregister-pi1-telephone"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-telephone"]);
	}
	if(frm["tx-srfeuserregister-pi1-language"]){
		if (frm["tx-srfeuserregister-pi1-language"].value == "") {
			alert(messages[12]);
			highlight(frm["tx-srfeuserregister-pi1-language"]);
			return false;
		}else removeHighlight(frm["tx-srfeuserregister-pi1-language"]);
	}
	if(frm.firstname){
		if (frm.firstname.value == "") {
			alert(messages[0]);
			highlight(frm.firstname);
			return false;
		}else removeHighlight(frm.firstname);
	}
	if(frm.lastname){
		if (frm.lastname.value == "") {
			alert(messages[1]);
			highlight(frm.lastname);
			return false;
		}else removeHighlight(frm.lastname);
	}
		if(frm.email){
		if(frm.email.value == "" || !frm.email.value.match(emailregexp)) {
			alert(messages[2]);
			highlight(frm.email);
			return false;
		}else removeHighlight(frm.email);
	}
	if(frm.country){
		if(frm.country.value == "") {
			alert(messages[10]);
			highlight(frm.country);
			return false;
		}else removeHighlight(frm.country);
	}
	if(frm.message){
		if(frm.message.value == "") {
			alert(messages[22]);
			highlight(frm.message);
			return false;
		}else removeHighlight(frm.message);
	}
	if(frm.termsofuse){
		if(!frm.termsofuse.checked) {
			alert(messages[23]);
			highlight(frm.termsofuse);
			return false;
		}else removeHighlight(frm.termsofuse);
	}

	return true;
}

 
function removeHighlight(el){
	el.style.background = '#ffffff';
	if(isIE) el.style.border = '1px solid #7F9DB9';
	if(document.getElementById('p'+el.name))
	document.getElementById('p'+el.name).style.color = '#000000';
}
function highlight(el){
	el.focus();
	el.style.background = '#EC641F';
	if(document.getElementById('p'+el.name))
	document.getElementById('p'+el.name).style.color = '#EC641F';
}

function changeCountry(){
	var frm = document.forms['tx-srfeuserregister-pi1-fe_users_form'];
	var selCountry = frm["tx-srfeuserregister-pi1-static_info_country"].value;
	resetLanguage();
	if(selCountry=='BEL'){
		frm["tx-srfeuserregister-pi1-language"].options[0] = null;
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
		frm["tx-srfeuserregister-pi1-language"].options[1] = new Option('Dutch','NL',false,true);
		frm["tx-srfeuserregister-pi1-language"].options[0].selected=true;
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = new Option('Benelux','2',false,true);
	}
	else if(selCountry=='DEU'){
		frm["tx-srfeuserregister-pi1-language"].options[0] = null;
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('German','DE',false,true);
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = null;
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = new Option('Germany','6',false,true);
	}
	else if(selCountry=='POL'){
		frm["tx-srfeuserregister-pi1-language"].options[0] = null;
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Polish','PL',false,true);
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = null;
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = new Option('Poland','3',false,true);
	}
	else if(selCountry=='FRA'){
		frm["tx-srfeuserregister-pi1-language"].options[0] = null;
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = null;
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = new Option('France','4',false,true);
	}
	else if(selCountry=='ITA'){
		frm["tx-srfeuserregister-pi1-language"].options[0] = null;
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Italian','IT',false,true);
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = null;
		frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[1] = new Option('Italy','7',false,true);
	}
	else{
		if(frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].length > 1){
			for(i=1;i<frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].length;i++){
				frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].options[i] = null;
			}
		}
	}
}

function resetLanguage(){
	var frm = document.forms['tx-srfeuserregister-pi1-fe_users_form'];
	if(frm["tx-srfeuserregister-pi1-language"].options[0].value != 'EN'){
		for(i=0;i<frm["tx-srfeuserregister-pi1-language"].length;i++){
			frm["tx-srfeuserregister-pi1-language"].options[i] = null;
		}
		frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('English','EN',false,true);
	}
}

function changeVersion(){
	var frm = document.forms['tx-srfeuserregister-pi1-fe_users_form'];
	var selVersion = frm["tx-srfeuserregister-pi1-tx_prittfeuser_selectedversion"].value;
	for(i=0;i<frm["tx-srfeuserregister-pi1-language"].length;i++){
			frm["tx-srfeuserregister-pi1-language"].options[i] = null;
		}
			if(selVersion==1){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('English','EN',false,true);
			}
			if(selVersion==2){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
				frm["tx-srfeuserregister-pi1-language"].options[1] = new Option('Dutch','NL',false,true);
			}
			if(selVersion==3){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Polish','PL',false,true);
			}
			if(selVersion==4){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
			}
			
			
/*					
			if(selVersion==5){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('English','EN',false,true);
			}*/
			if(selVersion==6){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('German','DE',false,true);
			}
			if(selVersion==7){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Italian','IT',false,true);
			}

}

function checkVersion(){
	var frm = document.forms['tx-srfeuserregister-pi1-fe_users_form'];
	if(frm){
		if(frm["tx-srfeuserregister-pi1-tx_prittfeuser_registrationversion"]){
			var selVersion = frm["tx-srfeuserregister-pi1-tx_prittfeuser_registrationversion"].value;
				for(i=0;i<frm["tx-srfeuserregister-pi1-language"].length;i++){
					frm["tx-srfeuserregister-pi1-language"].options[i] = null;
				}
			if(selVersion==1){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('English','EN',false,true);
			}
			if(selVersion==2){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
				frm["tx-srfeuserregister-pi1-language"].options[1] = new Option('Dutch','NL',false,true);
			}
			if(selVersion==3){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Polish','PL',false,true);
			}
			if(selVersion==4){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('French','FR',false,true);
			}
			if(selVersion==5){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('English','EN',false,true);
			}
			if(selVersion==6){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('German','DE',false,true);
			}
			if(selVersion==7){
				frm["tx-srfeuserregister-pi1-language"].options[0] = new Option('Italian','IT',false,true);
			}
		}
	}
}
//##########################################
// Additional validation functions
//##########################################
function isNumber(val){
if (val == "") return false;
  for (var i = 0; i< val.length; i++) {
    if (val.charAt(i) < "0" || val.charAt(i) > "9")
      return false;
  }    
  return true;
}

//##########################################
function isIntegerInRange (intVar, intLow, intHigh){
    return ((intVar >= intLow) && (intVar <= intHigh));
}
//##########################################
function isDay (intDay){
	return isIntegerInRange (intDay, 1, 31);
}

function isMonth (intMonth){
	return isIntegerInRange (intMonth, 1, 12);
}

function isYear (intYear){
    return isIntegerInRange (intYear, 1900, 2009);
}

function daysInFebruary (intYear){		// February has 29 days in any year evenly divisible by four,
    								// EXCEPT for centurial years which are not also divisible by 400.
    return (  ((intYear % 4 == 0) && ( (!(intYear % 100 == 0)) || (intYear % 400 == 0) ) ) ? 29 : 28 );
}


//##########################################
function isDate (intYear, intMonth, intDay){
    if (! (isYear(intYear) && isMonth(intMonth) && isDay(intDay))) return false;

    // catch invalid days, except for February
    if (intDay > daysInMonth[intMonth]) return false; 

    if ((intMonth == 2) && (intDay > daysInFebruary(intYear))) return false;

    return true;
}
//##########################################
function IsValidDate(strDate){
	var blnIsDate = false;
	
	var objRegExp = /^(\d{2})\.(\d{2})\.(\d{4})$/;
	blnIsDateFormat = objRegExp.test(strDate);
	if (blnIsDateFormat){
		objRegExp.exec(strDate);
		intDay 		= parseInt(RegExp.$1, 10);
		intMonth 	= parseInt(RegExp.$2, 10);
		
		if (RegExp.$3.length == 2){
			intYear = parseInt("19"+ RegExp.$3, 10);
		}
		else if(RegExp.$3.length == 4){
			intYear		= parseInt(RegExp.$3, 10);
		}
		else {
			return false;
		}
		blnIsDate = isDate(intYear,intMonth,intDay);
	}
	return blnIsDate;
}


function changeProductGroup(){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	if(frm["tx_prittlayoutwizard_pi1[preview]"])frm["tx_prittlayoutwizard_pi1[preview]"].value=0;
	if(frm["tx_prittlayoutwizard_pi1[productgroup]"].value != ''){
		frm["tx_prittlayoutwizard_pi1[displaypage]"].value = 'page4';
		if(frm["tx_prittlayoutwizard_pi1[product]"]){
			frm["tx_prittlayoutwizard_pi1[product]"].value = '';
		}
		frm.submit();
	}
}

function changeProduct(){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	frm["tx_prittlayoutwizard_pi1[displaypage]"].value = 'page5';
	if(frm){
	if(frm["tx_prittlayoutwizard_pi1[preview]"])frm["tx_prittlayoutwizard_pi1[preview]"].value=0;
	}
	if(frm["tx_prittlayoutwizard_pi1[product]"].value != '')
	frm.submit();
}


function checkAssets(){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	var check = false;
	var errorMsg = '';
	if(!frm["tx_prittlayoutwizard_pi1[productimage]"].length){
		check = frm["tx_prittlayoutwizard_pi1[productimage]"].checked;
	}else{
		for(var i=0;i<frm["tx_prittlayoutwizard_pi1[productimage]"].length;i++){
			if(frm["tx_prittlayoutwizard_pi1[productimage]"][i].checked) check = true;
		}
	}
	if(!check){
		errorMsg = messages[13];
	}
	if(!frm["tx_prittlayoutwizard_pi1[selectedTextBox]"].checked){
		errorMsg += '\n'+messages[14];
	}
	if(errorMsg == ''){
		frm["tx_prittlayoutwizard_pi1[preview]"].value=1;
		frm.submit();
	}
	else{
		alert(errorMsg);
		return;
	}
}

function removePreview(){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	if(frm){
	if(frm["tx_prittlayoutwizard_pi1[preview]"])frm["tx_prittlayoutwizard_pi1[preview]"].value=0;
	}
}


function checkFilename(){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	var val = frm["tx_prittlayoutwizard_pi1[zipfilename]"].value;
	if(frm["tx_prittlayoutwizard_pi1[filecount]"].value > 15){
		alert(messages[15]);
		return false;
	}
	if(val==''){
		alert(messages[16]);
		return false;
	}
	else if(!isValidString(val)){
		alert(messages[17]);
		return false;	
	}
	return true;
}

function changeRes(mode){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	var curVal = frm["tx_prittlayoutwizard_pi1[resolution]"].value;
	if(frm["tx_prittlayoutwizard_pi1[preview]"])frm["tx_prittlayoutwizard_pi1[preview]"].value=0;
	if(mode != curVal){
		frm["tx_prittlayoutwizard_pi1[resolution]"].value = mode;
		frm.submit();
	}
}

function deleteFile(filename){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	if(confirm(messages[18]+filename+'"?')){
		frm["tx_prittlayoutwizard_pi1[deletefile]"].value = filename;
		if(frm["tx_prittlayoutwizard_pi1[displaypage]"]){
		val = frm["tx_prittlayoutwizard_pi1[displaypage]"].value;
		cur = val.charAt(4);
		if(cur==7 && frm["tx_prittlayoutwizard_pi1[preview]"]){
		 cur = 'page'+(cur-1);
		 frm["tx_prittlayoutwizard_pi1[preview]"].value = 1;
		}
		else if(cur!=7&&cur!=5&&cur!=8) cur = 'page'+(cur-1)
		else cur = 'page'+cur;
		frm["tx_prittlayoutwizard_pi1[displaypage]"].value = cur;
		}
		frm.submit();
	}

}

function deleteFileold(filename){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	if(confirm(messages[18]+filename+'"?')){
		frm["tx_prittlayoutwizard_pi1[deletefile]"].value = filename;
		if(frm["tx_prittlayoutwizard_pi1[displaypage]"]){
		val = frm["tx_prittlayoutwizard_pi1[displaypage]"].value;
		cur = val.charAt(4);
		if(cur==6 && frm["tx_prittlayoutwizard_pi1[preview]"]){
		 cur = 'page'+(cur-1);
		 frm["tx_prittlayoutwizard_pi1[preview]"].value = 1;
		}
		else if(cur!=6&&cur!=4&&cur!=7) cur = 'page'+(cur-1)
		else cur = 'page'+cur;
		frm["tx_prittlayoutwizard_pi1[displaypage]"].value = cur;
		}
		frm.submit();
	}

}
function mailFile(filename){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	frm["tx_prittlayoutwizard_pi1[mailfile]"].value = filename;
	frm["tx_prittlayoutwizard_pi1[displaypage]"].value = 'page8';
	frm.submit();
}

function isValidString(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123 || h==32))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

function changeProductCategory(frmname){
	if(frmname){
		var frm = eval("document.forms['"+frmname+"']");
		var val = eval("document.forms['"+frmname+"']" + '["'+frmname + '[category]"]').value;
		if(val!=''){
			if(eval("document.forms['"+frmname+"']" + '["'+frmname + '[product]"]')){
			eval("document.forms['"+frmname+"']" + '["'+frmname + '[product]"]').value = '';
			eval("document.forms['"+frmname+"']" + '["'+frmname + '[product]"]').selectedIndex = -1;
			}
			else if(eval("document.forms['"+frmname+"']" + '["'+frmname + '[asset]"]')){
			eval("document.forms['"+frmname+"']" + '["'+frmname + '[asset]"]').value = '';
			eval("document.forms['"+frmname+"']" + '["'+frmname + '[asset]"]').selectedIndex = -1;
			}

			frm.submit();
		}
	}
	else{
	var frm = document.forms['tx_prittextranetproducts_pi1'];
	if(frm["tx_prittextranetproducts_pi1[category]"].value != ''){
		frm["tx_prittextranetproducts_pi1[product]"].value = '';
		frm["tx_prittextranetproducts_pi1[product]"].selectedIndex = -1;
		frm["tx_prittextranetproducts_pi1[searchword]"].value='';
		frm.submit();
	}
	}
}

function selectProduct(){
	var frm = document.forms['tx_prittextranetproducts_pi1'];
	if(frm["tx_prittextranetproducts_pi1[product]"].value != '')
	frm.submit();
}

function checkEmail(frmname){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	if(frm["tx_prittlayoutwizard_pi1[recipient]"].value == ''){
		alert(messages[19]);
		return false;
	}
	if(frm["tx_prittlayoutwizard_pi1[subject]"].value == ''){
		alert(messages[20]);
		return false;
	}
	if(frm["tx_prittlayoutwizard_pi1[mailfile]"].value == ''){
		alert(messages[21]);
		return false;
	}
	return true;
}
function checkEmail2(){
	var frm = document.forms['tx_prittproductfiles_pi1'];
	if(frm["tx_prittproductfiles_pi1[recipient]"].value == ''){
		alert(messages[19]);
		return false;
	}
	if(frm["tx_prittproductfiles_pi1[subject]"].value == ''){
		alert(messages[20]);
		return false;
	}
	return true;
}

function cl(sender)
{
if (sender.alreadyChecked)
sender.checked = false;
}

function md(sender)
{
sender.alreadyChecked = sender.checked;
}

function setJump(val){
	var frm = document.forms['tx_prittlayoutwizard_pi1'];
	var newaction = frm.action+'#'+val;
	frm.action = newaction;
}