<!--
//================================================================================================
//OTHER GLOBAL JSV VARS
var jsvCurrWindow = "";

//================================================================================================
//ACCESS METHODS

function getCurrWindow( ){
return jsvCurrWindow;	
}

function getDocSubject( ){
return jsvDocSubject;
}

function getReplicaid( ){
return jsvReplicaid;
}

function getPCType( ){
return jsvPCType;
}

function getCurrSystemPhase( ){
return jsvCurrSystemPhase;
}

function getThisDatabase( ){
return jsvThisDatabase;
}

function getAbstract( ){
return jsvAbstract;
}

function getErrorPCOptions( ){
return jsvErrorPCOptions;
}

function getStartDbFile() {
return jsvStartDbFile;
}

function getLayoutTypes() {
return jsvLayoutTypes;
}

function getContentTypes() {
return jsvContentTypes;
}

function getWebPath() {
return jsvWebPath;
}

function getUserNameCN () {
return jsvUserNameCN;
}

function getCurrFullDbName() {
return jsvCurrFullDbName;
}

function getCurrFullPath() {
return jsvCurrFullPath;
}

function getCurrNotesServer() {
return jsvCurrNotesServer;
}

function getCurrDbName() {
return jsvCurrDbName;
}

function getWebfilepath() {
return jsvWebfilepath;
}

function getServername() {
return jsvServername;
}

function getContentGenDbFile() {
return jsvContentGenDbFile;
}

function getAdminDbFile() {
return jsvAdminDbFile;
}

function getHasMail() {
return jsvHasMail;
}

function getDocType() {
return jsvDocType;
}

function getReplicaid() {
return jsvReplicaid;
}

function getTCDirDbFile() {
return jsvTCDirDbFile;
}

function getCustDirDbFile() {
return jsvCustDirDbFile;
}

function getExtSSearchDbFile() {
return jsvTCDirDbFile;
}

function getIntSSearchDbFile() {
return jsvIntSSearchDbFile;
}

function getHelpDbFile() {
return jsvHelpDbFile;
}

function getSuggestDbFile() {
return jsvSuggestDbFile;
}

function getContentIntDbFile() {
return jsvContentIntDbFile;
}

function getContentSSLDbFile() {
return jsvContentSSLDbFile;
}

function getWebRequestsDbFile() {
return jsvWebReqDbFile;
}

function getUserPrefLanguage( ) {
return jsvUserPrefLanguage;
}

function getUserRoles( ) {
return jsvUserRoles;
}

function getIsLoaded( ) {
return jsvIsLoaded;
}

function getDateValFormat( ) {
return jsvDateValFormat;
}


function getPrefLanguage( ) {
//This function does not handle if the fldUserPrefLanguage is null. Would it ever be?
var jsvCkPrefLanguage = getCookie( "ckPrefLanguage" );
if( jsvUserPrefLanguage != jsvCkPrefLanguage ) {
	if( jsvCkPrefLanguage == null ) {
		setCookie( "ckPrefLanguage", jsvUserPrefLanguage )
	}
}
return getCookie( "ckPrefLanguage" );
}

function setCurrWindow( windowObj ){
jsvCurrWindow = windowObj;
}

function setGlobalLangPref( newVal ) {
jsvGlobalLangPref = newVal;
}

function setContentGenDbFile( newVal ) {
jsvContentGenDbFile = newVal;
}

function setContentIntDbFile( newVal ) {
jsvContentIntDbFile = newVal;
}

function setContentSSLDbFile( newVal ) {
jsvContentSSLDbFile = newVal;
}

function setDocSubject( newVal ){
jsvDocSubject = newVal;
}

function setReplicaid( newVal ){
jsvReplicaid = newVal;
}

function setPCType( newVal ){
jsvPCType = newVal;
}

function setThisDatabase( newVal ){
jsvThisDatabase = newVal;
}

function setAbstract( newVal ){
jsvAbstract = newVal;
}

//================================================================================================
//GLOBAL METHODS


function fgAddMM( thisObj, windowURL ) {
setCurrWindow( thisObj );
//	alert( window.name );
//	var thisHost = location.hostname;
var thisHost = jsvServername
//	alert(thisHost);

//     var enContentGenDbFile = jsvEnContentGenDbFile;
//	alert(jsvEnContentGenDbFile);

var newURL = "http://" + thisHost + "/" +  jsvGraficGenDbFile + "/" + windowURL;
//	alert( newURL );
window.open( newURL , "MMWindow", "resizable=1,scrollbars=1,menubar=0,toolbar=0,location=0,left=0,top=0,directories=0,width=800,height=600" ) ;
}

function refreshFrame( frameObject ) {
var currLocation = frameObject.location.href;
frameObject.location.href = currLocation;
}

function stringReplace( originalString, findText, replaceText) {
var pos = 0;
var len = findText.length;
pos = originalString.indexOf( findText );
	while( pos != -1 ) {
		preString = originalString.substring( 0, pos );
		postString = originalString.substring( pos + len, originalString.length );
		originalString = preString + replaceText + postString;
		pos = originalString.indexOf( findText);
	}
//	alert( originalString );
	return originalString;
}

function openPCWindow( windowURL, wWidth, wHeight, wType ) {
//	alert( windowURL + "     " + wType );
//wType may be null, "int", "ext".  null and "int" will open a window with no toolbar. "ext" opens a new full browser.
// Modificado.  Todo se abre sin barras y redimensionable.
var currLftPositionTC = getCookie( "lftPositionTC" );
if( currLftPositionTC == null || currLftPositionTC == 0){ 
	var lftPosition = 5;
	setCookie( "lftPositionTC", lftPosition );
}else{
	var currLftPositionTCInt = parseInt( currLftPositionTC );
	if( currLftPositionTCInt < 46 ){
	var lftPosition = currLftPositionTCInt + 5;
	setCookie( "lftPositionTC", lftPosition );
	}else{
	var lftPosition = 50;
	setCookie( "lftPositionTC", 0 );
	}
}

var currTopPositionTC = getCookie( "topPositionTC" );
if( currTopPositionTC == null || currTopPositionTC == 0){ 
	var topPosition = 5;
	setCookie( "topPositionTC", topPosition );
}else{
	var currTopPositionTCInt = parseInt( currTopPositionTC );
	if( currTopPositionTCInt < 46 ){
	var topPosition = currTopPositionTCInt + 5;
	setCookie( "topPositionTC", topPosition );
	}else{
	var topPosition = 50;
	setCookie( "topPositionTC", 0 );
	}
}

var currWinNumTC = getCookie( "winNumTC" );
if( currWinNumTC == null || currWinNumTC == 0 ){ 
	var windowName = "PCWindow";
	setCookie( "winNumTC", "1" );
}else{
	var currWinNumTCInt = parseInt( currWinNumTC );
	if( currWinNumTCInt <= 9 ){
	var windowName = "PCWindow" + currWinNumTC;
	setCookie( "winNumTC", currWinNumTCInt + 1 );
	}else{
	var windowName = "PCWindow10";
	setCookie( "winNumTC", 0 );
	}
}

if( wWidth == "" ){ wWidth = 800 };
if( wHeight == "" ){ wHeight = 600 };


if (wType == "ext") {
   if (windowURL.toLowerCase().indexOf("http://") < 0) {windowURL = "http://" + windowURL};
   window.open( windowURL , windowName, "resizable=1,scrollbars=1,menubar=0,toolbar=0,location=0,left=0,top=0, directories=1,width="+wWidth+",height="+wHeight ) ;
} else {
   window.open( windowURL , windowName, "resizable=1,scrollbars=1,menubar=0,toolbar=0,location=0,left=0,top=0,directories=0,width="+wWidth+",height="+wHeight ) ;
}

if (wType == "int") {
//	alert( windowURL ) ;
  if (windowURL.toLowerCase().indexOf("http://") < 0) {windowURL = "http://" + windowURL};
   window.open( windowURL , windowName, "resizable=1,scrollbars=1,menubar=0,toolbar=0,location=0,left=0,top=0,directories=0,width="+wWidth+",height="+wHeight ) ;
}



}


function openDialogBox( windowURL ) {
window.open( windowURL , "DialogBox", "resizable=1,scrollbars=1,menubar=0,toolbar=0,location=0,top=100,left=200,directories=0,width=350,height=300,alwaysRaised=1") ;
}

function getQStrValue( param) {
qStr = top.location.search;
//alert( qStr );
var parameter = param+"=";
var startOfParam = qStr.indexOf( parameter );
if( startOfParam != -1 ) {
var n = qStr.substring( 0, startOfParam );
var nLen = n.length;
var m = qStr.substring( nLen, qStr.length );
	// get the end position of the parameter
	var nextAmp = m.indexOf( "&" );
	if( nextAmp == -1 ){
	//this is the last parameter, get the value
	return m.substring( parameter.length, m.length );
	}else{
	//get the value between start of m and nextAmp
	return m.substring( m.indexOf("=")+1, nextAmp )
	}
}else{
var result = "Parameter Unknown"
}
return result;
}

function contentTool( ){
var toolTypeStr = "contentgen";
var startFile = getStartDbFile( );
var serverName = getServername( );
var userLang = getUserPrefLanguage( );
var newURL = "http://" + serverName + "/" + startFile + "/frmPCDialog?OpenForm&pctype=" + toolTypeStr + "&userlang="+userLang.toLowerCase();
openDialogBox( newURL );
}

function pcTool( toolType ){
//toolType shall be one of the following string values: "content", "product", or "library"
var toolTypeStr = "";
switch (toolType ){
	case "content" :
		toolTypeStr = "contentgen";
		break
	case "product" :
		toolTypeStr = "productgen";
		break
	case "library" :
		toolTypeStr = "contentint";
		break
	case "synchtypes" :
		toolTypeStr = "synchtypes"
		break
	default :

}

var startFile = getStartDbFile( );
var serverName = getServername( );
var userLang = getUserPrefLanguage( );
var newURL = "http://" + serverName + "/" + startFile + "/" + userLang + "frmPCDialog?OpenForm&pctype=" + toolTypeStr + "&userlang="+userLang.toLowerCase();

openDialogBox( newURL );

}

function pcView( pcCategory, pcDbType, pcOpenType, pcDisplayValue ){
//pcDbType shall be one of the following string values: "gen", "int", "ssl", "webrequests".  If not received, defaults to "gen"
//pcCategory accepts a view name or key
//pcOpenType accepts "product", "content" or "view.  If not received, defaults to "content"
var pcDbStr = "";
var pcDocView = "";
var userName = getUserNameCN( );
var pcName = "";
// Set defaults
                if (!pcDbType){pcDbType = "gen"};
                if (!pcOpenType){pcOpenType = "content"};

// Set database file name
	if( pcDbType == "gen" ){
		pcDbStr = getContentGenDbFile( );
		}else{
	if( pcDbType == "int" ){
		pcDbStr = getContentIntDbFile( );
		}else{
	if( pcDbType == "ssl" ){
		pcDbStr = getContentSSLDbFile( );
		} else {
      if( pcDbType == "webrequests" ){
		pcDbStr = getWebRequestsDbFile();
		}

	}
	}
      }

// Set view name
                if (pcOpenType == "content") {pcDocView = "frmViewContentDefault"};
                if (pcOpenType == "product") {pcDocView = "frmViewProductDefault"};
                if (pcOpenType == "view") {pcDocView = pcCategory};

//Set display name
            if (pcDisplayValue != "" ) {
               pcName = pcDisplayValue.toLowerCase();       
            } else {
               pcName = pcCategory.toLowerCase();
            }
var serverName = getServername( );
            if (pcOpenType == "content" || pcOpenType == "product") {
          
	    		   if( userName != "Anonymous" ){
            		var newURL = "http://" + serverName + "/" + pcDbStr + "/" + pcDocView + "?ReadForm&type="  + pcCategory.toLowerCase() + "&name=" + pcName + "&login";
       			}else{			
      	             var newURL = "http://" + serverName + "/" + pcDbStr + "/" + pcDocView + "?ReadForm&type="  + pcCategory.toLowerCase() + "&name=" + pcName  + "&";
		         }

	        } else {

		        if( userName != "Anonymous" ){
				     var newURL = "http://" + serverName + "/" + pcDbStr + "/" + pcCategory +  "?OpenView&login";
   			  }else{
         	     var newURL = "http://" + serverName + "/" + pcDbStr + "/" + pcCategory +  "?OpenView";
		   	  }

          }

//var newURL = "http://" + serverName + "/" + pcDbStr + "/" + pcDocView + "/" + pcCategory.toLowerCase() + //"?OpenDocument";
//alert( "newURL = " + newURL );
top.frameApplication.frameMainFrame.location.href = newURL;
}


//================================================================================================
//COOKIE CODE

function getCookie( name ) {
	var result = null;
	var myCookie = " " + document.cookie + "; ";
	var searchName = " " + name + "=";
	var startOfCookie = myCookie.indexOf( searchName );
	var endOfCookie;
	if( startOfCookie != -1 ) {
		startOfCookie += searchName.length;
		endOfCookie = myCookie.indexOf(";", startOfCookie);
		result = unescape( myCookie.substring( startOfCookie, endOfCookie ));
		}
	return result;
}


function setCookie( name, value) {
	var oneDay = 1 * 24 * 60 * 60 * 1000;
	var expDate = new Date( );
	expDate.setTime( expDate.getTime( ) + oneDay);
	var expString = "; expires=" + expDate.toGMTString();
	var pathString = "; path=/";
	document.cookie = name + "=" + escape(value) + expString + pathString;
}


//================================================================================================
//FIELD VALIDATION CODE

function getCheckedValues( theField ){
var theValue = "";
var sep = "; "; 
var hits = 0;
for (i=0; i<theField.length; i++) {
	if(theField[i].checked) {
	hits++;
	if(hits>1) {
		theValue = theValue + sep + theField[i].value;
	}else{
		theValue = theField[i].value;
	}
			}
		}
return theValue ;
}

function validateField( fldObj, objType, msgArray, winObj ) {
//alert(objType);
winObj.focus( );
//objType valid values are "text", "select" (multi-valued), "dialogbox" (single-valued), "checkbox"
// validation cases for 'valType' are: null, validDate, validEmail, validNumber, validAlpha
var errorArray = createMsgArrayObj( msgArray );
if ( objType == "checkbox" ){
	var fieldName = fldObj[0].name;
	}else{
	var fieldName = fldObj.name;
}
//winObj.alert( "fieldName = " + fieldName );
for ( var i = 0; i <= errorArray.length-1; ++i ) {
	//find msgStr(s) that relate to the field being passed.
	var msgStr = errorArray[i];
//alert(msgStr)
	if ( msgStr.indexOf(fieldName) != -1) {
		// Use the valType at beginning of msgStr to determinw what to validate 
		var endDataTypePos = msgStr.indexOf( "##" );
		var valType = msgStr.substring( 0, endDataTypePos );
		var startMsgTextPos = valType.length+2;
		var endMsgTextPos = msgStr.lastIndexOf( "##" );
		var msgText = msgStr.substring( startMsgTextPos, endMsgTextPos );
		var endFieldNamePos = msgStr.indexOf(";");
		var msgStrField = msgStr.substring(endMsgTextPos+2, endFieldNamePos);
//alert (fieldName +"=="+ msgStrField);
		if (fieldName == msgStrField){ 
//alert("found")		
			//validate all for null
			if( failNull( fldObj, msgText, objType, winObj ) ){
				return "Error";
			}

			if( valType == "validEmail" ) {
		
				if( emailValidation( fldObj, msgText, winObj ) == "Error" ){
				return "Error";
				}
			}

			if( valType == "validDate" ) {
				if( dateValidation( fldObj, msgText, winObj ) == "Error" ){
				return "Error";
				}
			}

			if( valType == "validAlpha" ) {
				//leaving this open until we determine it is necessary to write -- css
			}

			if( valType == "validNumber" ) {
				if( floatValidation( fldObj, msgText, winObj ) == "Error" ){
				return "Error";
				}
			}
		}
	}
//closing for loop...
}
//this should never be returned, but is here to prevent a JS error in Netscape
return "Done";
}

//Float Validation----------------------------------------------------------------

function isFloat( theText ) {
if (theText.indexOf( "," ) == 0 ){
	return "False";
}
var theNum = parseFloat( theText );
var strNum = theNum.toString();
	while (strNum.charAt(0) == "0"){
		strNum = strNum.substring( 1, strNum.length);
	}
var strLen = strNum.length;
var txtLen = theText.length;
	if ( strLen == txtLen ) {
		return "True";
	}else{
		return "False";
	}
}

function floatValidation( floatField, msgText, winObj ) {
var fldText = getFieldValue( floatField, "text" );
	var isItAFloat = isFloat( fldText );
	if( isItAFloat  == "True" ){
	}else{
		alertBox( floatField, msgText, "text", winObj )
		return "Error";
	}
}

//Date Validation----------------------------------------------------------------

//LEAP YEAR Note for date validation:
//When users input 2/29 for a non-leap year, this code provides an error to the user


function getMonthWord( monthVal ){
	// monthVal must be a number, 1-12 (inclusive)
	// leading 0's are allowed
	if( monthVal == "1" || monthVal == "01") return ("January" );
	if( monthVal == "2" || monthVal == "02") return ("February" );
	if( monthVal == "3" || monthVal == "03") return ("March" );
	if( monthVal == "4" || monthVal == "04") return ("April" );
	if( monthVal == "5" || monthVal == "05") return ("May" );
	if( monthVal == "6" || monthVal == "06") return ("June" );
	if( monthVal == "7" || monthVal == "07") return ("July" );
	if( monthVal == "8" || monthVal == "08") return ("August" );
	if( monthVal == "9" || monthVal == "09") return ("September" );
	if( monthVal == "10") return ("October" );
	if( monthVal == "11") return ("November" );
	if( monthVal == "12") return ("December" );
}

function errorDateField( dateField, errMsg, winObj ) {
	winObj.alert( errMsg );
	dateField.focus( );
	dateField.select( );
	return;
}


function isLeapYear( yearText ) {
	var yearInt = parseInt( yearText );
	var yrDivByFour = yearInt/4;
	var byFour = yrDivByFour + "^";
	var decIndexFour = byFour.indexOf(".");
	if( decIndexFour == -1) {
		var lastTwoDigits = yearText.substring( 2, yearText.length);
		if( lastTwoDigits == "00") {
			var yrDivByFourHun = yearInt/400;
			var byFourHun = yrDivByFourHun + "^";
			var decIndexFourHun = byFourHun.indexOf(".");
				if( decIndexFourHun == -1 ) {
				//Is leap year
				return( "Yes" );
				}else{
				//Not Leap year
				return( "No" );
				}
		}else{
		//Is Leap year
		return( "Yes" );
		}
	}else{
	//Not Leap year
	return( "No" );
	}
}

function compareStringInt( dateField, theDateText ) {
	var theInt = parseInt( theDateText );
	intObj = new Number( theInt );
	var whatToDo;
	var  indexOfZero = theDateText.indexOf( "0");
	intString = intObj.toString( );
	intStringLen = intString.length;

	//CHECK THE INT FOR ZERO
	if( indexOfZero == -1) {
	whatToDo = "KeepTheSame"
	}else{
	//It has a zero.  If first character, decrease by one
		if( parseInt(indexOfZero) == 0 ) {
		whatToDo = "DecreaseByOne";
		}else{
		//Not first character, keep the same.
		whatToDo = "KeepTheSame"
		}
	}
	
	//DO THE WhatToDo
	if( whatToDo == "DecreaseByOne" ) {
		if( (theDateText.length-1) == intStringLen ) {
		return( "OK" );
		}else{
		return( "ERROR");
		}
	}else{
		//whatToDo = "KeepTheSame".  Check for correct length
		if( theDateText.length == intStringLen ) {
			return( "OK" );
			}else{
			return( "ERROR");
		}
	}
}

function dateValidation( dateField, fieldErrMsg, winObj ) {

	var dateText = getFieldValue( dateField, "text" );
	var dayText = "";
	var monthText = "";
	var yearText = dateText.substring( dateText.lastIndexOf("/")+1, dateText.length );
	
	switch (jsvDateValFormat ) {
		case "MM/DD/YYYY" :
			monthText = dateText.substring( 0, dateText.indexOf( "/" ));
			dayText = dateText.substring( (dateText.indexOf("/")+1), dateText.lastIndexOf("/"));
			break
		case "DD/MM/YYYY" :
			dayText = dateText.substring( 0, dateText.indexOf( "/" ));
			monthText = dateText.substring( (dateText.indexOf("/")+1), dateText.lastIndexOf("/"));
			break	
		default :
			monthText = dateText.substring( 0, dateText.indexOf( "/" ));
			dayText = dateText.substring( (dateText.indexOf("/")+1), dateText.lastIndexOf("/"));
			break	
	}
	
	//CHECK FOR SLASHES
	if( dateText.indexOf("/") == 1 || dateText.indexOf("/") == 2) {
	//OK
	} else {
	errorDateField( dateField, jsvPreMsg + "  " + jsvDateFirstSlashError + " \n\n" + fieldErrMsg, winObj);
	return( "Error" );
	}	
	
	if( dateText.lastIndexOf("/") == 3 || dateText.lastIndexOf("/") == 4 || dateText.lastIndexOf("/") == 5) {
	//OK
	}else{
	errorDateField( dateField, jsvPreMsg + "  " + jsvDateSecondSlashError + " \n\n" + fieldErrMsg, winObj);
	return( "Error" );
	}

	//CHECK FOR CORRECT LENGTH
	if( monthText.length != 1 ) {
		if( monthText.length != 2 ) {
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateMonthLenError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
		}
	}

	if( dayText.length != 1 ) {
		if( dayText.length != 2 ) {
			//Error handle
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateDayLenError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
		}
	}

	if( yearText.length != 4 ) {
		//Error handle
		errorDateField( dateField, jsvPreMsg + "  " + jsvDateYearLenError + " \n\n" + fieldErrMsg, winObj);	
		return( "Error" );
	}

	//CHECK FOR ALPHA CHARACTERS
	var continueCompareMonth = compareStringInt( dateField, monthText );
	if( continueCompareMonth != "ERROR") {
		var continueCompareDay = compareStringInt( dateField, dayText );
		if ( continueCompareDay != "ERROR") {
			var continueCompareYear = compareStringInt( dateField, yearText );
			if( continueCompareYear != "ERROR") {
			//OK
			}else{
			//Error handle
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateYearAlphaError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
			}
		}else{
		//Error handle
		errorDateField( dateField, jsvPreMsg + "  " + jsvDateDayAlphaError + " \n\n" + fieldErrMsg, winObj);	
		return( "Error" );
		}
	}else{
	//Error handle
	errorDateField( dateField, jsvPreMsg + "  " + jsvDateMonthAlphaError + " \n\n" + fieldErrMsg, winObj);	
	return( "Error" );
	}

	//CHECK FOR A VALID DATE
	monthInt = parseInt( monthText );
	dayInt = parseInt( dayText );
	yearInt = parseInt( yearText );

	//Month is between 1 and 12 inclusive
	if( monthText == "08" || monthText == "09") {
	//Skip over this validation
	}else{	
		if( 0 < monthInt ) {
			if( monthInt  < 13 ) {
			//OK
			}else{
			//Error handle
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidMonthError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
			}
		}else{
		//Error handle
		errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidMonthError + " \n\n" + fieldErrMsg, winObj);	
		return( "Error" );
		}
	}


	//Day is valid depending on the month
	if( dayText == "08" || dayText == "09") {
	//Skip over this validation
	}else{	
		if( monthInt == 1|| monthInt == 3 || monthInt == 5 ||  monthInt == 7 || monthInt == 8 || monthInt == 10 || monthInt == 12 ) {
			if ( 0 < dayInt ) {
				if ( dayInt < 32 ) {
				//OK
				}else{
				//Error handle
				errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
				return( "Error" );
				}
			}else{
			//Error handle
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
			}
		}

		if( monthInt == 4|| monthInt == 6 || monthInt == 9 || monthInt == 11 ) {
			if ( 0 < dayInt ) {
				if ( dayInt < 31 ) {
				//OK
				}else{
				//Error handle
				errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
				return( "Error" );
				}
			}else{
			//Error handle
			errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
			return( "Error" );
			}
		}
	
		if( monthInt == 2 ) {
			if ( 0 < dayInt ) {
				if( isLeapYear( yearText ) == "Yes") {
					if( dayInt < 30 ) {
					//OK
					}else{
					//Error handle
					errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
					return( "Error" );
					}
				}else{
					if ( dayInt < 29 ) {
						//OK
					}else{
						//Error handle
						errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
						return( "Error" );
					}
				}
			}else{
				//Error handle
				errorDateField( dateField, jsvPreMsg + "  " + jsvDateInvalidDayError + " \n\n" + fieldErrMsg, winObj);	
				return( "Error" );
			}
		}
	}	

}

//eMail Validation----------------------------------------------------------------

function emailValidation( emailField, msgText, winObj ){
var emailText = getFieldValue( emailField, "text" );
var atPos = emailText.indexOf( "@" );
	if( atPos != -1 ){
	// @ sign exists, continue with validation
	var preAt = emailText.substring( 0, atPos );
		if( preAt.length < 1){
			alertBox( emailField, msgText, "text", winObj )
			return "Error";
		}else{
		// name exists, continue validation
		var postAt = emailText.substring( atPos, emailText.length );
		postAt = postAt.toLowerCase( );
			if( postAt.indexOf( ".com") ==-1 && postAt.indexOf( ".edu") ==-1 && postAt.indexOf( ".net") ==-1){
				alertBox( emailField, msgText, "text", winObj )
				return "Error";	
			}else{
			//everything is OK!
			}
		}
	}else{
	alertBox( emailField, msgText, "text", winObj )
	return "Error";
	}

}

//Misc. Validation----------------------------------------------------------------

function createMsgArrayObj( msgArray ) {
var errorArray = new Array( );
var x = 0;
var sep = "; ";
var startPos = 0;
msgArray = msgArray + "; ";

var goAhead = true;
while ( goAhead ) {
	var endPos = msgArray.indexOf( sep )+2
	theString = msgArray.substring( 0, endPos );		

	errorArray[x] = theString;

	//  reinitialize theString to begin at endPos
	startPos = endPos;
	theString = msgArray.substring( startPos, msgArray.length);
	msgArray = theString;			
	x = ++x;
	goAhead = msgArray.indexOf( sep ) != -1;
	} 

return errorArray;
}

function saveForm( form ) {
	if( top.frameApplication ) {
	top.frameApplication.frameMainFrame.submitDocument( );
	}else{
	top.frameNewWindowMain.submitDocument( );
	}
}

function getErrorMsg( errorCode ){
form = document.forms[0];
var jsvErrorLookupField;
var jsvCurrText = "";
	if( jsvUserPrefLanguage == "en-US" ) {
		jsvErrorLookupField = form.fldErrorMsgsEN;
	}else{
		jsvErrorLookupField = form.fldErrorMsgsES;
	}
}

function alertBox(vField, vMessage, vType, winObj) {
	if(vMessage=="null") return;
	winObj.alert(jsvPreMsg + " \n\n" + vMessage)
	if (vField.type=="hidden") return;
	if(vType=="text") {
		vField.focus();
		vField.select();
	}
	if(vType=="checkbox") {
		vField[0].focus();
	}else{
		vField.focus();
	}
	return;
}

function failContains( vField, vValue, vMessage, vType ) {
	theValue = getFieldValue(vField, vType);
	var count = ( failContains.arguments.length == 6 )? vValue.length-1:0;
	var value = ( failContains.arguments.length == 6 )? vValue.substring(0,1): vValue;
	for (i-0; i<=count; i++) {
		if ( theValue.indexOf(value)>-1) {
			alertBox(vField, vMessage, vType);
			return(true);
		}
		value=(count>0) ?vValue.substring(i+1, i+2) : vValue;
	}
	return(false)
}

function getFieldValue( theField, vType ) {
	theValue = "";
	sep = "";
	hits = 0;
	if(vType=="text") return (theField.value);
	if(vType=="dialogbox") return (theField.options[theField.selectedIndex].text);
	if(vType=="dialogboxvalue") return (theField.options[theField.selectedIndex].value);
	if(vType=="select") {
		for (i=0; i<theField.options.length; i++) {
		if (theField.options[i].selected) theValue += theField.options[i].text
		}
		return(theValue);
	}
	if(vType=="radio") {
	if(theField.value==null) {
		for (i=0; i<theField.length; i++) {
			if(theField[i].checked) {
				hits++;
				if(hits>1) {
					sep=";";
				}
			theValue +=sep+theField[i].value;
			}
		}
		return(theValue);
	}
	}else{
		if (navigator.appName=="Microsoft Internet Explorer") {
			return("can't validate on client")
			}
		if(theField.checked) {
			return(theField.value);
		}else{
		return("");
		}
	}
	return(theValue);
}

function trimBlanks( theString, repChar ) {
trimString="";
for( i=0; i<theString.length; i++) {
theChar=theString.substring( i, i+1);
if(theChar==" ") {
trimString += repChar
}else{
trimString+=theString.substring(i,i+1);
}
}
return(trimString);
}

function failNull( vField, vMessage, vType, winObj) {
//alert("failnull"& vField);

	if( vType == "checkbox" || vType == "radio" ){
	theValue = getCheckedValues( vField );
	}else{
	theValue = getFieldValue( vField, vType);
	}
	if(vType=="dialogbox" && theValue == "") {
		alertBox( vField, vMessage, vType, winObj );
		return( true );
	}
	if( theValue == "" ) {
		alertBox( vField, vMessage, vType, winObj );
		return ( true );
	}
	trimField=trimBlanks(theValue);
	if( trimField=="") {
		alertBox( vField, vMessage, vType, winObj );
		return( true );
	}
	return( false );
}

// This function focuses the users in the specified tab on a tabbed table
function OpenTab(tr){
alert("Cambia Tabs");
	var TableRow = '1.' + (tr - 1) + '$TableRow';
	OpenTab = _doClick(TableRow ,this,'_self','#1.');
}

// ----- Ends the OpenTab function



//-->
