var revdir = "";var mapclicklogged = "false";
function MM_preloadImages()
{
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 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_findObj(n, d) { //v4.01
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);
if(!x && d.getElementById) x=d.getElementById(n); 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_callJS(jsStr) { //v2.0
return eval(jsStr)
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
function loadBPFormDD( actionType, lid ){
myLID=lid;
clearDOM('dd_results');
document.ddform.routeType[defaultradio].checked=true;
document.ddform.ddfrom.value=defaultfrom;
document.ddform.ddto.value=defaultto;
setInnerHTML('ddtoError', '&nbsp;', 'black');
setInnerHTML('ddfromError', '&nbsp;', 'black');
var sendButton = findDOM('sendButtondd');
if(sendButton){
sendButton.value = "Send";
sendButton.disabled = false;
}
showBPContainer('actionsContainerDD');
document.getElementById('ddfrom').focus();
}
function closeBPFormDD( actionType ){
if (document.getElementById(actionType) != null)
{
clearDOM('ddfrom');
clearDOM('ddto');
setInnerHTML('ddfromError', '&nbsp;', 'black');
setInnerHTML('ddtoError', '&nbsp;', 'black');
}
hideBPContainer('actionsContainerDD');
}
function loadBPFormWN( actionType, lid ){
myLID=lid;
clearDOM('wn_results');
document.wnform.wnkwd.value="";
setInnerHTML('wnKwdError', '&nbsp;', 'black');
var sendButton = findDOM('sendButtonwn');
if(sendButton){
sendButton.value = "Send";
sendButton.disabled = false;
}
showBPContainer('actionsContainerWN');
document.getElementById('wnkwd').focus();
}
function closeBPFormWN( actionType ){
if (document.getElementById(actionType) != null)
{
clearDOM('wnkwd');
setInnerHTML('wnKwdError', '&nbsp;', 'black');
}
hideBPContainer('actionsContainerWN');
}
function showBPContainer(container)
{
document.getElementById(container).style.visibility = 'visible';
}
function hideBPContainer(container)
{
if (document.getElementById(container) != null)
{
document.getElementById(container).style.visibility = 'hidden';
}
}
function validateDDForm(evt)
{
var f = document.getElementById('ddfrom');
var t = document.getElementById('ddto');
if(f == null || trim(f.value) == '' ||
t == null || trim(t.value) == '')
{
if(f == null || trim(f.value) == '')
{
setInnerHTML('ddfromError','&nbsp;You must enter a FROM location.', 'red');
}
if(t == null || trim(t.value) == '')
{
setInnerHTML('ddtoError','&nbsp;You must enter a TO location.', 'red');
}
if(window.event)
window.event.returnValue = false;
else
evt.preventDefault();
}
}
function validateWNForm(evt)
{
var k = document.getElementById('wnkwd');
if(k == null || trim(k.value) == '')
{
setInnerHTML('wnKwdError','&nbsp;You must enter a search keyword.', 'red');
if(window.event)
window.event.returnValue = false;
else
evt.preventDefault();
}
}
function reverseDDirections()
{
//revdir variable toggles between '' and ':Reverse Directions' each time user clicks
//the 'Reverse this Route' action link. So, if the user clicks the action link
//twice, we're back to the original 'to' 'from' directions and revdir is ''.
//This information is used in Omniture tracking to see if rev dirs are requested.
if (revdir == ":Reverse Directions") {
revdir="";
}
else {
revdir=":Reverse Directions";
}
swap('ddfrom','ddto');
setInnerHTML('ddfromError', '&nbsp;', 'black');
setInnerHTML('ddtoError', '&nbsp;', 'black');
}
function swap(wpA, wpB)
{
//alert("swapping " + wpA + " and " + wpB);
var ctrlA = document.getElementById(wpA);
var ctrlB = document.getElementById(wpB);
var tmp = ctrlA.value;
ctrlA.value = ctrlB.value;
ctrlB.value = tmp;
}
function iframeListenerOn()
{
window.mapframe.onfocus = logInMapClickOnce;
document.getElementById("mapframe").onfocus = logInMapClickOnce;
}
function logInMapClickOnce()
{
//User can click within interactive map multiple times per page view, so just
//write it to Omniture once on the first click.
if (mapclicklogged == "false") {
clickTrackSwbdLstg('BP:Map:Within Map','','');
mapclicklogged = "true";
}
}
//Added 04-14-09 for CitySearch Beacon tracking
function viewLargeMapBeacon(entityid) {
if (document.images) {
var imageSrc = "http://api.citysearch.com/tracker/imp?action_target=listing_map&listing_id="+entityid+"&publisher=superpages&reference_id=1&placement=map_impression";
document.images['viewlargemapbeacon'].src = imageSrc;
}
}
function autoIframe(frameId){
if (document.getElementById(frameId) == null) return;
frame = document.getElementById(frameId);
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 10;
//alert(innerDoc.body.scrollHeight);
//alert(frame.height);
document.getElementById(frameId).height = innerDoc.body.scrollHeight;
}
