// workaround for absence of target attributes in xhtml strict

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

// Obfuscate email
function obfuscate(type) {
var obfuscated = '';

if (type == 'contact')
	obfuscated = String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,97,100,109,105,110,64,97,112,115,103,114,111,117,112,46,99,111,109,46,115,103,34,62,97,100,109,105,110,64,97,112,115,103,114,111,117,112,46,99,111,109,46,115,103,60,47,97,62)

document.write(obfuscated);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var menu_ourcompanies=new Array()
menu_ourcompanies[0]='<a href="ourcompanies_apslifestyle.html"><img src="img/menu_ourcompanies_apslifestyle_off.png" class="png" width="138" height="33" alt="APS Lifestyle" '
+ 'onmouseover="this.src=\'img/menu_ourcompanies_apslifestyle_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_ourcompanies_apslifestyle_off.png\'; return true" '
+ '/></a>'
menu_ourcompanies[1]='<a href="ourcompanies_dorisontravel.html"><img src="img/menu_ourcompanies_dorisontravel_off.png" class="png" width="138" height="26" alt="Dorison Travel" '
+ 'onmouseover="this.src=\'img/menu_ourcompanies_dorisontravel_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_ourcompanies_dorisontravel_off.png\'; return true" '
+ '/></a>'
menu_ourcompanies[3]='<a href="#" onClick="return false;" style="cursor:default;"><img src="img/menu_ourcompanies_apsliving_off.png" class="png" width="138" height="26" alt="APS Living" '
+ 'onmouseover="this.src=\'img/menu_ourcompanies_apsliving_off.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_ourcompanies_apsliving_off.png\'; return true" '
+ '/></a>'
menu_ourcompanies[4]='<a href="#" onClick="return false;" style="cursor:default;"><img src="img/menu_ourcompanies_chengtu_off.png" class="png" width="138" height="34" alt="Chengtu Enterprises" '
+ 'onmouseover="this.src=\'img/menu_ourcompanies_chengtu_off.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_ourcompanies_chengtu_off.png\'; return true" '
+ '/></a>'

var menu_projects=new Array()
menu_projects[0]='<a href="projects_apsbuilding.html"><img src="img/menu_projects_apsbuilding_off.png" class="png" width="123" height="32" alt="APS Building" '
+ 'onmouseover="this.src=\'img/menu_projects_apsbuilding_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_apsbuilding_off.png\'; return true" '
+ '/></a>'

/*
menu_projects[1]='<a href="projects_vizatholland.html"><img src="img/menu_projects_vizatholland_off.png" class="png" width="123" height="26" alt="Viz at Holland" '
+ 'onmouseover="this.src=\'img/menu_projects_vizatholland_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_vizatholland_off.png\'; return true" '
+ '/></a>'
*/

menu_projects[2]='<a href="projects_centenniasuites.html"><img src="img/menu_projects_centenniasuites_off.png" class="png" width="123" height="25" alt="Centennia Suites" '
+ 'onmouseover="this.src=\'img/menu_projects_centenniasuites_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_centenniasuites_off.png\'; return true" '
+ '/></a>'

menu_projects[3]='<a href="projects_twinpeaks.html"><img src="img/menu_projects_twinpeaks_off.png" class="png" width="123" height="24" alt="Twin Peaks" '
+ 'onmouseover="this.src=\'img/menu_projects_twinpeaks_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_twinpeaks_off.png\'; return true" '
+ '/></a>'

menu_projects[4]='<a href="projects_thetrizon.html"><img src="img/menu_projects_thetrizon_off.png" class="png" width="123" height="25" alt="The Vision" '
+ 'onmouseover="this.src=\'img/menu_projects_thetrizon_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_thetrizon_off.png\'; return true" '
+ '/></a>'

/*
menu_projects[5]='<a href="projects_montebleu.html"><img src="img/menu_projects_montebleu_off.png" class="png" width="123" height="25" alt="Monte Bleu" '
+ 'onmouseover="this.src=\'img/menu_projects_montebleu_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_montebleu_off.png\'; return true" '
+ '/></a>'*/

menu_projects[5]='<a href="projects_thevision.html"><img src="img/menu_projects_thevision_off.png" class="png" width="123" height="33" alt="The Vision" '
+ 'onmouseover="this.src=\'img/menu_projects_thevision_on.png\'; return true" '
+ 'onmouseout="this.src=\'img/menu_projects_thevision_off.png\'; return true" '
+ '/></a>'

var menuwidth='123px' //default menu width
var menubgcolor='#151515'  //menu bgcolor
var disappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';" onMouseover="clearhidemenu2();" onMouseout="dynamichide2(event);"></div>')

/* 

document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';" onMouseover="clearhidemenu2();document.images.nav_ourcompanies.src=\'img/menu_ourcompanies_on.gif\';document.images.nav_projects.src=\'img/menu_projects_on.gif\'" onMouseout="dynamichide2(event);document.images.nav_ourcompanies.src=\'img/menu_ourcompanies_off.gif\';document.images.nav_projects.src=\'img/menu_projects_off.gif\'"></div>')

 */

// background-color:'+menubgcolor+'
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide2(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge2(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu2(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu2()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide2(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge2(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge2(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue2()
}

function clickreturnvalue2(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide2(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu2()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu2()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu2(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu2(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu



// run all necessary functions on page load

function loadAll() {
   externalLinks();
}
window.onload = loadAll;
