// JavaScript Document
var myWindow;

function openCenteredWindow(url) {
    var width = 400;
    var height = 300;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "scrollbars=1" + ",width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}

function cabinPicture (largeimage,  height,  title)
{
 this.image = largeimage;
 this.height = height;
 this.title = title;
}

function change_image(my_object, my_screen)
{
 //array_location = image_no;
 my_path = "Assets/photos/"; 
 my_desc = my_object.description;
 document.getElementById(my_screen).src=my_path+my_object.image;
 document.getElementById(my_screen).height = my_object.height;
}
// JavaScript Document
function default_string (my_string, my_data)
{
 //document.form1.$my_string.value = "$my_data";
 document.form1.LAST_NAME.value = my_data;
}

function validate_object(obname, description, min_length)
{
 if (obname.value.length < min_length)
 { 
  alert("Please complete: " + description);
  obname.focus();
  obname.select();
  return false;
 } else
  return true;
}

function validate_num_object(obname, description)
{
 if (isNaN(obname.value))
 {
  alert(description + ' must contain only numbers');
  obname.focus();
  obname.select();
  return false;
 } else
 return true;
}

function popup(page)
{
 window.open(page, 'Cabins on Lake Whitney', 'width=700, height=500, status=yes, scrollbars=yes, resizable=yes, status=yes');	
}

