var ie = document.all;
var ns = document.layers;
var w3 = (document.getElementById && !ie);
var Logo = new Image(178,23); Logo.src = "/images/new-cars-over.png";
var VeilX = new Image(178,23); VeilX.src = "/images/veil/x.gif";

// Preload the spinners.
var Spin16 = new Image(16,16); Spin16.src = "/images/spinners/16x16.gif";
var Spin32 = new Image(32,32); Spin32.src = "/images/spinners/32x32.gif";
var Spin64 = new Image(64,64); Spin64.src = "/images/spinners/64x64.gif";
var Spin300x150 = new Image(300,150); Spin300x150.src = "/images/spinners/300x150.gif";

function FormatCurrency(Num, Dig, Grp)
{
	Num = Num.toString().replace(/\$|\,/g,"");
	if (isNaN(Num) == true) {Num = 0;}
	if ((isNaN(Dig) == true) || (Dig < 0)) {Dig = 2;}
	if (Grp == 1) {Grp = 1;} else {Grp = 0;}
	var Sng = (Num == (Num = Math.abs(Num)));
	var Len = "1";
	for (var i = 0; i < Dig; i++) {Len = (Len + "0");}
	Num = Math.floor(Num * Len + 0.50000000001);
	var Cnt = Num % Len;
	Num = Math.floor(Num / Len).toString();	
	if ((Cnt < 10) & (Dig >= 2)) {Cnt = "0" + Cnt;}
	if (Grp == 0) {for (var i = 0; i < Math.floor((Num.length - (1 + i)) / 3); i++) {Num = Num.substring(0,Num.length - (4 * i + 3)) + "," + Num.substring(Num.length - (4 * i + 3));}}
	if (Dig == 0) {return ((Sng ? "" : "-") + "$" + Num);}
	else {return ((Sng ? "" : "-") + "$" + Num + "." + Cnt);}
}

function LogoOut(o)
{
	o.src = "/images/new-cars.png";
}

function LogoOver(o)
{
	o.src = Logo.src;
}

function OnlyNumbers(x)
{
	var y = "";
	for (var i = 0; i < x.length; i++)
	{
		var a = x.charAt(i);
		if (a=="0"||a=="1"||a=="2"||a=="3"||a=="4"||a=="5"||a=="6"||a=="7"||a=="8"||a=="9")
			y = y+a;
	}
	return y;
}

function OpenBBB()
{
	window.open("https://www.bbb.org/online/consumer/cks.aspx?id=1090731121623707", "_bbb", "copyhistory=no, directories=no, height=550, left=160, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=160, width=600");
}

function OpenGoDaddy()
{
	window.open("https://seal.godaddy.com/verifySeal?sealID=MqwD8sKq6LjdvPwe2QzDDkzVzUPiN4a9hnvyD57bOXs8GfXrWaOeI", "_goDaddy", "copyhistory=no, directories=no, height=433, left=160, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=160, width=536");
}

function SecCodeFocus(o)
{
	if (o.value == "Type code here...")
	{
		o.value = "";
		o.select();
	}
	else if (o.value == "")
		o.value = "Type code here...";
}

function TextBlur(o)
{
	o.style.backgroundColor = "";
}

function TextFocus(o)
{
	o.style.backgroundColor = "#ffffcc";
}
