﻿function NavMouseOver(element) {
   element.style.backgroundColor = 'blue'; 
   element.style.color = 'white';
}

function NavMouseOut(element) {
    element.style.backgroundColor = '#BBC8E1'; 
    element.style.color = 'Yellow';
}

function PopWin(url) {
	win = open(url, 'PopWin', 'width=840,height=600,left=20,top=20,status=yes, menubar=no, scrollbars=yes, resizable=yes');
	win.opener = self;
	win.focus();
}


/* Mortg Calc */

function floor(number)
{
    //return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
}

function dosum()
{
    /*
     var mi = document.temps.IR.value / 1200;
     var base = 1;
     var mbase = 1 + mi;
     for (i=0; i<document.temps.YR.value * 12; i++)
     {
     base = base * mbase
     }
     document.temps.PI.value = floor(document.temps.LA.value * mi / ( 1 - (1/base)))
     document.temps.MT.value = floor(document.temps.AT.value / 12)
     document.temps.MI.value = floor(document.temps.AI.value / 12)
     var dasum = document.temps.LA.value * mi / ( 1 - (1/base)) +
     document.temps.AT.value / 12 + 
     document.temps.AI.value / 12;
     document.temps.MP.value = floor(dasum);
     */
}

function OpenAWeber() {
    window.open('http://aweber.com/?344060', 'aweberWin', 'width=850,height=700,top=30,left=80,toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes, resizable=yes');
} 

function OpenSampleWin(url) {
    window.open(url ,'View','width=850,height=700,top=30,left=80,toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes, resizable=yes');
} 

function OpenExternalWin(url) {
    window.open(url ,'View','width=850,height=700,top=30,left=80,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');
}

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}



var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo


if(ie){
Ex = "event.x"
Ey = "event.y"

topColor = "#808080"
subColor = "#C0C0C0"
}

if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere

topColor = "#808080"
subColor = "#C0C0C0"
}



function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))}
if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}


function ReplaceContent(layerName){

if(ie){document.all[layerName].innerHTML = ContentInfo}


if(ns){

with(document.layers[layerName].document) 
{ 
   open(); 
   write(ContentInfo); 
   close(); 
}

}


}



function Activate(){initialize=1}
function deActivate(){initialize=0}


function overhere(e){
if(initialize && ie){

MoveToolTip("ToolTip", Ey, Ex, e)
eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
}

else{
MoveToolTip("ToolTip", 0, 0)
eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
}


}

function EnterContent(TTitle, TContent){
if(ie){
window.document.tooltip.SetVariable("tooltiptitle", TTitle);
window.document.tooltip.SetVariable("tooltipcontent", TContent);
}
}
