// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  alert(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}//close function

function openMapQuest(temp) {

var map_addr = 'http://www.corpoff.com/dispMap.php?addr='+temp;
window.open(map_addr,"map", "width=550,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");

}//close function

function openLocMap(loc) {

var addr = 'http://www.corporateofficecenters.com/resources/location_maps/Floor Plan - '+loc+'.pdf';
window.open(addr,"map","width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");

}//close function

//used by QuickLaunch
function goOffice(){
	var code = document.getElementById('officeCode').value;
	if (code != 'show'){
		window.location.href = "OfficeInfo.php?code=" + code;
	}
}//close function

//Used by Flash Movies

function showPage(pageId, parameters){
        var url = pageId + ".php";
        if (parameters != null && parameters != "") {
                url = url + "?" + parameters;
	}
	window.location.href = url;       
}//close function


function showOffice(officeId){
        if (officeId != "") {           
                window.location.href = "OfficeInfo.php?code=" + officeId;
        }
	else{            
                alert("Information not available");
        }        
} //close function


//form validation functions

function validate_email(field,alerttxt) {
with (field) {
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) { 
  alert(alerttxt);
  return false;
}
else {
return true;
}

}//close with

}//close function

function validate_required(field,alerttxt) {
with (field)
{
if (value==null||value=="") {
alert(alerttxt);return false;
}
else {
return true;
}

}//close with
}//close function

function validate_form(thisform) {
with (thisform) {
	if (validate_email(email,"Not a valid e-mail address!")==false) {
		email.focus();return false;
}
	if (validate_required(phone,"Not a valid phone number!")==false){
	phone.focus(); return false;
}
else { 
	return true; 
}

}//close with
}//close function

function goto360View(officeCode){

//alert(officeCode);
var url = "virtual_tours/"+officeCode+"/";


/* OLD - before Jul17/07

var url = "virtual_tours/";

  //var parameters = "";
  if (officeCode == "At"){
    url = url + "atlanta/index1.html";
  }
  if(officeCode == "Arl"){
    url = url + "arlington/index1.html";
  }
  if(officeCode == "Wh"){
    url = url + "weistheimer/index1.html";
  }
  if(officeCode == "hw"){
    url = url + "westside/index1.html";
  }
  if(officeCode == "hu"){
    url = url + "uptown/index1.html";
  }
  if(officeCode == "Ad"){
    url = url + "addison/index1.html";
  }
  if(officeCode == "Bi"){
    url = url + "birmingham/index1.html";
  }
  if(officeCode == "Br"){
    url = url + "broomfield/index1.html";
  }
  if(officeCode == "Ga"){
    url = url + "gardena/index1.html";
  }
  if(officeCode == "DTC"){
    url = url + "dtc/index1.html";
  }
  if(officeCode == "DLA"){
    url = url + "figueroa/index1.html";
  }
  if(officeCode == "Sc"){
    url = url + "kierland/index1.html";
  }
  if(officeCode == "Ph"){
    url = url + "shea/index1.html";
  }
  if(officeCode == "LV"){
    url = url + "las_vegas/index1.html";
  } 
  if(officeCode == "Mem"){
    url = url + "memphis/index1.html";
  }
  if(officeCode == "Me"){
    url = url + "mesa/index1.html";
  }
  if(officeCode == "MV"){
    url = url + "mission-viejo/index1.html";
  }
  if(officeCode == "ND"){
    url = url + "north-dallas/index1.html";
  } 
  if(officeCode == "RSM"){
    url = url + "rancho-santa-margarita/index1.html";
  } 
  if(officeCode == "SF"){
    url = url + "san_francisco/index1.html";
  }     
  if(officeCode == "LC"){
    url = url + "south-shore-harbor/index1.html";
  }     
  
  if(officeCode == "Ho"){ 
    url = url + "honolulu/index1.html";
  }

  if(officeCode == "Sd"){
    url = url + "sandiego/index1.html";
  }

if(officeCode == "GLE"){
    url = url + "GLE/index1.html";
  }

if(officeCode == "aa"){
    url = url + "ALP/index1.html";
  }

if(officeCode == "Ont"){
    url = url + "ONT/index1.html";
  }

if(officeCode == "INV"){
    url = url + "INV/index1.html";
  }
  
*/

window.open(url, "360View", "width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");  

}//close function


  

/*
var pages = new Array();
pages["default"] = "page";
pages["locations"] = "page";
pages["office_programs"] = "page";
pages["value_added_services"] = "page";
pages["meeting_rooms"] = "page";
pages["professional_solutions"] = "page";
pages["brokers"] = "page";
pages["about_coc"] = "page";
pages["contact_us"] = "page";
pages["office"] = "page";
pages["virtual_offices"] = "page";
pages["full_time"] = "page";
pages["part_time_offices"] = "page";
pages["word_processing"] = "page";
pages["desktop_publishing"] = "page";
pages["presentations"] = "page";
pages["copying"] = "page";
pages["catering"] = "page";
pages["it"] = "page";
pages["Telecomunications"] = "page";
pages["rooms"] = "page";
pages["catering"] = "page";
pages["equipment"] = "page";
pages["reservations"] = "page";
pages["accountants"] = "page";
pages["attorneys"] = "page";
pages["real_estate"] = "page";
pages["mortgage_brokers"] = "page";
pages["financial_planners"] = "page";
pages["sales_professionals"] = "page";
pages["entrepreneurs"] = "page";
pages["inquiries"] = "page";
pages["history"] = "page";
pages["testimonials"] = "page";
pages["news"] = "page";
pages["careers"] = "page";
*/



// DEPRECATED
/* 
function gotoMapQuest(officeCode){
  var url = "http://www.mapquest.com/maps/map.adp";
  var parameters = "?searchtype=address&country=US&searchtab=home";
  if (officeCode == "Ad"){             
    parameters = parameters + "";  
  }

  window.open(url, "mapQuest", "status=no;toolbar=no;resize=yes;scroll=yes");
  
}
*/

