/*****************************************************
* ypSlideOutMenu
* 3/04/2001
* --youngpup--
*****************************************************/

/* Helper Functions */

function getButtonHandler(menuName)
{
	iMenuNumber = menuName.charAt(menuName.length - 1);
	sButtonName = "button" + iMenuNumber;
	
	return sButtonName;
}

function changeButtonState(buttonID, state)
{
	if (document.getElementById) {
		oButton = document.getElementById(buttonID);

		sClassName = oButton.className;
		
		// keeps the selected menu items in "selected" state
		if (state == "on" && sClassName != "selected") {
		}

		// resets the menu item to "normal" state
		if (state == "off") {
			if (!oButton.className) {
			}
		}
	}
}

/* End Helper Functions */

ypSlideOutMenu.Registry = []
ypSlideOutMenu.aniLen = 0
ypSlideOutMenu.hideDelay = 0
ypSlideOutMenu.minCPUResolution = 10


// constructor
function ypSlideOutMenu(id, dir, width, height)
{
	this.ie = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0
	if (this.ie || this.ns4 || this.dom) {
		this.id = id
		this.dir = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType = dir == "right" || dir == "down" ? "-" : "+"
		this.dim = this.orientation == "h" ? width : height
		this.hideTimer = false
		this.aniTimer = false
		this.open = false
		this.over = false
		this.startTime = 0
		this.gRef = "ypSlideOutMenu_"+id
		eval(this.gRef+"=this")
		ypSlideOutMenu.Registry[id] = this
		var d = document
		var strCSS = '<style type="text/css">';
		strCSS += '#' + this.id + 'Container { visibility:hidden; '
		//strCSS += 'left:' + left + 'px; '
		//strCSS += 'top:' + top + 'px; '
		//strCSS += 'overflow:show; z-index:10000; }'
		
		//changed this to 'overflow:visible', overflow.show was causing javascript errors in firefox
		strCSS += 'overflow:visible; z-index:10000; }'
		strCSS += '#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; '
		strCSS += 'width:' + width + 'px; '
		strCSS += 'height:' + height + 'px; '
		//strCSS += 'clip:rect(0 ' + width + ' ' + height + ' 0); '
		strCSS += 'clip:rect(0px,' + width + 'px,' + height + 'px,0px); '

		strCSS += '}'
		strCSS += '</style>'
		//alert ("css=\n" +strCSS) 
		d.write(strCSS)
		this.load()
	}
}

ypSlideOutMenu.prototype.load = function() {
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp
	if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
	else {
		this.container = obj1
		this.menu = obj2
		this.style = this.ns4 ? this.menu : this.menu.style
		this.homePos = eval("0" + this.dirType + this.dim)
		this.outPos = 0
		this.accelConst = (this.outPos - this.homePos) / ypSlideOutMenu.aniLen / ypSlideOutMenu.aniLen 
		// set event handlers.
		if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
		this.menu.onmouseover = new Function("ypSlideOutMenu.showMenu('" + this.id + "')")
		this.menu.onmouseout = new Function("ypSlideOutMenu.hideMenu('" + this.id + "')")
		//set initial state
		this.endSlide()
	}
}

ypSlideOutMenu.showMenu = function(id)
{
	if (!document.layers) {
		var reg = ypSlideOutMenu.Registry
		var obj = ypSlideOutMenu.Registry[id]
		if (obj.container) {
			obj.over = true
			for (menu in reg) if (id != menu) ypSlideOutMenu.hide(menu)
			if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
			if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
		}
		sButtonName = getButtonHandler(id);
		changeButtonState(sButtonName,"on");
	}
}

ypSlideOutMenu.hideMenu = function(id)
{
	var obj = ypSlideOutMenu.Registry[id]
	if (obj.container) {
		if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
		obj.hideTimer = window.setTimeout("ypSlideOutMenu.hide('" + id + "');", ypSlideOutMenu.hideDelay);
	}
}

ypSlideOutMenu.hideAll = function()
{
	var reg = ypSlideOutMenu.Registry
	for (menu in reg) {
		ypSlideOutMenu.hide(menu);
		if (menu.hideTimer) window.clearTimeout(menu.hideTimer);
	}
}

ypSlideOutMenu.hide = function(id)
{
	var obj = ypSlideOutMenu.Registry[id]
	obj.over = false
	if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
	obj.hideTimer = 0
	if (obj.open && !obj.aniTimer) obj.startSlide(false)
	
	sButtonName = getButtonHandler(id);
	changeButtonState(sButtonName,"off");
}

ypSlideOutMenu.prototype.startSlide = function(open) {
	this[open ? "onactivate" : "ondeactivate"]()
	this.open = open
	if (open) this.setVisibility(true)
	this.startTime = (new Date()).getTime() 
	this.aniTimer = window.setInterval(this.gRef + ".slide()", ypSlideOutMenu.minCPUResolution)
}

ypSlideOutMenu.prototype.slide = function() {
	var elapsed = (new Date()).getTime() - this.startTime
	if (elapsed > ypSlideOutMenu.aniLen) this.endSlide()
	else {
		var d = Math.round(Math.pow(ypSlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
		if (this.open && this.dirType == "-") d = -d
		else if (this.open && this.dirType == "+") d = -d
		else if (!this.open && this.dirType == "-") d = -this.dim + d
		else d = this.dim + d
	}
}

ypSlideOutMenu.prototype.endSlide = function() {
	this.aniTimer = window.clearTimeout(this.aniTimer)
	if (!this.open) this.setVisibility(false)
	if ((this.open && !this.over) || (!this.open && this.over)) {
		this.startSlide(this.over)
	}
}

ypSlideOutMenu.prototype.setVisibility = function(bShow) { 
	var s = this.ns4 ? this.container : this.container.style
	s.visibility = bShow ? "visible" : "hidden"
}

ypSlideOutMenu.prototype.getPos = function(c) {
	return parseInt(this.style[c])
}

ypSlideOutMenu.prototype.onactivate = function() { }
ypSlideOutMenu.prototype.ondeactivate = function() { }

// menu object = function call (name, alignment, x position, y position, width, height
// needs to be one of these for every menu rollover option

//left nav rollouts
var level1_01 = new ypSlideOutMenu("menu1", "left", 180, 280)
var level1_02 = new ypSlideOutMenu("menu2", "left", 180, 200)
var level1_03 = new ypSlideOutMenu("menu3", "left", 180, 280)
var level1_04 = new ypSlideOutMenu("menu4", "left", 180, 280)
//added this - JWL 01.08.2007
var level1_05 = new ypSlideOutMenu("menu5", "left", 180, 280)


// secondary navigation elements: door images

function getDNButtonHandler(menuName)
{
	iMenuNumber = menuName.substr(menuName.length - 2, 2);
	sButtonName = "dn_button" + iMenuNumber;
	return sButtonName;
}

function changeButtonState(buttonID, state)
{
	if (document.getElementById) {
		oButton = document.getElementById(buttonID);
		
		//added this if/then in case there are less top menu items than this code sets up - jwl 05.23.2007
		if (oButton)
		{
			oDoorImageName = 'dn_img'+buttonID.substr(buttonID.length - 2, 2);
			sDoorImageNumber = buttonID.substr(buttonID.length - 2, 2);
			sClassName = oButton.className;
		
			// keeps the selected menu items in "selected" state
			// if (state == "on" && sClassName != "on") {
			// 	document.images[oDoorImageName].src = 'images/int_nav_'+sDoorImageNumber+'_on.jpg';
			// } else if (state == "on" && sClassName == "off") {
			// 	document.images[oDoorImageName].src = 'images/int_nav_'+sDoorImageNumber+'_off.jpg';
			// } else if (state == "off" && sClassName == "off") {
			// 	document.images[oDoorImageName].src = 'images/int_nav_'+sDoorImageNumber+'_off.jpg';
			// }
			// resets the menu item to "normal" state
			//if (state == "off") {
			//	if (!oButton.className) {
			//		document.images[oDoorImageName].src = 'images/int_nav_'+sDoorImageNumber+'_off.jpg';
			//	}
			//}
		}
	}
}

ypSlideOutMenu_level2.Registry = []
ypSlideOutMenu_level2.aniLen = 0
ypSlideOutMenu_level2.hideDelay = 0
ypSlideOutMenu_level2.minCPUResolution = 10

// constructor
function ypSlideOutMenu_level2(id, dir, width, height)
{
	this.ie = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0
	if (this.ie || this.ns4 || this.dom) {
		this.id = id
		this.dir = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType = dir == "right" || dir == "down" ? "-" : "+"
		this.dim = this.orientation == "h" ? width : height
		this.hideTimer = false
		this.aniTimer = false
		this.open = false
		this.over = false
		this.startTime = 0
		this.gRef = "ypSlideOutMenu_level2_"+id
		eval(this.gRef+"=this")
		ypSlideOutMenu_level2.Registry[id] = this
		var d = document
		var strCSS = '<style type="text/css">';
		strCSS += '#' + this.id + 'Container { visibility:hidden; '
		
		//changed this to 'overflow:visible', overflow.show was causing javascript errors in firefox
		//strCSS += 'overflow:show; z-index:10000; }'
		strCSS += 'overflow:visible; z-index:10000; }'
		
		strCSS += '#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; '
		strCSS += 'width:' + width + 'px; '
		strCSS += 'height:' + height + 'px; '
		//strCSS += 'clip:rect(0 ' + width + ' ' + height + ' 0); '
		strCSS += 'clip:rect(0px,' + width + 'px,' + height + 'px,0px); '
		strCSS += '}'
		strCSS += '</style>'
		d.write(strCSS)
		this.load()
	}
}

ypSlideOutMenu_level2.prototype.load = function() {
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp
	if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
	else {
		this.container = obj1
		this.menu = obj2
		this.style = this.ns4 ? this.menu : this.menu.style
		this.homePos = eval("0" + this.dirType + this.dim)
		this.outPos = 0
		this.accelConst = (this.outPos - this.homePos) / ypSlideOutMenu_level2.aniLen / ypSlideOutMenu_level2.aniLen 
		// set event handlers.
		if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
		this.menu.onmouseover = new Function("ypSlideOutMenu_level2.showMenu('" + this.id + "')")
		this.menu.onmouseout = new Function("ypSlideOutMenu_level2.hideMenu('" + this.id + "')")
		//set initial state
		this.endSlide()
	}
}

ypSlideOutMenu_level2.showMenu = function(id)
{
	if (!document.layers) {
		var reg = ypSlideOutMenu_level2.Registry
		var obj = ypSlideOutMenu_level2.Registry[id]
		if (obj.container) {
			obj.over = true
			for (menu in reg) if (id != menu) 	ypSlideOutMenu_level2.hide(menu)
			if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
			if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
		}
		sButtonName = getDNButtonHandler(id);
		changeButtonState(sButtonName,"on");
	}
}

ypSlideOutMenu_level2.hideMenu = function(id)
{
	var obj = ypSlideOutMenu_level2.Registry[id]
	if (obj.container) {
		if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
		obj.hideTimer = window.setTimeout("ypSlideOutMenu_level2.hide('" + id + "');", ypSlideOutMenu_level2.hideDelay);
	}
}

ypSlideOutMenu_level2.hideAll = function()
{
	var reg = ypSlideOutMenu_level2.Registry
	for (menu in reg) {
		ypSlideOutMenu_level2.hide(menu);
		if (menu.hideTimer) window.clearTimeout(menu.hideTimer);
	}
}

ypSlideOutMenu_level2.hide = function(id)
{
	var obj = ypSlideOutMenu_level2.Registry[id]
	obj.over = false
	if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
	obj.hideTimer = 0
	if (obj.open && !obj.aniTimer) obj.startSlide(false)
	sButtonName = getDNButtonHandler(id); 
	changeButtonState(sButtonName,"off");
}

ypSlideOutMenu_level2.prototype.startSlide = function(open) {
	this[open ? "onactivate" : "ondeactivate"]()
	this.open = open
	if (open) this.setVisibility(true)
	this.startTime = (new Date()).getTime() 
	this.aniTimer = window.setInterval(this.gRef + ".slide()", ypSlideOutMenu_level2.minCPUResolution)
}

ypSlideOutMenu_level2.prototype.slide = function() {
	var elapsed = (new Date()).getTime() - this.startTime
	if (elapsed > ypSlideOutMenu_level2.aniLen) this.endSlide()
	else {
		var d = Math.round(Math.pow(ypSlideOutMenu_level2.aniLen-elapsed, 2) * this.accelConst)
		if (this.open && this.dirType == "-") d = -d
		else if (this.open && this.dirType == "+") d = -d
		else if (!this.open && this.dirType == "-") d = -this.dim + d
		else d = this.dim + d
	}
}

ypSlideOutMenu_level2.prototype.endSlide = function() {
	this.aniTimer = window.clearTimeout(this.aniTimer)
	if (!this.open) this.setVisibility(false)
	if ((this.open && !this.over) || (!this.open && this.over)) {
		this.startSlide(this.over)
	}
}

ypSlideOutMenu_level2.prototype.setVisibility = function(bShow) { 
	var s = this.ns4 ? this.container : this.container.style
	s.visibility = bShow ? "visible" : "hidden"
}

ypSlideOutMenu_level2.prototype.getPos = function(c) {
	return parseInt(this.style[c])
}

ypSlideOutMenu_level2.prototype.onactivate = function() { }
ypSlideOutMenu_level2.prototype.ondeactivate = function() { }

// interior top nav rollouts
var dn_menu01 = new ypSlideOutMenu_level2("dn_menu01", "left", 290, 120)
var dn_menu02 = new ypSlideOutMenu_level2("dn_menu02", "left", 290, 120)
var dn_menu03 = new ypSlideOutMenu_level2("dn_menu03", "left", 290, 120)
var dn_menu04 = new ypSlideOutMenu_level2("dn_menu04", "left", 290, 120)
var dn_menu05 = new ypSlideOutMenu_level2("dn_menu05", "left", 290, 120)
var dn_menu06 = new ypSlideOutMenu_level2("dn_menu06", "left", 290, 120)
var dn_menu07 = new ypSlideOutMenu_level2("dn_menu07", "left", 290, 120)
var dn_menu08 = new ypSlideOutMenu_level2("dn_menu08", "left", 290, 120)
var dn_menu09 = new ypSlideOutMenu_level2("dn_menu09", "left", 290, 120)
var dn_menu10 = new ypSlideOutMenu_level2("dn_menu10", "left", 290, 120)
var dn_menu11 = new ypSlideOutMenu_level2("dn_menu11", "left", 290, 120)


/*-- downloads form submit --*/

function jsDateLongFormat(myDate) 
{

	convDate = ""
	if (myDate != "")
	{
		convYear = myDate.substr(0, 4)
		convMonth = myDate.substr(5, 2)
		convDay = myDate.substr(8, 2)
	
		//alert ("convMonth before: " + convMonth)
		if (convMonth.charAt(0) == "0")
		{
			convMonth = convMonth.substr(1)
		}
		//alert ("convMonth after: " + convMonth)
	 
		//alert ("convDay before: " + convDay)
		if (convDay.charAt(0) == "0")
		{
			convDay = convDay.substr(1)
		}
		//alert ("convDay after: " + convDay)


		var arrMon = new Array(11)

		arrMon[0] = "January"
		arrMon[1] = "Febuary"
		arrMon[2] = "March"
		arrMon[3] = "April"
		arrMon[4] = "May"
		arrMon[5] = "June"
		arrMon[6] = "July"
		arrMon[7] = "August"
		arrMon[8] = "September"
		arrMon[9] = "October"
		arrMon[10] = "November"
		arrMon[11] = "December"

		convMonth = parseInt(convMonth)

		convDate =  (arrMon[convMonth - 1] + " " + convDay + ", " + convYear)
	}
	return(convDate);


}


function convertSlashDate(sDate) 
{
	year = sDate.substring(0,4)
	month = sDate.substring(5,7)
	day = sDate.substring(8,10)

	cDate = month + "/" + day + "/" + year

	return cDate;

}

//functions below are for submitting docs to be mailed
function fnCheckItemCount() 
{
	var count = 0;
	var alertmsg = "";
		
	for (var i = 0; i < document.downloadsForm.mail_doc.length; i++) 
	{
		if (document.downloadsForm.mail_doc[i].checked) 
		{
			count = count+1
			if (count>5) 
			{
				alertmsg = ("     - you have selected ") + count + (" items.\n     - the maximum allowed is 5.\n");
			}
		}
	}
	if (alertmsg!="") 
	{
		alert("Incorrect Information: \n\n" + alertmsg + "\nPlease return to the form and correct your information.\n\nThank You.\n")
		alertmsg = ""
		return false;
	}
		
	submitDownloadsForm()
	return true;
}
	
function submitDownloadsForm()
{			
	var myWin =  window.open('','amarrPopup','toolbar=0,menubar=0,status=0,scrollbars=1,width=600,height=450,resizable');
	if (myWin.opener == null) 
	{
		myWin.opener = window;
	}
}

//added 01.04.2008 by JWL (created by PR - onRamp
function fnCheckEmailForm(form) 
{
	var alertmsg = ""

    /*
	if (form.sender_first_name.value == "") 
	{
		alertmsg = alertmsg + ("- your FIRST NAME is required\n")
	}
	if (form.sender_last_name.value == "") 
	{
		alertmsg = alertmsg + ("- your LAST NAME is required\n")
	}
	*/
	
	if (form.sender_name.value == "") 
	{
		alertmsg = alertmsg + ("- your NAME is required\n")
	}
	
	if (form.sender_email_address.value == "") 
	{
		alertmsg = alertmsg + ("- your EMAIL ADDRESS is required\n")
	}
	if (form.recipient_name.value == "") 
	{
		alertmsg = alertmsg + ("- your FRIEND'S NAME is required\n")
	}
	if (form.recipient_email_address.value == "") 
	{
		alertmsg = alertmsg + ("- your FRIEND'S EMAIL ADDRESS is required\n")
	}
	if (alertmsg!="") 
	{
		alert("Incorrect Information: \n\n" + alertmsg + "\nPlease return to the form and correct your information.\n\nThank You.\n")
		alertmsg = ""
		return false
	}
	
	return true;
}




/*THE FUNCTIONS BELOW ARE SPECIFICALLY FOR COMPARE DOORS*/

function fnCheckNumberOfDoorsSelected(compare_item) {
	var iCounter = 0;
	for (var i=0; i < compare_item.length; i++) {
		if (compare_item[i].checked) {
			iCounter = iCounter+1;
		}
	}
	return iCounter;
}

function fnShowCount(form) {
	var i = fnCheckNumberOfDoorsSelected(form.compare_item);
	if (i<= 1 || i > 5) {
		//alert("Important Information:\n\n     Please note that you may only select 5 or less doors to compare.\n     Please deselect one of your door choices.\n\n Thank You.");
		MM_showHideLayers('error','','show');
		return false;
	}
	MM_showHideLayers('error','','hide');
	return true;
}

function fnShowCountThisItem(form, item) {
	var i = fnCheckNumberOfDoorsSelected(form.compare_item);
	if (i > 5) {
		//alert("Important Information:\n\n     Please note that you may only select 5 or less doors to compare.\n\n Thank You.");
		MM_showHideLayers('error','','show');
		return false;
	}
	MM_showHideLayers('error','','hide');
	return true;
}
<!--
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_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_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; }
}
//-->
window.onerror = null;

var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
function start() {
	if(ns6||ns4) {
		pageWidth = innerWidth;
		pageHeight = innerHeight;
		layerSetup();
		floatObject();
	}
	else if(ie4) {
		pageWidth = document.body.clientWidth;
		pageHeight = document.body.clientHeight;
		layerSetup();
		floatObject();
   }
}
function layerObject(id,left) {
	if (ns6) {
		this.obj = document.getElementById(id).style;
		this.obj.left = left;
		return this.obj;
	}
	else if(ie4) {
		this.obj = document.all[id].style;
		this.obj.left = left;
		return this.obj;
	}
	else if(ns4) {
		this.obj = document.layers[id];
		this.obj.left = left;
		return this.obj;
	}
}
function layerSetup() {
	floatLyr = new layerObject('error', pageWidth * .2);
	window.setInterval("main()", 10)
}
function main() {
	if (ns4) {
		this.currentY = document.layers["error"].top;
		this.scrollTop = window.pageYOffset;
		mainTrigger();
	}
		else if(ns6) {
		this.currentY = parseInt(document.getElementById('error').style.top);
		this.scrollTop = scrollY;
		mainTrigger();
	} else if(ie4) {
		this.currentY = error.style.pixelTop;
		this.scrollTop = document.body.scrollTop;
		mainTrigger();
	}
}
function mainTrigger() {
    var topMargin = 200;

	var newTargetY = this.scrollTop + this.topMargin;
	if ( this.currentY != newTargetY ) {
		if ( newTargetY != this.targetY ) {
			this.targetY = newTargetY;
			floatStart();
		}
		animator();
	}
}
function floatStart() {
    var slideTime = 1200;

	var now = new Date();
	this.A = this.targetY - this.currentY;
	this.B = Math.PI / ( 2 * this.slideTime );
	this.C = now.getTime();
	if (Math.abs(this.A) > this.findHt) {
		this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
		this.A = this.A > 0 ? this.findHt : -this.findHt;
	}
	else {
		this.D = this.currentY;
	}
}
function animator() {
	var now = new Date();
	var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
	newY = Math.round(newY);
	if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
		if ( ie4 )document.all.error.style.pixelTop = newY;
		if ( ns4 )document.layers["error"].top = newY;
		if ( ns6 )document.getElementById('error').style.top = newY + "px";
	}
}
function floatObject() {
	if (ns4 || ns6) {
		findHt = window.innerHeight;
	} else if(ie4) {
		findHt = document.body.clientHeight;
   }
}


/*THE FUNCTIONS ABOVE ARE SPECIFICALLY FOR COMPARE DOORS*/
