var arrListingImgs;
// Get Object //
	function getObj(oId){var d=document,el=d.getElementById?d.getElementById(oId):d.all?d.all[oId]:d[oId];if(el){return el;}}
// RollOver Code //
	var eM,sID="_hover",sCN="r",arrForms,theActiveForm;
	function doImages(e){var d=document; var images=d.getElementsByTagName?d.getElementsByTagName("img"):d.images;eM=(e)?(e.eventPhase)?"W3C":"NN4":(window.event)?"IE4+":"unknown";for(var i=0;i<images.length;i++){if(images[i].className.toLowerCase()==sCN){images[i].onmouseover=doRollOver;images[i].onmouseout=doRollOut;}}if(eM=="NN4"){d.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);}return true;}
	function doRollOut(e){if(eM=="IE4+")e=event;switch(eM){case "IE4+":var xt=e.srcElement.src.substring(e.srcElement.src.lastIndexOf("."),e.srcElement.src.length);var fsrc=e.srcElement.src.substring((e.srcElement.src.lastIndexOf("/")+1),e.srcElement.src.lastIndexOf("_"));var ipath=e.srcElement.src.substring(0,e.srcElement.src.lastIndexOf("/")+1);e.srcElement.src=ipath+fsrc+xt;break;case "W3C":var xt=e.target.src.substring(e.target.src.lastIndexOf("."),e.target.src.length);var fsrc=e.target.src.substring((e.target.src.lastIndexOf("/")+1),e.target.src.lastIndexOf("_"));var ipath=e.target.src.substring(0,e.target.src.lastIndexOf("/")+1);e.target.src=ipath+fsrc+xt;break;case "NN4":break;}return true;}
	function doRollOver(e){if(eM=="IE4+")e=event;switch(eM){case "IE4+":var xt=e.srcElement.src.substring(e.srcElement.src.lastIndexOf("."),e.srcElement.src.length);var fsrc=e.srcElement.src.substring((e.srcElement.src.lastIndexOf("/")+1),e.srcElement.src.lastIndexOf("."));var ipath=e.srcElement.src.substring(0,e.srcElement.src.lastIndexOf("/")+1);e.srcElement.src=ipath+fsrc+sID+xt;break;case "W3C":var xt=e.target.src.substring(e.target.src.lastIndexOf("."),e.target.src.length);var fsrc=e.target.src.substring((e.target.src.lastIndexOf("/")+1),e.target.src.lastIndexOf("."));var ipath=e.target.src.substring(0,e.target.src.lastIndexOf("/")+1);e.target.src=ipath+fsrc+sID+xt;break;case "NN4":break;}return true;}

// Get Page Path for Forms that need the "from" page
	function setPageString(oFormName,oPhldr){var theForm=eval('document.'+oFormName),el;if(theForm)el=eval('theForm.'+oPhldr);if(el){el.value=location.href;}return;}

// Popup Windows //
	var win= null;
	function popWin(mypage,myname,w,h,scroll){var winl = (screen.width-w)/2,wint = (screen.height-h)/2,settings  ='height='+h+',';settings +='width='+w+',';settings +='top='+wint+',';settings +='left='+winl+',';settings +='scrollbars='+scroll+',';settings +='resizable=no';win=window.open(mypage,myname,settings);if(parseInt(navigator.appVersion) >= 4){win.window.focus();}}
	//Launch Pop-up Window for Portfolio & Watermark Mortgage Group
	function launch(theURL,winName) {var win=null;y=175,w=(screen.width-10),h=(screen.height-y),features = 'height='+h+',';features +='width='+w+',';features +='top=0,';features +='left=0,';features +='location=yes,';features +='menubar=yes,';features +='resizable=yes,';features +='scrollbars=yes,';features +='status=yes,';features +='toolbar=yes';win=window.open(theURL,winName,features);if(parseInt(navigator.appVersion) >= 4) {win.window.focus();}}
	// Get Photo in Popup Window //
	function getLargePhoto(URL,W,H){var photoWin= null,wScroll= "no",reSize= "no",aW = screen.availWidth,aH = screen.availHeight,wW=20 + (parseInt(W)),wH=40 + (parseInt(H));if (wW > aW) { wW = aW; wScroll = "yes"; reSize = "yes"; }if (wH > aH) { wH = aH; wW = (wW + 30); wScroll = "yes"; reSize = "yes"; }var winTop=(aH - wH)/2,winLeft=(aW - wW)/2;var strImage="<html>\r";strImage += "<head>\r";strImage += "<SCR"+"IPT language='JavaScript'> \r";strImage += "<!-- \r";strImage += "function reSize(){ \r";strImage += "if (window.width != "+wW+"){ \r";strImage += " var wW = "+wW+";} \r";strImage += "if (window.height != "+wH+"){ \r";strImage += " var wH = "+wH+";} \r";strImage += "  window.resizeTo(wW,wH); \r";strImage += "  window.moveTo("+winLeft+","+winTop+"); \r";strImage += "} \r";strImage += "//--> \r";strImage += "</scr"+"ipt> \r";strImage += "</head> \r";strImage += "<body bgcolor='#FFFFFF' topmargin='5' leftmargin='5' marginwidth='5' marginheight='5' onLoad='reSize();'> \r";strImage += "<p align='center'><a href='javascript:self.close();'> \r";strImage += "<img src='"+URL+"' border='0' width='"+W+"' height='"+H+"'> \r";strImage += "</a></p> \r";strImage += "</body></html> \r";photoWin = window.open('','photoWin','width='+wW+',height='+wH+',left='+winLeft+',top='+winTop+',scrollbars='+wScroll+',resizable='+reSize+'');photoWin.window.focus();photoWin.document.open();photoWin.document.write(strImage);photoWin.document.close();}
	// Morph Popup Windows when needed
	function morph(w,h){var sw=screen.availWidth,sh=screen.availHeight,l=(sw-w)/2,t=(sh-h)/2;window.moveTo(l,t);window.resizeTo(w,h);}
	
	
	function getImg(Img,W,H){ 
		var photoWin 	= null;
		var wScroll 	= "no";
		var reSize		= "no";
		var URL 			= "/images/" +Img; 
		var aW 				= screen.availWidth;
		var aH 				= screen.availHeight;
		var wW 				= 20 + (parseInt(W));
		var wH 				= 40 + (parseInt(H));
		
		if (wW > aW) { wW = aW; wScroll = "yes"; reSize = "yes"; }
		if (wH > aH) { wH = aH; wW = (wW + 30); wScroll = "yes"; reSize = "yes"; }			
		var winTop		= (aH - wH)/2;												
		var winLeft 	= (aW - wW)/2;
		var strImage 	= "<html>\r";
				strImage += "<head>\r";
				strImage += "<SCR"+"IPT language='JavaScript'> \r";
				strImage += "<!-- \r";
				strImage += "function reSize(){ \r";
				strImage += "if (window.width != "+wW+"){ \r"; 							//checks existing window width
				strImage += " var wW = "+wW+";} \r"; 					 							//sets the window width to the appropriate value
				strImage += "if (window.height != "+wH+"){ \r";							//checks existing window height
				strImage += " var wH = "+wH+";} \r";					 							//sets the window height to the appropraite value
				strImage += "  window.resizeTo(wW,wH); \r";		 							//resizes the window to the new window width & height values (if necessary)
				strImage += "  window.moveTo("+winLeft+","+winTop+"); \r";	//moves the window to the appropriate place on the screen
				strImage += "} \r";
				strImage += "//--> \r";
				strImage += "</scr"+"ipt> \r";
				strImage += "</head> \r";
				strImage += "<body bgcolor='#FFFFFF' topmargin='5' leftmargin='5' marginwidth='5' marginheight='5' onLoad='reSize();'> \r";
				strImage += "<p align='center'><a href='javascript:self.close();'> \r";
				strImage += "<img src='"+URL+"' border='0' width='"+W+"' height='"+H+"'> \r";
				strImage += "</a></p> \r";
				strImage += "</body></html> \r";
		photoWin = window.open('','photoWin','width='+wW+',height='+wH+',left='+winLeft+',top='+winTop+',scrollbars='+wScroll+',resizable='+reSize+'');
		photoWin.window.focus();
		photoWin.document.open();
		photoWin.document.write(strImage);
		photoWin.document.close();
	}

// Send Comment (on details page)
	function sendComments(){var comments=null;if(window.screen){var w=220,h=200,aW=screen.availWidth,aH=screen.availHeight,winLeft=(aW-w)/2,winTop=(aH-h)/2;comments=window.open('','comments','width='+w+',height='+h+',top='+winTop+',left='+winLeft+',resize=no,scrollbars=no');}if(parseInt(navigator.appVersion >= 4)){comments.window.focus();}}


// Initialize Page //
	function win_init(e){doImages(e);}
	window.onload=win_init;
