<!-- 
// Owner
// Austin Extreme
// -----------------------------------------------
// Sitewide Javascript
// -----------------------------------------------
/*
 *******************************************************
 * * * * * * * * - - W A R N I N G - - * * * * * * * * *
 *******************************************************
 -------------------------------------------------------
 |  All scripting contained herein and that contained  |
 |  in the same directory location as this file or     |
 |  script including this script are the property and  |
 |  creation of Austin Extreme.  If you wish to use    |
 |  and or copy that property in part or in whole,     |
 |  please request permission to do so by sending an   |
 |  e-mail request to codeuse@austinextreme.com.       |
 |  Then, wait for a confirmation reply letter         |
 |  granting such permission before preceding to       |
 |  use and/or copy theabove described property.       |
 |  Copyright Zigami, 2001.                            |
 -------------------------------------------------------
*/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Netscape Resize Fix
// fixes well documented bug that blows page up after resize
if (document.layers)
	{
	origWidth = innerWidth;
	origHeight = innerHeight;
	}
function reDo()
	{
	if (innerWidth != origWidth || innerHeight != origHeight)
	location.reload();
	}
if (document.layers) onresize = reDo;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//error stop
function stopError()
	{
	return true;
	}
//window.onerror = stopError;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//frame bustout disabled until loaded
if (top.location != location) top.location.href = location.href; 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Gets random images for display
function getRandomImageD(style) {
	switch (style) {
		case "frontdoor" : 
			var i = Math.floor(frontdoor.length*Math.random());
			return frontdoor[i];
		case "innerdoor" :
			var i = Math.floor(innerdoor.length*Math.random());
			return innerdoor[i];
		case "workarea" :
			var i = Math.floor(workarea.length*Math.random());
			return workarea[i];
	}	
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Browser and Ops System Check
// Ops System Check
function checkOS() {
  if(navigator.userAgent.indexOf('Linux') != -1)
    { var OpSys = "Linux"; }
  else if((navigator.userAgent.indexOf('Win') != -1) &&
  (navigator.userAgent.indexOf('95') != -1))
    { var OpSys = "Windows95"; }
  else if(navigator.userAgent.indexOf('Win') != -1)
    { var OpSys = "Windows3.1 or NT"; }
  else if(navigator.userAgent.indexOf('Mac') != -1)
    { var OpSys = "Macintosh"; }
  else { var OpSys = "other"; }
  return OpSys;
}
var OpSys = checkOS();
// convert all characters to lowercase to simplify testing 
var agt=navigator.userAgent.toLowerCase(); 
// *** BROWSER VERSION *** 
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); 
var is_nav2 = (is_nav && (is_major == 2)); 
var is_nav3 = (is_nav && (is_major == 3)); 
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav4up = (is_nav && (is_major >= 4)); 
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); 
var is_nav5 = (is_nav && (is_major == 5)); 
var is_nav5up = (is_nav && (is_major >= 5)); 
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
var is_ie4up  = (is_ie  && (is_major >= 4)); 
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); 
var isIE4, isIE4PC, isNav4PC, isNav4, isNav3;

if (is_ie4 || is_ie4up || is_nav5 || is_nav5up) 
{
	isIE4 = true;
	if (OpSys != "Macintosh") {
		isIE4PC = true;
	} 
} else if (is_nav4) {
	isNav4 = true;
	if (OpSys != "Macintosh") {
		isNav4PC = true;
	} 
} else if  (is_nav) {
	isNav3 = true;	
    }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//rollover script
function swap(imgDocID,imgObjName) 
{
	if (is_ie4 || is_ie4up || is_nav5 || is_nav5up)
    {
	document.images[imgDocID].src = eval(imgObjName + ".src")
    }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Popup window
self.name = "parentWin";
function  popWindow(url,name,x,y,s,w,h,m) 
{
	popupWin = window.open(url,"name",'scrollbars='+s+',menubar='+m+',toolbar=0,location=0,resizable=0,width='+w+',height='+h+'');
	popupWin.moveTo(x,y);
	popupWin.focus();
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Removes Undesirables Characters
function rem_obj(obj)
	{
	obj.value = obj.value.replace(/'/g, "");
	obj.value = obj.value.replace(/"/g, "");
	obj.value = obj.value.replace(/;/g, "");
	obj.value = obj.value.replace(/</g, "");
	obj.value = obj.value.replace(/>/g, "");
	}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Validate number fields
function checkNumber(obj)
{
	var numberEntry = parseInt(obj.value)
	if(isNaN(numberEntry))
	{  
		alert("Field Value must be a number!");
		obj.value = "0";
  }
	else
	{
	  obj.value = numberEntry;
	}		
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Confirms Deletion
//Confirm Delete Item
function confirmdelete() 
	{
    var message;
    message =  "_____________________________________________\n\n";
    message += "Are You Sure You Want to Delete this User.\n\n";
    message += "This will action will delete all traces of\n"; 
    message += "this user from the system.\n\n"; 
    message += "This includes user information, as well as\n"; 
    message += "all log-in records.\n\n"; 
    message += "To Delete Click Okay\n"; 
    message += "_____________________________________________\n\n";

	if (confirm(message)) 
		{
			document.form.deleteitem.value = 'true';
    		document.form.submit();
		}
	}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Marks what fields have been changed into txtChanges hidden field
function markChange(obj)
{
	if (document.forms["form2"].intCommunity_ID2.value == "")
	{
	  document.forms["form2"].txtChanges.value = "New Community";
	  document.forms["form2"].chkChange.value = "Yes";
	}
	else
	{
	  if (document.forms["form2"].txtChanges.value == "")
	  {
		  document.forms["form2"].txtChanges.value += obj.name;
			document.forms["form2"].chkChange.value = "Yes";
		}
	  else
		{
		  document.forms["form2"].txtChanges.value += ", " + obj.name;
			document.forms["form2"].chkChange.value = "Yes";
	  }
	}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Confirms Community name exists
//Before update or insert community
function checkSubmit(form_2)
{
  var submitForm2 = "Yes";
		//alert(form_2.action)

  //check to make sure there is a Community name
  if (document.forms["form2"].txtCommunity_Name.value == "")
  {
	  alert("Community must have a name!");
		submitForm2 = "No";
	}
	else
  {
	  submitForm2 = "Yes";
	}

  //check to make sure a region is selected
  if (document.forms["form2"].intRegion_ID.value == "0")
  {
	  alert("Please Select a Region!");
		submitForm2 = "No";
	}
	else
  {
	  submitForm2 = "Yes";
	}
	
	//make sure a special is given if check box value is true
  if (document.forms["form2"].blnSpecial_Active.checked)
	{
	  if (document.forms["form2"].txtNote.value.length < 5)
		{
		  alert("Must have a Special to be active!  Please fill in the Special text box, must be at least 5 caharacters, or uncheck the Special Active check box.")
			submitForm2 = "No";
		}
		else
		{
		  submitForm2 = "Yes";
		}
	}
	

  //Submit form if all validations are passed	
	if (submitForm2 == "Yes")
	{
	  form_2.submit();
	}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Confirms Deletion of Floorplan
//Confirm Delete Item
function assureDelete(intCommunity_ID,intPlan_ID) 
	{
    var message;
    message =  "_____________________________________________\n\n";
    message += "Are You Sure You Want to Delete this floorplan.\n\n";
    message += "This will action will delete all traces of\n"; 
    message += "this floorplan from the system.\n\n"; 
    message += "To Delete Click Okay\n"; 
    message += "_____________________________________________\n\n";

	if (confirm(message)) 
		{
		    //strPath = "admin/upload_community.asp?intCommunity_ID=" + intCommunity_ID + "&txtType=REMOVEPLAN&intPlan_ID=" + intPlan_ID + ""
        //window.location.href="/admin/upload_community.asp?intCommunity_ID=" + intCommunity_ID + "&txtType=REMOVEPLAN&intPlan_ID=" + intPlan_ID + "";
    		//document.form.submit();
		}
	}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Validates Search Criteria for afllc.asp
function validateSearch() {
    if (document.form1.intPlan_Rate.value == '0'  && document.form1.txtPlan_Rooms.value == 'x'  && document.form1.txtPets.value == 'x' && document.form1.intRegion.value == '0') {
        alert('Please Select from one of the listed options!');
        return false;
    }
    else
        return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function NSclick(e) {
	if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) { 
		if (e.which == 3) {
			return false;
		}
	}
	if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=5) { 
    		if (e.button == 2 || e.button == 3) {
      			e.preventDefault();
			return false;
  		}
	}
}

if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) { 
	document.onmousedown=NSclick;
	document.captureEvents(Event.MOUSEDOWN);
}
if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=5) { 
	document.onmouseup=NSclick;
}
if (navigator.appName=="Microsoft Internet Explorer") { 
	document.oncontextmenu = new Function("return false;")
}







/*
if (is_ie4 || is_ie4up || is_nav5 || is_nav5up)
{
//Rollover values
home_over = new Image(85,16);
home_over.src = "/images/sitewide/home_over.gif";
home_up = new Image(85,16);
home_up.src = "/images/sitewide/home_up.gif";

solutions_over = new Image(85,16);
solutions_over.src = "/images/sitewide/solutions_over.gif";
solutions_up = new Image(85,16);
solutions_up.src = "/images/sitewide/solutions_up.gif";

process_over = new Image(85,16);
process_over.src = "/images/sitewide/process_over.gif";
process_up = new Image(85,16);
process_up.src = "/images/sitewide/process_up.gif";

studio_over = new Image(85,16);
studio_over.src = "/images/sitewide/studio_over.gif";
studio_up = new Image(85,16);
studio_up.src = "/images/sitewide/studio_up.gif";

contactus_over = new Image(85,16);
contactus_over.src = "/images/sitewide/contactus_over.gif";
contactus_up = new Image(85,16);
contactus_up.src = "/images/sitewide/contactus_up.gif";

probono_over = new Image(85,16);
probono_over.src = "/images/sitewide/probono_over.gif";
probono_up = new Image(85,16);
probono_up.src = "/images/sitewide/probono_up.gif";

projects_over = new Image(85,16);
projects_over.src = "/images/sitewide/project_over.gif";
projects_up = new Image(85,16);
projects_up.src = "/images/sitewide/project_up.gif";

chelo_over = new Image(40,54);
chelo_over.src = "/images/sitewide/chelo_mini_over.jpg";
chelo_up = new Image(40,54);
chelo_up.src = "/images/sitewide/chelo_mini_up.jpg";

guitar_over = new Image(40,56);
guitar_over.src = "/images/sitewide/guitar_mini_over.jpg";
guitar_up = new Image(40,56);
guitar_up.src = "/images/sitewide/guitar_mini_up.jpg";

horn_over = new Image(40,54);
horn_over.src = "/images/sitewide/french_horn_mini_over.jpg";
horn_up = new Image(40,54);
horn_up.src = "/images/sitewide/french_horn_mini_up.jpg";

piano_over = new Image(40,55);
piano_over.src = "/images/sitewide/piano_mini_over.jpg";
piano_up = new Image(40,55);
piano_up.src = "/images/sitewide/piano_mini_up.jpg";

trumpet_over = new Image(40,55);
trumpet_over.src = "/images/sitewide/trumpet_mini_over.jpg";
trumpet_up = new Image(40,55);
trumpet_up.src = "/images/sitewide/trumpet_mini_up.jpg";

guitar2_over = new Image(40,55);
guitar2_over.src = "/images/sitewide/guitar2_mini_over.jpg";
guitar2_up = new Image(40,55);
guitar2_up.src = "/images/sitewide/guitar2_mini_up.jpg";

site_over = new Image(40,54);
site_over.src = "/images/sitewide/site_new2_mini_over.jpg";
site_up = new Image(40,54);
site_up.src = "/images/sitewide/site_new2_mini_up.jpg";
}
*/
-->