﻿<!-- Hide me from ye olde browsers

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindowToolbar(url,x,y)
{
   l = Math.round((screen.width - x) / 2);
   t = Math.round((screen.height - y) / 2);
   w = window.open(url,'popup','scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,menubar=yes,resizable=yes');
   w.focus();
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindow(url,x,y)
{
   l = Math.round((screen.width - x) / 2);
   t = Math.round((screen.height - y) / 2);
   w = window.open(url,'popup','scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,resizable=yes');
   w.focus();
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindow1(url,winname,x,y)
{
   l = Math.round((screen.width - x) / 2);
   t = Math.round((screen.height - y) / 2);
   w = window.open(url,winname,'scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,resizable=yes');
   w.focus();
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindowPos(url,winname,x,y,t,l)
{
   l = Math.round((screen.width - x) / 2);
   t = Math.round((screen.height - y) / 2);
   w = window.open(url,winname,'scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',top=' + t + ',left=' + l + ',toolbar=no,resizable=no');
   w.focus();
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function deactivateLinks()
{
for (var i = 0; i < document.links.length; i++) {
    //alert(document.links[i].href);
     if (document.links[i].href != "javascript:window.print();") {
        document.links[i].href="javascript:void(0)";
        document.links[i].target="";
     }
   }

for (var i=0; i < document.forms[0].elements.length; i++) {
     //alert(document.forms[0].elements[i].type);
     if (document.forms[0].elements[i].type == "select-one") {
       var lst = document.forms[0].elements[i];
       lst.disabled = true;
       /*
       for (var j=0; j < lst.options.length; j++) {
           lst.options[j].value="#";
       }
       */
     }
   }
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function TransportSelect_onchange(obj) {
    pos = location.href.indexOf("&mode=");
    if (pos > -1) {
        u = location.href.substr(0,pos);
    } else {
        u = location.href
    }
    u = u + "&mode=" + obj[obj.selectedIndex].value.toLowerCase();
    //alert("u=" + u);
    location.href = u;
}

function TransportSelect_dochange(obj) {
    document.getElementById("car1").className="transportItemHidden";
    document.getElementById("bus1").className="transportItemHidden";
    document.getElementById("train1").className="transportItemHidden";
    document.getElementById("map1").className="transportItemHidden";
    document.getElementById("car2").className="transportItemHidden";
    document.getElementById("bus2").className="transportItemHidden";
    document.getElementById("train2").className="transportItemHidden";
    document.getElementById("map2").className="transportItemHidden";
    //alert(obj.name);
    //alert(obj.id);
    //alert(obj[obj.selectedIndex].value);
    document.getElementById(obj[obj.selectedIndex].value+"1").className="transportItem1Visible";
    document.getElementById(obj[obj.selectedIndex].value+"2").className="transportItem2Visible";
    
    document.images("map").src = "images/transport_" + obj[obj.selectedIndex].value + ".jpg";
    document.images("icon").src = "images/img_icon_con_" + obj[obj.selectedIndex].value + ".gif";
}

//Generating Pop-up Print Preview page
function getPrint(print_area,x,y)
{	
    l = Math.round((screen.width - x) / 2);
    t = Math.round((screen.height - y) / 2);
    
	//Creating new page
	//var pp = window.open('','popup','scrollbars=yes,status=no,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,resizable=yes');
	var pp = window.open('','popup','scrollbars=yes,status=yes,top=' + t + ',left=' + l + ',width=' + x + ',height=' + y + ',toolbar=no,menubar=yes,resizable=yes');
	//Adding HTML opening tag with <HEAD> … </HEAD> portion 
	pp.document.writeln('<HTML><HEAD><title>Print Preview</title><LINK href=stylesheet.css  type="text/css" rel="stylesheet"><script src="scripts_global.js" type="text/javascript"></script><script src="swfobject.js" type="text/javascript"></script>')
	pp.document.writeln('<style type="text/css"> .hidebutton { visibility:hidden } </style><LINK href=print.css  type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
	//Adding Body Tag
	pp.document.writeln('<body onload="alert();window.print();" _MS_POSITIONING="GridLayout" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">');
    //pp.document.writeln('<script>function WebForm_DoPostBackWithOptions() { alert("here"); void(0); } function window.onload() { __doPostBack = WebForm_DoPostBackWithOptions; }</script>');
	//Adding form Tag
	pp.document.writeln('<form  method="post">');
	//Creating two buttons Print and Close within a table
	pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right><INPUT ID="PRINT" type="button" value="Print" onclick="javascript:location.reload(true);window.print();"><!--<INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();">--></TD></TR><TR><TD></TD></TR></TABLE>');
	//Writing print area of the calling page
	pp.document.writeln(document.getElementById(print_area).innerHTML);
	//Ending Tag of </form>, </body> and </HTML>
	pp.document.writeln('</form></body><script>deactivateLinks();</script></HTML>');	
	pp.focus();		
	//pp.print();
}	
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

function openImageWindow(uedID) {
    var w = window.open("imageselect.aspx?uedID=" + uedID,"fileselect","height=400,width=600,scrollbars=yes,status=yes");
}

function openCatalogWindow(uedID) {
    var w = window.open("catalogselect.aspx?uedID=" + uedID,"fileselect","height=400,width=600,scrollbars=yes,status=yes");
}

function openFileWindow(uedID) {
    var w = window.open("fileselect.aspx?uedID=" + uedID,"fileselect","height=400,width=600,scrollbars=yes,status=yes");
}

function insertImage2(fn,alt,uedID) {
    UltimateEditors[uedID].StoreCurrentRange(); 
    ftype = fn.substr(fn.lastIndexOf('.')+1,(fn.length - fn.lastIndexOf('.') - 1));
  
    if (ftype.toUpperCase()=="PDF") {
       htmlStr = "<a href='../contentimages/" + fn + "' target='_blank'>" + alt + "<img src='../images/ecblank.gif' border=0 width=10 height=1><img src='../images/pdf.gif' border=0 align=absmiddle></a>";
    } else {
       htmlStr = "<img src='../contentimages/" + fn + "' alt='" + alt + "' border=0>";
    }
    UltimateEditors[uedID].InsertText(htmlStr);
}

function insertPageAnchor(uedID) {
    alert('insertPageAnchor');
    UltimateEditors[uedID].StoreCurrentRange(); 
    var htmlStr = prompt('Please enter Anchor Name:', 'AnchorName');
    htmlStr = "<a name='" + htmlStr + "'>";
    UltimateEditors[uedID].InsertText(htmlStr);    
}


function linkPageAnchor(uedID) {
    win = window.open("pageAnchorSelect.htm?ueid="+uedID+";", "Window3", "width=320,height=210");  
}


function openImagePopupWindow() {
    var w = window.open("imagePopupselect.aspx","imagePopupselect","height=400,width=600,scrollbars=yes,status=yes");
}

function openRolloverButtonWindow() {
    var w = window.open("rolloverbuttonselect.aspx","rolloverbuttonselect","height=400,width=600,scrollbars=yes,status=yes");
}

function insertImage(s) {
    
    UltimateEditors[editID].StoreCurrentRange(); 
    var htmlStr = "<img src='images/" + s + "' alt='alt tag' _align=right>";
    //var htmlStr = "<a href='images/" + s + "'>" + s + "</a>";
    UltimateEditors[editID].InsertHTML(htmlStr);
}

function insertFile(s) {
    //var altTag = prompt('Please enter the alt text for the image',s);
    UltimateEditors[editID].StoreCurrentRange(); 
    //var htmlStr = "<img src='images/" + s + "' alt='" + altTag + "'>";
    var htmlStr = "<a href='pdf/" + s + "'>" + s + "</a>";
    UltimateEditors[editID].InsertHTML(htmlStr);
}

function insertImagePopup(s, altTag) {
    
    UltimateEditors[editID].StoreCurrentRange(); 
    var htmlStr = "<a href=javascript:openWindow('imagePopup.aspx?image=" + s + "',400,400)><img src='images/" + s + "' border=0 vspace=0 hspace=0 alt='" + altTag + "'></a>";
    //var htmlStr = "<a href='images/" + s + "'>" + s + "</a>";
    UltimateEditors[editID].InsertHTML(htmlStr);
}

function insertRolloverButton(b1, b2, urlstr) {
    
    UltimateEditors[editID].StoreCurrentRange(); 
    //var htmlStr = "<A onmouseover=""document.images['" + b1 + "'].src='images/" + b2 + "';"" onmouseout=""document.images['" + b1 + "'].src='images/" + b1 + "';"" href=""" + urlStr + """>"
    //htmlStr &= "<IMG src="""+ b1 + """ border=0 name=" + b1 + "></A>";
    var htmlStr = "<A onmouseover=\"document.images['" + b1 + "'].src='images/" + b2 + "';\" onmouseout=\"document.images['" + b1 + "'].src='images/" + b1+ "';\" href=\"" + urlstr + "\"><IMG src=\"images/" + b1 + "\" border=0 name=\"" + b1 + "\"></A>";
    UltimateEditors[editID].InsertHTML(htmlStr);
}

function QTMovie(mfile) {
//alert("http://localhost/MacarthurSquare/" + mfile);
document.write("<OBJECT codeBase='http://www.apple.com/qtactivex/qtplugin.cab' width=240 height=145 classid=clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B>");
//document.write("<param name='src' value='http://localhost/MacarthurSquare/" + mfile + "'>");
document.write("<param name='src' value='" + mfile + "'>");
document.write("<param name='autoplay' value='false'>");
document.write("<param name='controller' value='true'>");
document.write("<param name='loop' value='true'>");
//document.write("<EMBED src='http://localhost/MacarthurSquare/" + mfile + "' width='240' height='145' autoplay='false' controller='true' loop='true' pluginspage='http://www.apple.com/quicktime/download/'>");
document.write("<EMBED src='" + mfile + "' width='240' height='145' autoplay='false' controller='true' loop='true' pluginspage='http://www.apple.com/quicktime/download/'>");
document.write("</EMBED></OBJECT>");
}

function CreateBookmarkLink() { 
    title = document.title;   
    url = location.href;  
    if (window.sidebar) { 
        // Mozilla Firefox Bookmark		
        //alert('1');
        window.sidebar.addPanel(title, url,"");	
        alert("Firefox/Netscape users: This link will open in your Sidebar\nrather than the main page!\nTo prevent this please right click the link and choose\n'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is unavoidable with Firefox");
    } else if( window.external ) { 
        // IE Favorite		
        //alert('2');
        window.external.AddFavorite(url, title); 
    } else if(window.opera && window.print) { 
        // Opera Hotlist		
        //alert('3');
        alert("Opera users: By Default this link will open in your Sidebar\nrather than the main page!\nTo prevent this please uncheck the box marked\n'Show in Panel' that appears on the Add Bookmark window\n\nSorry about this, but it is currently unavoidable with Opera");    
        var mbm = document.createElement('a');    
        mbm.setAttribute('rel','sidebar');    
        mbm.setAttribute('href',url);    
        mbm.setAttribute('title',title);    
        mbm.click();
    }     
} 

//--------------------------------------------------------------------------------------------------------

function toggleDetails(elementId) {

divs = document.getElementsByTagName("div");
idArray = new Array();
 
    for (x=0; x<divs.length; x++) {
        if (divs[x].className=="employmentdetail") {
           divs[x].style.display = 'none';
        }
    }
    
    
var element = document.getElementById(elementId);
      
if (element.style.display == '')
   element.style.display = 'none';
else
   element.style.display = ''; 
}


//-->