/// ******************************************************************************************** ///
/// **************************************** \include\anylink.js **************************************** ///
/// ******************************************************************************************** ///

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editing needed
var ie5=document.all
var ns6=document.getElementById&&!document.all
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 showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
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 clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !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=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !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 dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

/// ******************************************************************************************** ///
/// **************************************** \include\vpop.js **************************************** ///
/// ******************************************************************************************** ///


if (window.addEventListener){
	window.addEventListener("mousemove",vToolTipPosition,false);
}else{
	document.onmousemove=vToolTipPosition;
}

function vcardPopup(agentID){
	vPopup("agent_vcard.asp?id="+agentID);
}

function vcalPopup(propertyID,openhouseID){
	vPopup("prop_vcal.asp?propId="+propertyID+"&openHouseId="+openhouseID);
}

function vPopup(url){
	var vWin=window.open(url,"vWin","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=100,height=100");
    vWin.focus();
}

function toggleVToolTip(state){
	if (!document.layers){
		var obj=document.getElementById?document.getElementById("vToolTip"):document.all["vToolTip"];
		obj.style.visibility=state?"visible":"hidden";
		obj.style.left=vTipX+"px";
		obj.style.top=vTipY+"px";
	}
}

function writeVCardToolTip(){
	writeVToolTip("Download VCard","Click to download this agent's contact information into your Address Book. Select OPEN or SAVE when prompted.");
}

function writeVCalToolTip(state){
	writeVToolTip("Save to Calendar","Click to download the Open House date and time to your calendar.<BR><BR>Select OPEN or SAVE when prompted.");
}

function writeVToolTip(strTitle,strTip){
	if (!document.layers){
		document.write("<div id=\"vToolTip\" style=\"position:absolute;visibility:hidden;left:0px;top:0px;width:135px;height:135px;background-image:url(/images/vtooltip.gif);\"><div style=\"position:absolute;visibility:inherit;left:10px;top:23px;width:115px;font:10px Verdana,Helvetica;font-weight:bold;color:#7B815F;\">"+strTip+"</div></div>");
	}
}

var vTipX=0, vTipY=0, vTipOX=0, vTipOY=10;
function vToolTipPosition(e){
	e=e==null?event:e;
	vTipX=vTipOX+e.clientX;
	vTipY=vTipOY+e.clientY;
}


/// ******************************************************************************************** ///
/// **************************************** \ipix.js **************************************** ///
/// ******************************************************************************************** ///

function showIpixWindow(src) {
  NewWindow(src,'IPIX','525','420','no')
}

function showFloorplanWindow(id) {
	NewWindow( "../../floorplan.asp?id=" + id,'floorplan','525','350','yes')
}

function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}


/// ******************************************************************************************** ///
/// **************************************** \nav\nav.js **************************************** ///
/// ******************************************************************************************** ///

var mainNav;	//pointer to array of main nav struct (see function Struct() below)
var subNav;		//pointer to array of sub nav struct


function quickFind(val) {

	if (val[val.selectedIndex].value != '') {
		window.location.href = val[val.selectedIndex].value;
	}
}


function openFrance() {
	window.open("http://www.striblingny.com/france/splash.html", "france", "width=610, height=420, status, toolbar, menubar, resizable");
}


function showSubTopNav() {

go_on = new Image();
go_on.src = "nav/images/go_sm_on.gif";

content='<form action="search-old.asp" method="post"><input type="hidden" name="status_contract" value="true"><input type="hidden" name="status_available" value="true"><input type="hidden" name="status_sold" value="false">' +
'<table border="0" cellpadding="0" cellspacing="0" height="84">' +
	'<tr height="3">' +
		'<td colspan="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" height="3" width="1"></td>' +
		'<td colspan="3" bgcolor="#000000"><img src="images/spacer.gif" height="3" width="1"></td>' +
		'<td bgcolor="#960002"><img src="images/spacer.gif" height="3" width="1"></td>' +
	'</tr>' +
	'<tr height="81">' +
		'<td width=13 align=left bgcolor="#FFFFFF"><img src="nav/images/md/subnav1.gif"></td>' +
		'<td width=151 align=left bgcolor="#FFFFFF"><a href="default.asp"><img src="nav/images/md/subnav2_logo.gif" border="0" alt="Home Page"></a><br>' +
			'<img src="nav/images/md/blk.gif" width="151" height="8"></td>' +
		'<td width=121 align=left bgcolor="#FFFFFF"><img src="nav/images/md/subnav3_whitered.gif" width="121" height="73"><br>' +
			'<img src="nav/images/md/blk.gif" width="121" height="8"></td>' +
		'<td width=21 align=left bgcolor="#000000"><img src="images/spacer.gif" width="21" height="81"></td>' +
		'<td width="141" bgcolor="#000000" valign="top" align="center">' +

			'<table border="0" cellpadding="0" cellspacing="0">' +
				'<tr height="17">' +
					'<td align="left"><img src="nav/images/search.gif"></td>' +
				'</tr>' +
				'<tr height="24" valign="middle">' +
					'<td align="left" nowrap><input name="search" type="text" size="14">' +
						'<input type="image" src="nav/images/go_sm_off.gif" ' +
						'onMouseOver="this.src = \'nav/images/go_sm_on.gif\';" ' +
						'onMouseOut="this.src = \'nav/images/go_sm_off.gif\';" border="0"></td>' +
				'</tr>' +
				'<tr height="13">' +
					'<td><img src="nav/images/search_desc.gif"></td>' +
				'</tr>' +
				'<tr>' +
					'<td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1"></td>' +
				'</tr>' +
			'</table></td>' +

		'<td width=21 align=left bgcolor="#000000"><img src="images/spacer.gif" width="21" height="81"></td>' +
		'<td align=center bgcolor="#960002">' +
						'<table border="0" cellpadding="0" cellspacing="0" width="304">' +
							'<tr height="54">' +
								'<td bgcolor="#960002" valign="middle" height="54"><img src="images/spacer.gif" width="21" height="1">' +
									'<select name="quickfind" onChange="quickFind(this);">' +
									getQuickFindOptions() +
									'</select>' +
								'</td>' +
							'</tr>' +
							'<tr height="27">' +
								'<td bgcolor="#000000"><img src="nav/images/quickfind_text.gif"><br>' +
									'<img src="images/spacer.gif" height="8" width="1">' +
								'</td>' +
							'</tr>' +
						'</table>' +
		'</td>' +
	'</tr>' +
'</table>' +
'</form>&nbsp;';

createLayer("topnav", 0, 0, 775, 84, true, 10, content);

}


function launchMortCalc(price, tax, maintCC) {
	mortCalc = window.open("mortCalc.asp?price=0&tax=0&maintCC=0", "MortCalc", "width=575, height=400");
	mortCalc.focus();
}


function getQuickFindOptions() {
	return '' +
		'<option>QuickFind</option>' +
		'<option value="perfect.asp">My Perfect Apartment</option>' +
		'<option value="javascript:launchMortCalc();">Mortgage Calculator</option>' +
		'<option value="map.asp?mode=rental">For Rent</option>' +
		'<option value="map.asp?mode=sale">For Sale</option>' +
		'<option value="buyers.asp">Buyers Tips</option>' +
		'<option value="javascript:openFrance();">Stribling International</option>' +
		'<option value="search.asp?btype=exclusive">Weekly Exclusives</option>' +
		'<option value="propdev.asp">Property Developments</option>' +
		'<option value="private.asp">Private Brokerage</option>' +
		'<option value="open.asp">Open Houses</option>' +
		'<option value="state.asp">State of the Market</option>' +
		'<option value="lux.asp">Luxury Residential Report</option>' +
		'<option value="luxuryrealestate.asp">Global Real Estate</option>' +
		'<option value="agent_dir.asp">Agent Directory</option>' +
		'<option value="language.asp">Agents by Language</option>' +
		'<option value="about.asp">About Us</option>' +
		'<option value="privacy.asp">Privacy Statement</option>' +
		'<option value="default.asp">Home</option>' +
		''

}


function showLeftNav(currentNavItem, currentSubNavItem) {
	var und;

	if (currentNavItem==und || currentNavItem==null)
		currentNavItem=-1;
	if (currentSubNavItem==und || currentSubNavItem==null)
		currentSubNavItem=-1;



	subNav = MainSubNav(53, 99, currentNavItem, currentSubNavItem);
	mainNav = MainNav(53, 99, currentNavItem);

	if (currentNavItem >= 0 && currentNavItem < mainNav.length) {
		setTimeout('showSub (' + currentNavItem + ')', 500);
	}

}



function showSubLeftNav(currentNavItem, currentSubNavItem) {
	var und;

	if (currentNavItem==und || currentNavItem==null)
		currentNavItem=-1;
	if (currentSubNavItem==und || currentSubNavItem==null)
		currentSubNavItem=-1;



	subNav = SubSubNav(10, 84, currentNavItem, currentSubNavItem);
	mainNav = MainNav(10, 84, currentNavItem);


	if (currentNavItem >= 0 && currentNavItem < mainNav.length) {
		setTimeout('showSub (' + currentNavItem + ')', 500);
	}

}


function MainNav(x, y, curMain){
	var layers = new Array();

	for(i=0; i<8; i++) {
		layers[i] = new layerStruct("nl" + i);
		layers[i].height	= 13;
		layers[i].width		= 125;
		layers[i].left		= x;
		layers[i].top		= y + (i * 18);

	}

	//use this for the selected state
	layers[0].content = '<img name="nav_0" src="nav/images/prop_on.gif" border="0">';
	layers[1].content = '<img name="nav_1" src="nav/images/open_cur.gif" border="0">';
	layers[2].content = '<img name="nav_2" src="nav/images/meetagent_on.gif" border="0">';
	layers[3].content = '<img name="nav_3" src="nav/images/private_brokerage_on.gif" order="0">';
	layers[4].content = '<img name="nav_4" src="nav/images/propdev_cur.gif" border="0">';
	layers[5].content = '<img name="nav_5" src="nav/images/mktrep_on.gif" border="0">';
	layers[6].content = '<img name="nav_6" src="nav/images/affiliations_on.gif" border="0">';
	layers[7].content = '<img name="nav_7" src="nav/images/aboutus_cur.gif" border="0">';

	if (curMain != 0)
		layers[0].content = '<a href="javascript: switchSub(0);" ' +
			'onMouseOver="setImgSrc(\'nav_0\', \'nav/images/prop_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_0\', \'nav/images/prop_off.gif\')" ' +
			'><img name="nav_0" src="nav/images/prop_off.gif" border="0" height="13"></a>';
	if (curMain != 1)
		layers[1].content = '<a href="open.asp"' +
			'onMouseOver="setImgSrc(\'nav_1\', \'nav/images/open_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_1\', \'nav/images/open_off.gif\')" ' +
			'><img name="nav_1" src="nav/images/open_off.gif" border="0"></a>';
	else
		layers[1].width = 136
	if (curMain != 2)
		layers[2].content = '<a href="agent_dir.asp"' +
			'onMouseOver="setImgSrc(\'nav_2\', \'nav/images/meetagent_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_2\', \'nav/images/meetagent_off.gif\')" ' +
			'><img name="nav_2" src="nav/images/meetagent_off.gif" border="0"></a>';
	if (curMain != 3)
		layers[3].content = '<a href="private.asp" ' +
			'onMouseOver="setImgSrc(\'nav_3\', \'nav/images/private_brokerage_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_3\', \'nav/images/private_brokerage_off.gif\')" ' +
			'><img name="nav_3" src="nav/images/private_brokerage_off.gif" border="0" height="13"></a>';
	else
		layers[3].width = 136
	if (curMain != 4)
		layers[4].content = '<a href="propdev.asp" ' +
			'onMouseOver="setImgSrc(\'nav_4\', \'nav/images/propdev_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_4\', \'nav/images/propdev_off.gif\')" ' +
			'><img name="nav_4" src="nav/images/propdev_off.gif" border="0" height="13"></a>';
	else
		layers[4].width = 136;
	if (curMain != 5)
		layers[5].content = '<a href="javascript: switchSub(5);"' +
			'onMouseOver="setImgSrc(\'nav_5\', \'nav/images/mktrep_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_5\', \'nav/images/mktrep_off.gif\')" ' +
			'><img name="nav_5" src="nav/images/mktrep_off.gif" border="0"></a>';
	if (curMain != 6)
			layers[6].content = '<a href="affiliations.asp"' +
				'onMouseOver="setImgSrc(\'nav_6\', \'nav/images/affiliations_on.gif\')" ' +
				'onMouseOut="setImgSrc(\'nav_6\', \'nav/images/affiliations_off.gif\')" ' +
			'><img name="nav_6" src="nav/images/affiliations_off.gif" border="0"></a>';
	if (curMain != 7)
		layers[7].content = '<a href="about.asp"' +
			'onMouseOver="setImgSrc(\'nav_7\', \'nav/images/aboutus_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_7\', \'nav/images/aboutus_off.gif\')" ' +
			'><img name="nav_7" src="nav/images/aboutus_off.gif" border="0"></a>';


//alert(ta);

	for (i=0; i<layers.length; i++) {
		createLayer(layers[i].name,
				layers[i].left,
				layers[i].top,
				layers[i].width,
				layers[i].height,
				layers[i].visible, 20 + i,
				layers[i].content);

	}



	//images to preload, just add them to the images array.
	var images = new Array();
	images[0] = 'nav/images/prop_on.gif';
	images[1] = 'nav/images/open_on.gif'
	images[2] = 'nav/images/meetagent_cur.gif'
	images[3] = 'nav/images/private_brokerage_on.gif'
	images[4] = 'nav/images/propdev_on.gif'
	images[5] = 'nav/images/mktrep_on.gif'
	images[6] = 'nav/images/affiliations_on.gif'
	images[7] = 'nav/images/aboutus_on.gif'

	var preloadedimages = new Array();
	for (i=0; i<images.length; i++){
		preloadedimages[i] = new Image();
		preloadedimages[i].src = images[i];
	}

	return layers;
}


function SubSubNav(x, y, curMain, curSub){
	var layers = new Array();
	var und;

	if (curMain==und || curMain==null) curMain = -1;
	if (curSub==und || curSub==null) curSub = -1;

	for(i=0; i<8; i++) {
		layers[i] = new layerStruct("sl" + i);
		layers[i].height	= 18;
		layers[i].width		= 136;
		layers[i].left		= x;
		layers[i].top		= y + (i * 18);
		layers[i].visible	= false;
	}


// 27 Sep 2003 - added "recent property" link

	layers[0].content = '' +
		((curMain==0 && curSub==0) ?
		('<a href="map.asp?mode=sale"><img name="nav_00" src="nav/images/forsale_cur.gif" border="0"></a><br />') :
		('<a href="map.asp?mode=sale" ' +
		'onMouseOver="setImgSrc(\'nav_00\', \'nav/images/forsale_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_00\', \'nav/images/forsale_off.gif\')" ' +
		'><img name="nav_00" src="nav/images/forsale_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==1) ?
		('<a href="map.asp?mode=rental"><img name="nav_01" src="nav/images/forrent_cur.gif" border="0"></a><br />') :
		('<a href="map.asp?mode=rental" ' +
		'onMouseOver="setImgSrc(\'nav_01\', \'nav/images/forrent_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_01\', \'nav/images/forrent_off.gif\')" ' +
		'><img name="nav_01" src="nav/images/forrent_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==2) ?
		('<img name="nav_02" src="nav/images/international_cur.gif" border="0">') :
		('<a href="affiliations.asp" ' +
		'onMouseOver="setImgSrc(\'nav_02\', \'nav/images/international_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_02\', \'nav/images/international_off.gif\')" ' +
		'><img name="nav_02" src="nav/images/international_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==3) ?
		('<img name="nav_03" src="nav/images/excl_cur.gif" border="0">') :
		('<a href="search.asp?btype=exclusive" ' +
		'onMouseOver="setImgSrc(\'nav_03\', \'nav/images/excl_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_03\', \'nav/images/excl_off.gif\')" ' +
		'><img name="nav_03" src="nav/images/excl_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==4) ?
			('<img name="nav_04" src="nav/images/my_cur.gif" border="0">') :
			('<a href="perfect.asp" ' +
			'onMouseOver="setImgSrc(\'nav_04\', \'nav/images/my_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_04\', \'nav/images/my_off.gif\')" ' +
		'><img name="nav_04" src="nav/images/my_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==5) ?
			('<img name="nav_05" src="nav/images/recent_cur.gif" border="0">') :
			('<a href="search.asp?btype=recent" ' +
			'onMouseOver="setImgSrc(\'nav_05\', \'nav/images/recent_on.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_05\', \'nav/images/recent_off.gif\')" ' +
		'><img name="nav_05" src="nav/images/recent_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==6) ?
			('<img name="nav_06" src="nav/images/QoftheW_int_selected.gif" border="0">') :
			('<a href="quote.asp" ' +
			'onMouseOver="setImgSrc(\'nav_06\', \'nav/images/QoftheW_int_over.gif\')" ' +
			'onMouseOut="setImgSrc(\'nav_06\', \'nav/images/QoftheW_int_off.gif\')" ' +
		'><img name="nav_06" src="nav/images/QoftheW_int_off.gif" border="0"></a><br />')) +
		'';

		layers[0].top			= y + 15;
		layers[0].height		*= 7;


	layers[1].content = '';
		layers[1].top			= layers[0].height + layers[0].top + 15;
		layers[1].height		= 0;

	layers[2].content = '' +
		((curMain==2 && curSub==0) ?
		('<img name="nav_20" src="nav/images/agent_cur.gif" border="0">') :
		('<a href="agent_dir.asp" ' +
		'onMouseOver="setImgSrc(\'nav_20\', \'nav/images/agent_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_20\', \'nav/images/agent_off.gif\')" ' +
		'><img name="nav_20" src="nav/images/agent_off.gif" border="0"></a><br />')) +

		((curMain==2 && curSub==1) ?
		('<img name="nav_21" src="nav/images/lang_cur.gif" border="0">') :
		('<a href="language.asp" ' +
		'onMouseOver="setImgSrc(\'nav_21\', \'nav/images/lang_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_21\', \'nav/images/lang_off.gif\')" ' +
		'><img name="nav_21" src="nav/images/lang_off.gif" border="0"></a><br />')) +
		'';

		layers[2].top			= layers[1].height + layers[1].top + 15;
		layers[2].height		*= 2;

	layers[3].content = '';
		layers[3].top			= layers[2].height + layers[2].top + 15;
		layers[3].height		= 0;

	layers[4].content = '';
		layers[4].top			= layers[3].height + layers[3].top + 15;
		layers[4].height		= 0;

	layers[5].content = '' +
		((curMain==5 && curSub==0) ?
		('<img name="nav_50" src="nav/images/state_cur.gif" border="0">') :
		('<a href="state.asp" ' +
		'onMouseOver="setImgSrc(\'nav_50\', \'nav/images/state_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_50\', \'nav/images/state_off.gif\')" ' +
		'><img name="nav_50" src="nav/images/state_off.gif" border="0"></a><br />')) +

		((curMain==5 && curSub==1) ?
		('<img name="nav_51" src="nav/images/lux_cur.gif" border="0">') :
		('<a href="lux.asp" ' +
		'onMouseOver="setImgSrc(\'nav_51\', \'nav/images/lux_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_51\', \'nav/images/lux_off.gif\')" ' +
		'><img name="nav_51" src="nav/images/lux_off.gif" border="0"></a><br />')) +

		((curMain==5 && curSub==2) ?
		('<img name="nav_52" src="nav/images/buyers_tips_cur.gif" border="0">') :
		('<a href="buyers.asp" ' +
		'onMouseOver="setImgSrc(\'nav_52\', \'nav/images/buyers_tips_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_52\', \'nav/images/buyers_tips_off.gif\')" ' +
		'><img name="nav_52" src="nav/images/buyers_tips_off.gif" border="0"></a><br />')) +
		'';

		layers[5].top			= layers[4].height + layers[4].top + 15;
		layers[5].height		*= 3;

	layers[6].content = '';

		layers[6].top			= layers[5].height + layers[5].top + 15;
		layers[6].height		= 0;

	layers[7].content = '';

		layers[7].top			= layers[6].height + layers[6].top + 15;
		layers[7].height		= 0;



	for (i=0; i<layers.length; i++)
		createLayer(layers[i].name,
				layers[i].left,
				layers[i].top,
				layers[i].width,
				layers[i].height,
				layers[i].visible, 30 + i,
				layers[i].content);





	//images to preload, just add them to the images array.
	var images = new Array();
	images[0] = 'nav/images/forsale_on.gif';
	images[1] = 'nav/images/forrent_on.gif'
	images[2] = 'nav/images/france_on.gif'
	images[3] = 'nav/images/excl_on.gif'
	images[4] = 'nav/images/state_on.gif';
	images[5] = 'nav/images/lux_on.gif'
	images[6] = 'nav/images/agent_on.gif'
	images[7] = 'nav/images/lang_on.gif'

	var preloadedimages = new Array();
	for (i=0; i<images.length; i++){
		preloadedimages[i] = new Image();
		preloadedimages[i].src = images[i];
	}

	return layers;
}



function MainSubNav(x, y, curMain, curSub){
	var layers = new Array();
	var und;

	if (curMain==und || curMain==null) curMain = -1;
	if (curSub==und || curSub==null) curSub = -1;

	for(i=0; i < 8; i++) {
		layers[i] = new layerStruct("sl" + i);
		layers[i].height	= 18;
		layers[i].width		= 148;
		layers[i].left		= 127 + x;
		layers[i].top		= y + (i * 18);
		layers[i].visible	= false;
	}

// 27 Sep 2003 - added "recent property" link

	layers[0].content = '' +
		((curMain==0 && curSub==0) ?
		('<a href="map.asp?mode=sale"><img name="nav_00" src="nav/images/forsale_cur.gif" border="0"></a><br />') :
		('<a href="map.asp?mode=sale" ' +
		'onMouseOver="setImgSrc(\'nav_00\', \'nav/images/home_forsale_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_00\', \'nav/images/home_forsale_off.gif\')" ' +
		'><img name="nav_00" src="nav/images/home_forsale_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==1) ?
		('<a href="map.asp?mode=rental"><img name="nav_01" src="nav/images/forrent_cur.gif" border="0"></a><br />') :
		('<a href="map.asp?mode=rental" ' +
		'onMouseOver="setImgSrc(\'nav_01\', \'nav/images/home_forrent_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_01\', \'nav/images/home_forrent_off.gif\')" ' +
		'><img name="nav_01" src="nav/images/home_forrent_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==2) ?
		('<img name="nav_02" src="nav/images/international_cur.gif" border="0">') :
		('<a href="affiliations.asp" ' +
		'onMouseOver="setImgSrc(\'nav_02\', \'nav/images/home_international_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_02\', \'nav/images/home_international_off.gif\')" ' +
		'><img name="nav_02" src="nav/images/home_international_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==3) ?
		('<img name="nav_03" src="nav/images/excl_cur.gif" border="0">') :
		('<a href="search.asp?btype=exclusive" ' +
		'onMouseOver="setImgSrc(\'nav_03\', \'nav/images/home_excl_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_03\', \'nav/images/home_excl_off.gif\')" ' +
		'><img name="nav_03" src="nav/images/home_excl_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==4) ?
		('<img name="nav_04" src="nav/images/my_cur.gif" border="0">') :
		('<a href="perfect.asp" ' +
		'onMouseOver="setImgSrc(\'nav_04\', \'nav/images/home_my_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_04\', \'nav/images/home_my_off.gif\')" ' +
		'><img name="nav_04" src="nav/images/home_my_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==5) ?
		('<img name="nav_05" src="nav/images/recent_cur.gif" border="0">') :
		('<a href="search.asp?btype=recent" ' +
		'onMouseOver="setImgSrc(\'nav_05\', \'nav/images/home_recent_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_05\', \'nav/images/home_recent_off.gif\')" ' +
		'><img name="nav_05" src="nav/images/home_recent_off.gif" border="0"></a><br />')) +

		((curMain==0 && curSub==6) ?
		('<img name="nav_06" src="nav/images/QoftheW_int_selected.gif" border="0">') :
		('<a href="quote.asp" ' +
		'onMouseOver="setImgSrc(\'nav_06\', \'nav/images/QoftheW_home_over.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_06\', \'nav/images/QoftheW_home_off.gif\')" ' +
		'><img name="nav_06" src="nav/images/QoftheW_home_off.gif" border="0"></a><br />')) +
		'';

		layers[0].top			= y + 15;
		layers[0].height		*= 7;


	layers[1].content = '';
		layers[1].top			= layers[0].height + layers[0].top + 15;
		layers[1].height		= 0;

	layers[2].content = '';
		layers[2].top			= layers[1].height + layers[1].top + 15;
		layers[2].height		= 0;

	layers[3].content = '';
		layers[3].top			= layers[2].height + layers[2].top + 15;
		layers[3].height		= 0;

	layers[4].content = '';

		layers[4].top			= layers[3].height + layers[3].top + 15;
		layers[4].height		= 0;

	layers[5].content = '' +
		((curMain==5 && curSub==0) ?
		('<img name="nav_50" src="nav/images/state_cur.gif" border="0">') :
		('<a href="state.asp" ' +
		'onMouseOver="setImgSrc(\'nav_50\', \'nav/images/home_state_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_50\', \'nav/images/home_state_off.gif\')" ' +
		'><img name="nav_50" src="nav/images/home_state_off.gif" border="0"></a><br />')) +

		((curMain==5 && curSub==1) ?
		('<img name="nav_51" src="nav/images/lux_cur.gif" border="0">') :
		('<a href="lux.asp" ' +
		'onMouseOver="setImgSrc(\'nav_51\', \'nav/images/home_lux_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_51\', \'nav/images/home_lux_off.gif\')" ' +
		'><img name="nav_51" src="nav/images/home_lux_off.gif" border="0"></a><br />')) +

		((curMain==5 && curSub==2) ?
		('<img name="nav_52" src="nav/images/home_buyers_tips_on.gif" border="0">') :
		('<a href="buyers.asp" ' +
		'onMouseOver="setImgSrc(\'nav_52\', \'nav/images/home_buyers_tips_on.gif\')" ' +
		'onMouseOut="setImgSrc(\'nav_52\', \'nav/images/home_buyers_tips_off.gif\')" ' +
		'><img name="nav_52" src="nav/images/home_buyers_tips_off.gif" border="0"></a><br />')) +
		'';

		layers[5].top			= layers[4].height + layers[4].top + 15;
		layers[5].height		*= 3;

	layers[6].content = '';

		layers[6].top			= layers[5].height + layers[5].top + 15;
		layers[6].height		= 0;

	layers[7].content = '';

		layers[7].top			= layers[6].height + layers[6].top + 15;
		layers[7].height		= 0;

	for (i=0; i<layers.length; i++)
		createLayer(layers[i].name,
				layers[i].left,
				layers[i].top,
				layers[i].width,
				layers[i].height,
				layers[i].visible, 30 + i,
				layers[i].content);


	//images to preload, just add them to the images array.
	var images = new Array();
	images[0] = 'nav/images/forsale_on.gif';
	images[1] = 'nav/images/forrent_on.gif'
	images[2] = 'nav/images/france_on.gif'
	images[3] = 'nav/images/excl_on.gif'
	images[4] = 'nav/images/state_on.gif';
	images[5] = 'nav/images/lux_on.gif'
	images[6] = 'nav/images/agent_on.gif'
	images[7] = 'nav/images/lang_on.gif'

	var preloadedimages = new Array();
	for (i=0; i<images.length; i++){
		preloadedimages[i] = new Image();
		preloadedimages[i].src = images[i];
	}

	return layers;
}


function layerStruct(name) {
	this.name		= name;
	this.height		= null;
	this.width		= null;
	this.left		= null;
	this.top		= null;
	this.content	= null;
	this.visible	= true;
}



/// ******************************************************************************************** ///
/// **************************************** \include\common.js **************************************** ///
/// ******************************************************************************************** ///


<!--
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_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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 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 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_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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//begin search page
var popupVisible;
function show_info_popup(thisObj,menu_id,vertical_offset) {
	
	if (popupVisible == false) {
		menuObj = document.getElementById(menu_id);
		position = getAnchorPosition(thisObj.id);
		moveObject(menu_id,position.x+16,position.y - vertical_offset);
		changeObjectVisibility(menu_id,'visible');
		popupVisible = true;
	}
}

function hide_info_popup(thisObj,menu_id) {
	menuObj = document.getElementById(menu_id);
	// moveObject(menu_id,1,1);
	changeObjectVisibility(menu_id,'hidden');
	popupVisible = false;
}

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	styleObject.zindex = '5';
	return true;
    } else {
    	return false;
    }
}

function getStyleObject(objectId) {
     if(document.getElementById(objectId)){
	   return (document.getElementById(objectId).style);
     } else {
	   return false;
     }
}

function moveObject(objectId, newXCoordinate, newYCoordinate) {
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
    }
}

function getAnchorPosition(anchor_id) {// This function will return an Object with x and y properties
	var position=new Object();
	// Logic to find position
	position.x=AnchorPosition_getPageOffsetLeft(document.getElementById(anchor_id));
	position.y=AnchorPosition_getPageOffsetTop(document.getElementById(anchor_id));
	return position;
}

function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while((el=el.offsetParent) != null) {
	  ol += el.offsetLeft;
	}
	return ol;
}

function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while( (el=el.offsetParent) != null) {
	  ot += el.offsetTop;
	}
	return ot;
}
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	window.name = "main";
	win = window.open(mypage,myname,settings);
	NewWindow.Focus;
}

//end search page

// begin: vcal hints
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 iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body }

function clearbrowseredge(obj, whichedge){
var ie=document.all
var horizontal_offset="9px" //horizontal offset of hint box from anchor link
var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset) }else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
} return edgeoffset }

function showhint(menucontents, obj, e, tipwidth){
var ie=document.all;
var ns6=document.getElementById&&!document.all;

if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth }
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip } }

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px" }

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock) }

// end : vcal hints

// email obfuscation
function generate_address( username ) {
  var domain = "stribling.com";
  var atsign = "&#64;";
  var addr = username + atsign + domain;
  document.write(
    "<" + "a" + " " + "href=" + "mail" + "to:" + addr + ">" +
    addr +
    "<\/a>");
}












//-->


/// ******************************************************************************************** ///
/// **************************************** \include\cbdhtml.js **************************************** ///
/// ******************************************************************************************** ///






// $Header: /MediaModeler v1.1/include/cbdhtml_tmm.js 2     8/21/01 12:52p Gabriel $
/********************************************************************
* cbdhtml.js                                                        *
*                                                                   *
* Copyright 1998, 1999 by Mike Hall.                                *
* Web:   http://members.aol.com/MHall75819                          *
* Email: MHall75819@aol.com                                         *
*                                                                   *
* Last updated January 24, 1999.                                    *
*                                                                   *
* These functions allow dynamic HTML effects to be added to any     *
* web page and will work on both Netscape Communicator 4.0+ and MS  *
* Internet Explorer 4.0+ browsers.                                  *
*                                                                   *
********************************************************************/
// Modified by Zetools to include support for Netscape 7
var layerList = new Array();

function createLayer(name, left, top, width, height, visible, zindex, content) {

  var z = layerList.length;
  var layer;

  layerList[z] = name;

  if (document.layers) {
    document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height +  ' visibility=' + (visible ? '"show"' : '"hide"') + ' z-index=' + zindex + '>');
    document.writeln(content);
    document.writeln('</layer>');
    layer = getLayer(name);
    layer.width = width;
    layer.height = height;
  }

  if (document.all) {
    var mylayer = '<div id="' + name + '" style="position:absolute; overflow:hidden; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + ' z-index:' + zindex + '">';
    mylayer = mylayer + (content) + '</div>';
    document.writeln(mylayer);

  }
else if (document.getElementById) {
	  var mylayer = '<div id="' + name + '" style="position:absolute; overflow:visible; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + ' z-index:' + zindex + '">';
    mylayer = mylayer + (content) + '</div>';
    parent.document.writeln(mylayer);

}
  clipLayer(name, 0, 0, width, height);
}

function hideLayer(name) {

  var layer = getLayer(name);

  if (document.layers)
    layer.visibility = "hide";
  if (document.all)
    layer.visibility = "hidden";
  else if (document.getElementById) {
  	layer.style.visibility = "hidden";
  }
}

function showLayer(name) {

  var layer = getLayer(name);

  if (document.layers)
    layer.visibility = "show";
  if (document.all)
    layer.visibility = "visible";
  else if (document.getElementById)
  	layer.style.visibility = "visible";
}

function isVisible(name) {

  var layer = getLayer(name);

  if (document.layers && layer.visibility == "show")
    return(true);
  if ((document.all) && layer.visibility == "visible")
    return(true);
   else if ((document.getElementById) && layer.style.visibility == "visible");
  	return (true);
  return(false);
}

function moveLayer(name, x, y) {

  var layer = getLayer(name);

  if (document.layers)
    layer.moveTo(x, y);
  if (document.all) {
    layer.left = x;
    layer.top  = y;
  }
   else if (document.getElementById) {
  	layer.style.left = x;
    layer.style.top  = y;
  }
}

var animRate = 25;    // Basically sets the update rate for animations.

function slideLayer(name, x, y, speed, code) {

  var layer = getLayer(name);

  // If the layer is currently being moved, cancel it.

  if (layer.slideID && layer.slideID != null)
    clearTimeout(layer.slideID);

  // Fix up all parameters.

  if (!code)
    code = "";

  // If any parameter other than 'name' is not an Array, make it one.

  x     = makeArray(x);
  y     = makeArray(y);
  speed = makeArray(speed);
  code  = makeArray(code);

  // Pad all arrays to the same length.

  var max = Math.max(x.length, Math.max(y.length, Math.max(speed.length, code.length)));
  while (x.length < max)
    x[x.length] = x[x.length - 1];
  while (y.length < max)
    y[y.length] = y[y.length - 1];
  while (speed.length < max)
    speed[speed.length] = speed[speed.length - 1];
  while (code.length < max)
    code[code.length] = code[code.length - 1];

  // Call the slide function with array parameters.

  doSlide(name, x, y, speed, code);
}

function doSlide(name, x, y, speed, code) {

  var layer = getLayer(name);
  var hrzn, vert, left, top, steps;

  if (document.layers) {
    hrzn = x[0] - layer.left;
    vert = y[0] - layer.top;
    left = layer.left;
    top  = layer.top;
  }

  if ((document.all) || (document.getElementById)) {
    hrzn = x[0] - layer.pixelLeft;
    vert = y[0] - layer.pixelTop;
    left = layer.pixelLeft;
    top  = layer.pixelTop;
  }

  // Calculate how many steps it will take and the size of each step.

  steps = (Math.max(Math.abs(hrzn), Math.abs(vert)) / speed[0]) * (1000 / animRate);

  if (steps <= 0)
    return;

  // Save remaining array values.

  layer.slideX     = x.slice(1, x.length);
  layer.slideY     = y.slice(1, y.length);
  layer.slideSpeed = speed.slice(1, speed.length);
  layer.slideCode  = code.slice(1, code.length);

  // Set up movement values.

  layer.slideLeft   = left;
  layer.slideTop    = top;
  layer.slideDx     = hrzn / steps;
  layer.slideDy     = vert / steps;
  layer.slideFinalX = x[0];
  layer.slideFinalY = y[0];
  layer.slideSteps  = Math.floor(steps);
  layer.slideAction = code[0];

  // Start the slide.

  slideStep(name);
}

function slideStep(name) {

  // Moves the layer one step.

  var layer = getLayer(name);

  layer.slideLeft += layer.slideDx;
  layer.slideTop  += layer.slideDy;
  if (document.layers)
    layer.moveTo(layer.slideLeft, layer.slideTop);
  if ((document.all) || (document.getElementById)) {
    layer.left = layer.slideLeft;
    layer.top  = layer.slideTop;
  }

  // If more steps remain, call this function again.

  if (layer.slideSteps-- > 0)
    layer.slideID = setTimeout('slideStep("' + name + '")', animRate);

  // Otherwise, move layer to final position, execute any code and look for more slide parameters.

  else {
   if (document.layers)
      layer.moveTo(layer.slideFinalX, layer.slideFinalY);
    if ((document.all) || (document.getElementById)) {
      layer.left = layer.slideFinalX;
      layer.top  = layer.slideFinalY;
    }

    // Execute code, if any.

    layer.slideID = null;
    if (layer.slideAction != "")
      eval(layer.slideAction);

    // If any more slide parameters are left, start a new slide.

    if (layer.slideX.length > 0)
      doSlide(name, layer.slideX, layer.slideY, layer.slideSpeed, layer.slideCode);
    else
      layer.slideID = null;
  }
}

function clipLayer(name, clipleft, cliptop, clipright, clipbottom) {

  var layer = getLayer(name);
  if (document.layers) {
    layer.clip.left   = clipleft;
    layer.clip.top    = cliptop;
    layer.clip.right  = clipright;
    layer.clip.bottom = clipbottom;
  }
  if ((document.all) || (document.getElementById)) {

    layer.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
   }

}

function swipeLayer(name, clipleft, cliptop, clipright, clipbottom, speed, code) {

  var layer = getLayer(name);

  // If the layer is currently being clipped, cancel it.

  if (layer.swipeID && layer.swipeID != null)
    clearTimeout(layer.swipeID);

  // Fix up all parameters.

  if (!code)
    code = "";

  // If any parameter other than 'name' is not an Array, make it one.

  clipleft   = makeArray(clipleft);
  cliptop    = makeArray(cliptop);
  clipright  = makeArray(clipright);
  clipbottom = makeArray(clipbottom);
  speed      = makeArray(speed);
  code       = makeArray(code);

  // Pad all arrays to the same length.

  var max = Math.max(clipleft.length, Math.max(clipright.length, Math.max(cliptop.length, Math.max(clipbottom.length, Math.max(speed.length, code.length)))));
  while (clipleft.length < max)
    clipleft[clipleft.length] = clipleft[clipleft.length - 1];
  while (clipright.length < max)
    clipright[clipright.length] = clipright[clipright.length - 1];
  while (cliptop.length < max)
    cliptop[cliptop.length] = cliptop[cliptop.length - 1];
  while (clipbottom.length < max)
    clipbottom[clipbottom.length] = clipbottom[clipbottom.length - 1];
  while (speed.length < max)
    speed[speed.length] = speed[speed.length - 1];
  while (code.length < max)
    code[code.length] = code[code.length - 1];

  // Call the swipe function with array parameters.

  doSwipe(name, clipleft, cliptop, clipright, clipbottom, speed, code)
}

function doSwipe(name, clipleft, cliptop, clipright, clipbottom, speed, code) {

  var layer = getLayer(name);

  var hrzn1, vert1;
  var hrzn2, vert2;
  var max1, max2;
  var steps;

  if (document.layers) {
    hrzn1 = clipleft[0] - layer.clip.left;
    vert1 = cliptop[0] - layer.clip.top;
    hrzn2 = clipright[0] - layer.clip.right;
    vert2 = clipbottom[0] - layer.clip.bottom;
  }
  if ((document.all) || (document.getElementById)) {
    if (!layer.clip)
      clipLayer(name, 0, 0, layer.pixelWidth, layer.pixelHeight);
    var clip = getClipValues(layer.clip);
    hrzn1 = clipleft[0] - clip[3];
    vert1 = cliptop[0] - clip[0];
    hrzn2 = clipright[0] - clip[1];
    vert2 = clipbottom[0] - clip[2];
  }
  max1 = Math.max(Math.abs(hrzn1), Math.abs(vert1));
  max2 = Math.max(Math.abs(hrzn2), Math.abs(vert2));
  steps = (Math.max(max1, max2) / speed[0]) * (1000 / animRate);

  if (steps <= 0)
    return;

  // Save remaining array values.

  layer.swipeClipleft   = clipleft.slice(1, clipleft.length);
  layer.swipeCliptop    = cliptop.slice(1, cliptop.length);
  layer.swipeClipright  = clipright.slice(1, clipright.length);
  layer.swipeClipbottom = clipbottom.slice(1, clipbottom.length);
  layer.swipeSpeed      = speed.slice(1, speed.length);
  layer.swipeCode       = code.slice(1, code.length);

  // Set up clipping values.

  if (document.layers) {
    layer.swipeLeft   = layer.clip.left;
    layer.swipeTop    = layer.clip.top;
    layer.swipeRight  = layer.clip.right;
    layer.swipeBottom = layer.clip.bottom;
  }
  if ((document.all) || (document.getElementById)) {
    layer.swipeLeft   = parseInt(clip[3], 10);
    layer.swipeTop    = parseInt(clip[0], 10);
    layer.swipeRight  = parseInt(clip[1], 10);
    layer.swipeBottom = parseInt(clip[2], 10);
  }
  layer.swipeDx1         = hrzn1 / steps;
  layer.swipeDy1         = vert1 / steps;
  layer.swipeDx2         = hrzn2 / steps;
  layer.swipeDy2         = vert2 / steps;
  layer.swipeFinalLeft   = clipleft[0];
  layer.swipeFinalTop    = cliptop[0];
  layer.swipeFinalRight  = clipright[0];
  layer.swipeFinalBottom = clipbottom[0];
  layer.swipeSteps       = Math.floor(steps);
  layer.swipeAction      = code[0];

  // Start the swipe.

  swipeStep(name);
}

function swipeStep(name) {

  var layer = getLayer(name);

  // Adjust the layer's clipping area by one step.

  layer.swipeLeft   += layer.swipeDx1;
  layer.swipeTop    += layer.swipeDy1;
  layer.swipeRight  += layer.swipeDx2;
  layer.swipeBottom += layer.swipeDy2;

  if (document.layers) {
    layer.clip.left   = layer.swipeLeft;
    layer.clip.top    = layer.swipeTop;
    layer.clip.right  = layer.swipeRight;
    layer.clip.bottom = layer.swipeBottom;
  }
  if ((document.all) || (document.getElementById))
    layer.clip = 'rect(' + layer.swipeTop + ' ' + layer.swipeRight + ' ' + layer.swipeBottom + ' ' + layer.swipeLeft +')';

  // If more steps remain, call this function again.

  if (--layer.swipeSteps > 0)
    layer.swipeID = setTimeout('swipeStep("' + name + '")', animRate);

  // Otherwise, set layer's final clip area, execute any code and look for more swipe parameters.

  else {
    if (document.layers) {
      layer.clip.left   = Math.round(layer.swipeFinalLeft);
      layer.clip.top    = Math.round(layer.swipeFinalTop);
      layer.clip.right  = Math.round(layer.swipeFinalRight);
      layer.clip.bottom = Math.round(layer.swipeFinalBottom);
    }
    if ((document.all) || (document.getElementById))
      layer.clip = 'rect(' + layer.swipeFinalTop + ' ' + layer.swipeFinalRight + ' ' + layer.swipeFinalBottom + ' ' + layer.swipeFinalLeft +')';

    // Execute code, if any.

    if (layer.swipeAction != "")
      eval(layer.swipeAction);

    // If any more swipe parameters are left, start a new swipe.

    if (layer.swipeClipleft.length > 0)
      doSwipe(name, layer.swipeClipleft, layer.swipeCliptop, layer.swipeClipright, layer.swipeClipbottom, layer.swipeSpeed, layer.swipeCode);
    else
      layer.swipeID = null;
  }
}

function scrollLayer(name, dx, dy) {

  var cl = getClipLeft(name);
  var ct = getClipTop(name);
  var cr = getClipRight(name);
  var cb = getClipBottom(name);
  var l  = getLeft(name);
  var t  = getTop(name);

  // If scrolling the given amounts would move past the edges of the layer,
  // adjust the values so we stop right at the edge.

  if (cl + dx < 0)
    dx = -cl;
  else if (cr + dx > getWidth(name))
    dx = getWidth(name) - cr;
  if (ct + dy < 0)
    dy = -ct;
  else if (cb + dy > getHeight(name))
    dy = getHeight(name) - cb;

  // Move both the clipping region and the layer so that the contents move
  // but the viewable region of the layer appears fixed relative to the page.

  clipLayer(name, cl + dx, ct + dy, cr + dx, cb + dy);
  moveLayer(name, l - dx, t - dy);
}

function orbitLayer(name, x, y, a, b, start, num, rpm, rotation, code) {

  var layer = getLayer(name);
  var end, steps, delta;
  var x1, y1, x2, y2;

  // If the layer is currently in an orbit, cancel it.

  if (layer.orbitID && layer.orbitID != null)
    clearTimeout(layer.orbitID);

  // Convert starting angle to radians and find ending angle.

  start %= 360;
  start *= Math.PI / 180;
  end = start + num * 2 * Math.PI;

  // Convert rotation angle to radians.

  rotation %= 360;
  rotation *= Math.PI / 180;

  // Calculate how many steps it will take and the change in angle for each step.

  steps = 60000 * Math.abs(num) / (rpm * animRate);
  delta = (end - start) / steps;

  if (steps <= 0)
    return;

  // Set up movement values.

  layer.orbitX        = x;
  layer.orbitY        = y;
  layer.orbitA        = a;
  layer.orbitB        = b;
  layer.orbitAngle    = start;
  layer.orbitRotation = rotation;
  layer.orbitFinal    = end;
  layer.orbitDelta    = delta;
  layer.orbitSteps    = Math.floor(steps);
  layer.orbitAction   = code;

  // Move layer to starting position.

  x1 = a * Math.sin(start);
  y1 = b * Math.cos(start);
  x2 = x + Math.round(x1 * Math.cos(rotation) + y1 * Math.sin(rotation));
  y2 = y - Math.round(y1 * Math.cos(rotation) - x1 * Math.sin(rotation));
  moveLayer(name, x2, y2);

  // Start the orbit.

  orbitStep(name);
}

function orbitStep(name) {

  // Moves the layer one step.

  var layer = getLayer(name);
  var x1, y1, x2, y2;

  layer.orbitAngle += layer.orbitDelta;
  if (layer.orbitAngle > 2 * Math.PI)
    layer.orbitAngle -= 2 * Math.PI;
  else if (layer.orbitAngle < 0)
    layer.orbitAngle += 2 * Math.PI;
  x1 = layer.orbitA * Math.sin(layer.orbitAngle);
  y1 = layer.orbitB * Math.cos(layer.orbitAngle);
  x2 = layer.orbitX + Math.round(x1 * Math.cos(layer.orbitRotation) + y1 * Math.sin(layer.orbitRotation));
  y2 = layer.orbitY - Math.round(y1 * Math.cos(layer.orbitRotation) - x1 * Math.sin(layer.orbitRotation));
  if (document.layers)
    layer.moveTo(x2, y2);
  if ((document.all) || (document.getElementById)) {
    layer.left = x2;
    layer.top  = y2;
  }

  // If more steps remain, call this function again.

  if (layer.orbitSteps-- > 0)
    layer.orbitID = setTimeout('orbitStep("' + name + '")', animRate);

  // Otherwise, move layer to final position and execute any code.

  else {
    x1 = layer.orbitA * Math.sin(layer.orbitFinal);
    y1 = layer.orbitB * Math.cos(layer.orbitFinal);
    x2 = layer.orbitX + Math.round(x1 * Math.cos(layer.orbitRotation) + y1 * Math.sin(layer.orbitRotation));
    y2 = layer.orbitY - Math.round(y1 * Math.cos(layer.orbitRotation) - x1 * Math.sin(layer.orbitRotation));
    if (document.layers)
      layer.moveTo(x2, y2);
    if ((document.all) || (document.getElementById)) {
      layer.left = x2;
      layer.top  = y2;
    }

    // Execute code, if any.

    layer.orbitID = null;
    if (layer.orbitAction != "")
      eval(layer.orbitAction);

    // Clear the orbit ID.

    layer.orbitID = null;
  }
}

function orbitStartX(x, y, a, b, start, rotation) {

  var x1, y1, x2, y2;

  // Find the starting x-coordinate for the given orbit parameters.

  start %= 360;
  start *= Math.PI / 180;
  rotation %= 360;
  rotation *= Math.PI / 180;
  x1 = a * Math.sin(start);
  y1 = b * Math.cos(start);
  x2 = x + Math.round(x1 * Math.cos(rotation) + y1 * Math.sin(rotation));
  y2 = y - Math.round(y1 * Math.cos(rotation) - x1 * Math.sin(rotation));
  return Math.round(x2);
}

function orbitStartY(x, y, a, b, start, rotation) {

  var x1, y1, x2, y2;

  // Find the starting y-coordinate for the given orbit parameters.

  start %= 360;
  start *= Math.PI / 180;
  rotation %= 360;
  rotation *= Math.PI / 180;
  x1 = a * Math.sin(start);
  y1 = b * Math.cos(start);
  x2 = x + Math.round(x1 * Math.cos(rotation) + y1 * Math.sin(rotation));
  y2 = y - Math.round(y1 * Math.cos(rotation) - x1 * Math.sin(rotation));
  return y2;
}

function setBgColor(name, color) {

  var layer = getLayer(name);

  if (document.layers)
    layer.bgColor = color;
  else if (document.all)
    layer.backgroundColor = color;
}

function setBgImage(name, imagesrc) {

  var layer = getLayer(name);

  if (document.layers)
    layer.background.src = imagesrc;
  else if ((document.all) || (document.getElementById))
    layer.backgroundImage = "url(" + imagesrc + ")";
}

function replaceContent(name, content) {

  if (document.layers) {
    var layer = getLayer(name);
    layer.document.open();
    layer.document.writeln(content);
    layer.document.close();
  }
  else if (document.all) {
    var str = "document.all." + name + ".innerHTML = '" + content + "'";
    eval(str);
  }
  else if (document.getElementById) {
  	document.getElementById(name).innerHTML = content;
  }
}

function getLeft(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.left);
  else if (document.all)
    return(layer.pixelLeft);
  else if (document.getElementById)
  	return(parseInt(layer.style.left));
  else
    return(null);
}

function getTop(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.top);
  else if (document.all)
    return(layer.pixelTop);
  else if (document.getElementById)
  	return(parseInt(layer.style.top));
  else
    return(null);
}

function getRight(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.left + layer.width);
  else if (document.all)
    return(layer.pixelLeft + layer.pixelWidth);
   else if (document.getElementById)
  	return(parseInt(layer.style.left) + parseInt(layer.style.width));
  else
    return(null);
}

function getBottom(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.top + layer.height);
  else if (document.all)
    return(layer.pixelTop + layer.pixelHeight);
  else if (document.getElementById)
  	return(parseInt(layer.style.top) + parseInt(layer.style.height));
  else
    return(null);
}

function getWidth(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.width);
  else if (document.all)
    return(layer.pixelWidth);
  else if (document.getElementById)
  	return(parseInt(layer.style.width));
  else
    return(null)
}

function getHeight(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.height);
  else if (document.all)
    return(layer.pixelHeight);
  else if (document.getElementById)
  	return(parseInt(layer.style.height));

  else
    return(null);
}

function setWidth(name, value) {

  var layer = getLayer(name);

  if (document.layers)
    layer.width = value;
  else if ((document.all) || (document.getElementById))
    layer.pixelWidth = value;
  else
    return(null)
}

function setHeight(name, value) {

  var layer = getLayer(name);

  if (document.layers)
    layer.height = value;
  else if ((document.all) || (document.getElementById))
    layer.pixelHeight = value;
  else
    return(null);
}

function getClipLeft(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.left);
  else if (document.all) {
    var str =  layer.clip;
    if (!str)
      return(0);
    var clip = getClipValues(layer.clip);
    return(clip[3]);
  }
  else
    return(null);
}

function getClipTop(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.top);
  else if ((document.all) || (document.getElementById)) {
    var str =  layer.clip;
    if (!str)
      return(0);
    var clip = getClipValues(layer.clip);
    return(clip[0]);
  }
  else
    return(null);
}

function getClipRight(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.right);
  else if ((document.all) || (document.getElementById)) {
    var str =  layer.clip;
    if (!str)
      return(layer.pixelWidth);
    var clip = getClipValues(layer.clip);
    return(clip[1]);
  }
  else
    return(null);
}

function getClipBottom(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.bottom);
  else if ((document.all) || (document.getElementById)) {
    var str =  layer.clip;
    if (!str)
      return(layer.pixelHeight);
    var clip = getClipValues(layer.clip);
    return(clip[2]);
  }
  else
    return(null);
}

function getClipWidth(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.width);
  else if ((document.all) || (document.getElementById)) {
    var str =  layer.clip;
    if (!str)
      return(layer.pixelWidth);
    var clip = getClipValues(layer.clip);
    return(clip[1] - clip[3]);
  }
  else
    return(null);
}

function getClipHeight(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.clip.height);
  else if ((document.all) || (document.getElementById)) {
    var str =  layer.clip;
    if (!str)
      return(layer.pixelHeight);
    var clip = getClipValues(layer.clip);
    return(clip[2] - clip[0]);
  }
  else
    return(null);
}

function getWinWidth() {

  if (document.layers)
    return(window.innerWidth);
  else if ((document.all) || (document.getElementById))
    return(document.body.clientWidth);
  else
    return(null);
}

function getWinHeight() {

  if (document.layers)
    return(window.innerHeight);
  else if ((document.all) || (document.getElementById))
    return(document.body.clientHeight);
  else
    return(null);
}

function getzIndex(name) {

  var layer = getLayer(name);

  if (document.layers)
    return(layer.zIndex);
  else if ((document.all) || (document.getElementById))
    return(layer.zIndex);
  else
    return(null);
}

function setzIndex(name, z) {

  var layer = getLayer(name);

  if (document.layers)
    layer.zIndex = z;
  if ((document.all) || (document.getElementById))
    layer.zIndex = z;
}

function bringToFront(name) {

  var i, temp;

  layerList.sort(sortzIndex);

  i = layerList.length - 1;
  temp = getzIndex(layerList[i]);
  while (i > 0 && layerList[i] != name) {
    setzIndex(layerList[i], getzIndex(layerList[i - 1]));
    i--;
  }
  setzIndex(name, temp);
}

function sendToBack(name) {

  var i, temp;

  layerList.sort(sortzIndex);
  i = 0;
  temp = getzIndex(layerList[i]);
  while (i < layerList.length - 2 && layerList[i] != name) {
    setzIndex(layerList[i], getzIndex(layerList[i + 1]));
    i++;
  }
  setzIndex(name, temp);
}

function sortzIndex(a, b) {

  return(getzIndex(a) - getzIndex(b));
}

function getImgSrc(imagename) {

  var i, layer;

  // If the image exists in the document object, return the source.

  if (document.images[imagename])
    return document.images[imagename].src;

  // Otherwise, for Netscape, search through the layers for the named image.

  else if (document.layers)
    for (i = 0; i < layerList.length; i++) {
      layer = getLayer(layerList[i]);
      if (layer.document.images[imagename])
        return layer.document.images[imagename].src;
    }

  return(null);
}

function setImgSrc(imagename, imagesrc) {

  var i, layer;

  // If the image exists in the document object, change the source.

  if (document.images[imagename]) {
    document.images[imagename].src = imagesrc;
    return;
  }

  // Otherwise, for Netscape, search through the layers for the named image.

  else if (document.layers) {
    var found = false;
    for (i = 0; i < layerList.length && !found; i++) {
      layer = getLayer(layerList[i]);
      if (layer.document.images[imagename]) {
        layer.document.images[imagename].src = imagesrc;
        found = true;
      }
    }
  }
}

function getClipValues(str) {

  var clip = new Array();
  var i;

  // Parse out the clipping values for IE layers.

  i = str.indexOf("(");
  clip[0] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[1] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[2] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[3] = parseInt(str.substring(i + 1, str.length), 10);
  return(clip);
}

function getLayer(name) {

  // Returns a handle to the named layer.

  if (document.layers)
    return(document.layers[name]);
  else if (document.all) {
    layer = eval('document.all.' + name + '.style');
    return(layer);
  }
  else if (document.getElementById) {
  	layer = document.getElementById(name);
  	return(layer);
  }
  else
    return(null);
}

function makeArray(a) {

  var temp;

  if (!a.join) {
    temp = a;
    a = new Array();
    a[0] = temp;
  }
  return a;
}
