//Below is the code that pre-loads the graphics 

img1 = new Image();
img2 = new Image();

img1.src = "http://www.americolodging.com/images/ie_on.gif";
img2.src = "http://www.americolodging.com/images/flash_on.gif";

function movepic(img_name,img_src) {
document[img_name].src=img_src;
}

function win(myFileName,myWinName,mywidth,myheight) 
{
	myWin = window.open("",myWinName,"width=" + mywidth + ",height=" + myheight+",top=0,left=0,screenX=0,screenY=0,scrollbars=no,status=no")
	myWin.location.href = myFileName;
	myWin.moveTo(((screen.width/2)-(mywidth/2)),((screen.height/2)-(myheight/2)));
}



function inquiry_form_check_fields() {

var errors_exist=0;
var error_list="Please complete the following, required field(s):";


if(document.inquiry_form.bedrooms.value=="Not specified"){
error_list=error_list + "\n- Number of bedrooms";
errors_exist=1;
}

if(document.inquiry_form.destination_city.value==""){
error_list=error_list + "\n- Destination city";
errors_exist=1;
}

if(document.inquiry_form.destination_state.value=="Not specified"){
error_list=error_list + "\n- Destination state";
errors_exist=1;
}

if(document.inquiry_form.budget.value==""){
error_list=error_list + "\n- Rent budget";
errors_exist=1;
}

if(document.inquiry_form.full_name.value==""){
error_list=error_list + "\n- Full name";
errors_exist=1;
}

if(document.inquiry_form.city.value==""){
error_list=error_list + "\n- City";
errors_exist=1;
}

if(document.inquiry_form.state.value==" "){
error_list=error_list + "\n- State";
errors_exist=1;
}

if(document.inquiry_form.phone.value==" "){
error_list=error_list + "\n- Phone";
errors_exist=1;
}

if(document.inquiry_form.email.value==""){
error_list=error_list + "\n- Email";
errors_exist=1;
}


if(errors_exist==1){
	alert(error_list);
	return false;
}

else {
	document.inquiry_form.submit();
	return true;
}

} //end of inquiry_form_check_fields()



/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////

function contact_form_check_fields() {

var errors_exist=0;
var error_list="Please complete the following, required field(s):";

if(document.contact_form.name.value==""){
error_list=error_list + "\n- Full Name";
errors_exist=1;
}

if(document.contact_form.phone.value==""){
error_list=error_list + "\n- Phone";
errors_exist=1;
}

if(document.contact_form.email.value==""){
error_list=error_list + "\n- Email";
errors_exist=1;
}


if(document.contact_form.note.value=="") {
error_list=error_list + "\n- Note";
errors_exist=1;
}


if(errors_exist==1){
	alert(error_list);
	return false;
}

else {
	document.contact_form.submit();
	return true;
}

} //end of contact_form_check_fields()

function change(color,text){
var el=event.srcElement
if (el.tagName=="INPUT"&&el.type=="button") {
event.srcElement.style.backgroundColor=color
event.srcElement.style.color=text
}
}

function jumpto2(url){
window.panel.location=url
}

function jumpto2inside(url){
window.location=url
}

function jumpto2page(url){
top.location=url
}