﻿// JScript File

//Global vars
//var imgName = "MapUSA";
//var ext = ".gif";
//var imgFolder = "Images/mapimages/"

////Preload Map Function
//var myImages=new Array()
//function preloadMapImages(){
// for (i=0; i<preloadMapImages.arguments.length;i++){
//  myImages[i]=new Image()
//  myImages[i].src= imgFolder + preloadMapImages.arguments[i] + ext
//  }
//}

////Mapover Map Change
//function highlight( which )
//{
//    if (which == "0")
//    {
//     which = "MapUSA";
//     document.images[imgName].src = imgFolder + which + ext;
//    }
//   document.images[imgName].src = imgFolder + which + ext; 
//}



function maskURL( e ) {   
if ( !e ) e = window.event;   
var el = e.target ? e.target : e.srcElement;   
while ( el != null && el.tagName != "A" ) el = el.parentNode;   
if ( el == null ) return;   
if ( e.preventDefault ) e.preventDefault();   
else e.returnValue = true;
}

function tabChange( which, source ){
	document[which].src = "Images/tabImages/" + source;
}

function helpChange( which, source ){
	document[which].src = "Images/" + source;
}

function fullSize(path) {
   path = path.replace("M.jpg", "L.jpg");
   window.open (path, "fullSize", "height=600, width=800, resizable=no");
}

function swapImage(img){	
	if (document.thumb2.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb2.src = oldMain;
	}else if (document.thumb3.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb3.src = oldMain;
	}else if (document.thumb4.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb4.src = oldMain;
	}else if (document.thumb5.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb5.src = oldMain;
	}else if (document.thumb6.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb6.src = oldMain;
	}else if (document.thumb7.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb7.src = oldMain;
	}else if (document.thumb8.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb8.src = oldMain;
	}else if (document.thumb9.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb9.src = oldMain;
	}else if (document.thumb10.src == img){
        var oldMain = document.imgMain.src;
	oldMain = oldMain.replace("M.jpg", "T.jpg");
        img = img.replace("T.jpg", "M.jpg");
        document.imgMain.src = img;
	document.thumb10.src = oldMain;
	}
}

//am = "The Right-Click function is disabled. If you are attempting to copy or paste text, please use Ctrl-C or Ctrl-V.";

//bV  = parseInt(navigator.appVersion)
//bNS = navigator.appName=="Netscape"
//bIE = navigator.appName=="Microsoft Internet Explorer"

//function nrc(e) {
//   if (bNS && e.which > 1){
//     alert(am)
//     return false
//   } else if (bIE && (event.button >1)) {
//     alert(am)
//     return false;
//   }
//}

//document.onmousedown = nrc;
//if (document.layers) window.captureEvents(Event.MOUSEDOWN);
//if (bNS && bV<5) window.onmousedown = nrc;

function helpWindow(path) {
   if (path == "tNum"){
   window.open ("Help/tNum.aspx", "helpWindow", "height=200,width=300,resizable=no,status=no,titlebar=no");
   }
   else if(path == "propAddr"){
   window.open ("Help/propAddr.aspx", "helpWindow", "height=200,width=450,resizable=no,status=no,titlebar=no");
   }
   else if(path == "zipCode"){
   window.open ("Help/zipCode.aspx", "helpWindow", "height=200,width=300,resizable=no,status=no,titlebar=no");
   }
   else if(path == "New"){
   window.open ("Help/New.aspx", "helpWindow", "height=200,width=420,resizable=no,status=no,titlebar=no");  
   }
   else if(path == "advSearch"){
   window.open ("Help/advSearch.aspx", "helpWindow", "height=200,width=420,resizable=no,status=no,titlebar=no");  
   }   
   else if(path == "saleStatus"){
   window.open ("Help/saleStatus.aspx", "helpWindow", "height=530,width=420,resizable=no,status=no,titlebar=no");  
   }   
   else if(path == "loggingIn"){
   window.open ("/Help/LoggingIn.aspx", "helpWindow", "height=530,width=420,resizable=no,status=no,titlebar=no");  
   }   
}

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["ifrm"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
//tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller