
/*   ************************************************************* 
// -------------- check box to agree to terms ---------------------
// <body>
//<form action="yourFormScript.php" method="POST" onsubmit="return checkCheckBox(this)">
//I accept: <input type="checkbox" value="0" name="agree">
//<input type="submit" value="Continue Order">
//<input type="button" value="Exit" onclick="document.location.href='/index.html';">
//</form>
// </body>
*/
function checkCheckBox(f) {
  if (f.agree.checked == false) {
    alert('Please check Terms and Condition Agreement box to continue.');
    return false;
  } else
    return true;
}



/*   ************** Converts carriage returns  to <BR>*********************** */
// Original:  Ascii King (chicorama@usa.net) -->
// Web Site:  http://www.geocities.com/enchantedforest/2120 -->
// to <BR> for display in HTML

function ConvertBR(input) {
var output = "";
for (var i = 0; i < input.length; i++) {
if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) {
i++;
output += "<BR>";
} else {
output += input.charAt(i);
   }
}
document.loginForm.propdesc.value = output;
}




/*   **************Check box one or the other*********************** */
function checkBoxValidate(cb) {
for (j = 0; j < 2; j++) {
if (eval("document.loginForm.member[" + j + "].checked") == true) {
document.loginForm.member[j].checked = false;
if (j == cb) {
document.loginForm.member[j].checked = true;
         }
      }
   }
}




/*   ********** Smut Engine ********************************
<FORM NAME="isn">
<DIV ALIGN=CENTER><INPUT TYPE="text" NAME="dirt" SIZE=40 VALUE=""><BR>
<INPUT TYPE="button" NAME="smut1" VALUE=" Submit " onClick="smutEngine(this.form)">
</DIV> 
</FORM>
*/

/*
function smutEngine() {
smut="#@&*%!#@&*%!#@&*%!";
cmp="sex babes shit fuck damn porno cum cunt prick pecker ass "
+"asshole pedophile man-boy man/boy dong twat ";
txt=document.isn.dirt.value;
tstx="";
for (var i=0;i<16;i++){
pos=cmp.indexOf(" ");
wrd=cmp.substring(0,pos);
wrdl=wrd.length
cmp=cmp.substring(pos+1,cmp.length);
while (txt.indexOf(wrd)>-1){
pos=txt.indexOf(wrd);
txt=txt.substring(0,pos)+smut.substring(0,wrdl)
+txt.substring((pos+wrdl),txt.length);
   }
}
 document.isn.dirt.value=txt;
}
*/




/*   ************************************************************* */
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}


/*   ***********Do not accept certain characters ********************************* 
This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Corneliu Lucian 'Kor' Rusu | corneliulucian[at]gmail[dot]com 
This field will not accept special characters: (like !@#$%* etc,) - but accepts underscore _
<input type="text" size="35" name="txtEmail" onkeyup="valid(this,'quotes')" onblur="valid(this,'quotes')">
/*

var r={
  'special':/[\W]/g,
  'quotes':/['\''&'\"']/g,
  'notnumbers':/[^\d]/g
}

function valid(o,w){
  o.value = o.value.replace(r[w],'');
}
  


/*   ********** Disable return key *************
This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Andrew G. Samoilov | http://www.webcheatsheet.com/ 

function stopRKey(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type=="textarea"))  {return false;}
}

document.onkeypress = stopRKey;
*************************************************************   /*    


//*   ********** pop window for add to favarite list ******************
//This script and many more are available free online at
//The JavaScript Source!! http://javascript.internet.com
//Created by: MB Web Design | http://www.mbwebdesign.co.uk 

//<body>
//<a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')">Bookmark our site!</a>
//</body>
/*
function bookmark(address,sitename) {
  if (window.sidebar) {
    window.sidebar.addPanel(sitename, address,"");
  } else if( document.all ) {
    window.external.AddFavorite(address, sitename);
  } else if( window.opera && window.print ) {
    return true;
  }
}
*/


// '13' = Enter key
function screenkey1(e) {
	var whichCode;
	whichCode = (window.Event) ? e.which : e.keyCode;
	if ( whichCode == "13" ) {
		submitForm1();
	}
}

function screenkey2(e) {
	var whichCode;
	whichCode = (window.Event) ? e.which : e.keyCode;
	if ( whichCode == "13" ) {
		submitForm2();
	}
}

function notavailable() {
    alert('Were SORRY, but Feature is temporarily not available');
}



function removefoto() {
    alert('Are you sure you want to remove this Photo!');
}


/* <![CDATA[ */
function submitForm1() {
	var form = document.getElementById("formDestination");
	var startDate = document.getElementById("checkInDate");
	if(startDate.value == "MM/DD/YYYY") {
		startDate.value = "";
	}
	var endDate = document.getElementById("checkOutDate");
	if(endDate.value == "MM/DD/YYYY") {
		endDate.value = "";
	}
	var currentSearchTerm = document.getElementById("searchTerm");
	if((currentSearchTerm.value == "") || (currentSearchTerm.value==currentSearchTerm.defaultValue)) {
		window.alert("Please enter a Destination");
		return false;
	}
	form.action = "http://forgetaway.weather.com/vacationrentals/search/findit/";
	form.submit();
}



/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jay Rumsey | http://www.nova.edu/~rumsey/ */

function UpdateCost() {
  var sum = 0;
  var gn, elem;
  for (i=0; i<3; i++) {
    gn = 'value'+i;
    elem = document.getElementById(gn);
    if (elem.checked == true) {
	 sum += Number(elem.value);
 	 document.getElementById('price').value = (elem.value);
	 }
  }
  elem = document.getElementById('credit');
  sum -= Number(elem.value);
  if (sum < 0) {sum=0}
  document.getElementById('TotalDue').value = sum.toFixed(2);
} 

/*
<body>
<input type="checkbox" id='game0' value="9.99"  onclick="UpdateCost()">Game 1 ( 9.99)<br>
<input type="checkbox" id='game1' value="19.99" onclick="UpdateCost()">Game 2 (19.99)<br>
<input type="checkbox" id='game2' value="27.50" onclick="UpdateCost()">Game 3 (27.50)<br>
<input type="checkbox" id='game3' value="45.65" onclick="UpdateCost()">Game 4 (45.65)<br>
<input type="checkbox" id='game4' value="87.20" onclick="UpdateCost()">Game 5 (87.20)<br>
<input type="text" id="totalcost" value="">
*/
