<!--
		function redirector(lan){
			//alert('hello');
			var nfo = document.getElementById('nfo').options[document.getElementById('nfo').selectedIndex].value;
		    if (lan != 'e')
		    {
		    	window.location = "index2.php?nfo="+nfo+"&lan="+lan;
		    }
		    else 
		    {
		    	window.location = "index2.php?nfo="+nfo;
		    }
		}
		
		var submitcount=0;
		function submitonce()
		{
			if(submitcount == 0)
			{
				submitcount++;
				return true;
			}
			else
			{
				alert("This form has already been submitted.  Thanks!");
				return false;
			}
		}
		
		function popUp (url,width,height,elements,newWindowName)
		{
			if (newWindowName='')
			{
				newWindowName = "newWindow";
			}
			if (elements==0){
				elements = 'width='+width+',height='+height;
			}
			else{
				elements = 'width='+width+',height='+height+',location=no,menubar=no,resizable=yes,screenX=30,left=30,screenY=30,top=30,scrollbars=yes,status=no,toolbar=no';
			}
			ElementWindow = window.open(url,newWindowName,elements);
		}
		
		function helpPop(type)
		{
			ElementWindow = window.open('/admin/help/helpPop.php?type=' + type,'popNewPoint','width=400,height=425,location=no,menubar=no,resizable=yes,screenX=30,left=30,screenY=30,top=30,scrollbars=yes,status=no,toolbar=no');
		}
		
		function changeVisibilty(show,divElementName)
		{
			var divElement=document.getElementById(divElementName);
			if (show)
			{
				//alert ("Show: "+divElementName);				
				divElement.style.display='inline';
				divElement.style.visibility='visible';
			}
			else
			{
				//alert ("Hide: "+divElementName);				
				divElement.style.display='none';
				divElement.style.visibility='hidden';
			}
		}
		
		function toggleVisibilty(divElementName)
		{
			var divElement=document.getElementById(divElementName);
			if (divElement.style.display == 'none' || divElement.style.visibility =='hidden')
			{
				//alert ("Show: "+divElementName);
				divElement.style.visibility='visible';
				divElement.style.display='inline';
			}
			else
			{
				//alert ("Hide: "+divElementName);
				divElement.style.visibility='hidden';
				divElement.style.display='none';
			}
		}
		
		FormChange = function(type) {
		var types = new Array('nowwhat','construction','completed');
		
				for (var n = 0; n < 3; n++) 
				{
					if (types[n] == type) {
						changeVisibilty(1, types[n]);
					} else {
						changeVisibilty(0, types[n]);
					}
				}			
			
		}
		function makeNumber( inp ) {
			var outp = "";
			var inpval = "" + inp.value;
			var nums = "0123456789.";
			for (idx=0; idx < inpval.length; idx++) {
				oneChar = inpval.charAt( idx );
				if (nums.indexOf(oneChar) != -1) outp += oneChar;
			}
			if (outp == "") outp = 0;
			inp.value = "" + parseFloat(outp);
		}		
		
		function makeDollar( inp ) 
		{
			makeNumber( inp );
			var rtn = "" + inp.value;
			pos = rtn.indexOf( "." );
			if (pos == 0) rtn = "0" + rtn;
			if (pos < 0) rtn += ".00";
			rtn += "0000";
			pos = rtn.indexOf(".");
			rtn = rtn.substring( 0, pos + 3 );
			if (pos == 4) rtn = rtn.substring( 0,1 ) + "," + rtn.substring( 1, 7 );
			if (pos == 5) rtn = rtn.substring( 0,2 ) + "," + rtn.substring( 2, 8 );
			if (pos == 6) rtn = rtn.substring( 0,3 ) + "," + rtn.substring( 3, 9 );
			inp.value = "$" + rtn;
		}
		
		
		//*** Is this a valid Date?
		function isValidDate ( inpv ) {
		
			var pos1 = inpv.indexOf ("/", 0);
			if (pos1 == -1) { return false; }
			var pos2 = inpv.indexOf ("/", pos1+1);
			if (pos2 == -1) { return false; }
		
		
			var mo = inpv.substring(0, pos1);
			var dy = inpv.substring(pos1+1, pos2);
			var yr = inpv.substring(pos2+1, inpv.length)
		
			if (! isNumericString(mo) ) { return false; }
			if (! isNumericString(dy) ) { return false; }
			if (! isNumericString(yr) ) { return false; }
			
			var parsMo = parseInt(mo,10);
			var parsDy = parseInt(dy,10);
			
			if (yr.length != 2 && yr.length != 4) { return false; }
			if (yr.length == 2) {
			   if (parsYr < 10) // do Y2K calc
			      { yr = "20" + yr; }
			   else
			      { yr = "19" + yr; }
			}
			
			var parsYr = parseInt(yr,10);
			
			if (parsMo < 1 || parsMo > 12) { return false; }
			if (parsMo == 9 || parsMo == 4 || parsMo == 6 || parsMo == 11) {
				if (parsDy < 1 || parsDy > 30) { return false; }
			} else {
				if (parsMo == "2") {
					if (parsDy < 1 || parsDy > 29) { return false; }
				} else {
					if (parsDy < 1 || parsDy > 31) { return false; }
				}
			}
			var theDate = new Date();
			if (parsYr < 1900 || parsYr >= theDate.getFullYear()) { return false; }
		
			return true;
		}
		
		
		function checkEmployTime(item,target)
		{
			var itemvalue=item.value;
			if(itemvalue < 2)
			{
				changeVisibilty(1, target);
			}
			else
			{
				changeVisibilty(0, target);
			}
		}
		
		
		function showCoApp(item)
		{
			var itemvalue=item.checked;			
			if(itemvalue)
			{
				changeVisibilty(1, 'co-applicant');
			}
			else
			{
				changeVisibilty(0, 'co-applicant');
			}
		}
		
		
		//*** Is this a valid Zip code?
		function validCode(zip) 
		{
			
			var zipval=""+zip.value;		
			var valid = "0123456789-";
			var hyphencount = 0;		
			var outp = "";
			
			//zipval=zipval.replace(/^\s+|\s+$/g, '');
			zipval = zipval.replace(/\s/g, '');
			//alert(zipval);
			
			
			for (idx=0; idx < zipval.length; idx++) 
			{
				oneChar = zipval.charAt( idx );
				if (valid.indexOf(oneChar) != -1) outp += oneChar;
			}
			
			if (outp == "") outp = 0;
			//alert(outp.length);
			if (!outp || outp.length > 10)
			{
				alert('Please check Zip Code.');
				highLight(zip);
				return false;
			}
			else
			{
				for (var i=0; i < outp.length; i++) 
				{
					temp = "" + outp.substring(i, i+1);
					//alert(temp);
					if (temp == "-") hyphencount++;
					if (valid.indexOf(temp) == "-1") 
					{
						alert("Invalid characters in your zip code.  Please try again.");
						highLight(zip);
						return false;
					}
				}
				//alert(outp);
				if (!(outp.length == 5 || outp.length == 9 || outp.length == 10)) 
				{
					alert('Please check Zip Code.');
					highLight(zip);
					return false;
				}
				if (outp.length == 9)
				{
					var temp = '';
					for (var i=0; i <= 8; i++) 
					{						
						if (i==5)
						{
							temp =temp + '-';
							temp= temp + outp[i];
						}
						else
						{
							temp= temp + outp[i];
						}						
					}
					outp = temp;
				}
			
			
			
			}
			zip.value = outp;
			return true;
		}
		
		
		
		//*** Is this a valid Email address?
		function isValidEMail ( inpv ) 
		{		
			var email = inpv.value;
			var fldID = inpv.id;
			var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			
			if (!filter.test(email)) 
			{
				alert('Invalid email address. Please check your email address.');
				highLight(inpv);
				return false;
			}
			return true;		
		}
		/* Org Email validation
		function isValidEMail ( inpv ) {
		
			// Check for "@" in string
			var pos = inpv.indexOf ('@', 0);
		   if ( pos == -1 || pos == 0 || pos == (inpv.length - 1) ) { return false;}
		
			return true;
		
		} // end of isValid e-mail
		*/
		
		//*** Is this a valid numeric string?
		function isNumericString ( text ) {
		
			for ( var i=0; i < text.length; i++ ) {
				if ( text.charAt(i) < "0" || text.charAt(i) > "9" ) {
					return false;
				}
			}
		
			return true;
		
		} // end of is numeric string
		
		/********************************************
		/ added 6/15/01 to validate phone numbers
		/*******************************************/
		function isPhone(str){
			var regexp = /^(\d{3}[-.]\d{3}[-.]\d{4})$/;
			return regexp.test(str);
		}
		
		function highLight(inpv)
		{
			globalVar = inpv;
			inpv.focus();
			inpv.select();
			setTimeout("globalVar.focus();",5);
			setTimeout("globalVar.select();",5);
			inpv.style.backgroundColor = "#FDFFBE";
			return true;
		}
		function transformSSN ( inp ) 
		{
			var newSSN = "";
		
			// Transform 999999999 -> 999-99-9999
		   newSSN = "" + inp.value;
			if ( newSSN .length == 9 ) {
			  inp.value = newSSN .substr(0,3) + "-" + newSSN .substr(3,2) + "-" + newSSN .substr(5, 4);
			}
			else if( newSSN .length < 9 || newSSN .length > 11)
			{
				
				alert('Please correct SSN');
				highLight(inp);
				return false;
			}
		}
		function isEmpty( inp ) 
		{
		//	alert( inp.type );
			if (inp.type == "text") {
				if (inp.value == "" || inp.value == null) return true;
				else return false;
			}
			if (inp.type == "select-one") {
				if (inp.selectedIndex < 1) return true;
				else return false;
			}
			if (inp.type == "checkbox") {
				if (!inp.checked) return true;
				else return false;
			}
			return false;
		}
		function errMsg( msg, inp ) 
		{
			alert( msg );
			inp.focus();
		}
		
		function getValue(num)
		{
		    var noJunk = ""
		    var withDollar = ""
		    var foundDecimal = 0
		    var foundAlphaChar = 0
		    num += "";
		
		    if (num == "") { return(0); }
		    for (i=0; i <= num.length; i++)
		    {
		        var thisChar = num.substring(i, i+1);
		        if (thisChar == ".")
		        {
		          foundDecimal = 1;
		          noJunk = noJunk + thisChar;
		        }
		        if ((thisChar < "0") || (thisChar > "9"))
		        {
		          if ((thisChar != "$") && (thisChar !=".") && (thisChar != ",") && (thisChar != " ") && (thisChar !="")) foundAlphaChar = 1;
		        }
		        else
		 {
		    withDollar = withDollar + thisChar
		    noJunk = noJunk + thisChar
		 }
		
		 if ((thisChar == "$") || (thisChar == ".") || (thisChar == ","))
		 {
		   withDollar = withDollar + thisChar
		 }
		  }
		     if (foundDecimal) { return parseFloat(noJunk); }
		     else if (noJunk.length > 0) { return parseFloat(noJunk); }
		     else return 0;
		}
		function formatCurrency(num) 
		{
			num = num.toString().replace(/\$|\,/g,'');
			if(isNaN(num))
				num = "0";
				sign = (num == (num = Math.abs(num)));
				num = Math.floor(num*100+0.50000000001);
				cents = num%100;
				num = Math.floor(num/100).toString();
			if(cents<10)
				cents = "0" + cents;
				for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
					num = num.substring(0,num.length-(4*i+3))+','+
					num.substring(num.length-(4*i+3));
			return (((sign)?'':'-') + '$' + num + '.' + cents);
		}
		
		function calc_loan() 
		{
			var cost= getValue(document.getElementById('cost').value); 
			var dep= getValue(document.getElementById('deposit').value); 
			var interest = document.getElementById('interest').value / 1200; 
			var term = parseInt(document.getElementById('term').value); 
			var principal = cost-dep;			
			var monthlypayments = principal * interest / (1 - (Math.pow(1/(1 + interest), term)));			
			document.getElementById('monthlypayment').value = formatCurrency(monthlypayments);
		}
		//-->
