function swapdata(src,des)
{
	var stemp=document.getElementById(src).innerHTML;
    var dtemp=document.getElementById(des).innerHTML;
    document.getElementById(des).innerHTML=stemp;
    document.getElementById(src).innerHTML=dtemp;    
}

function checkstream()
{
if (gsearch.q.value=='example: Ford Ranger Red or Altima 2.5L')
	{
	gsearch.q.value='';
	}
if (gsearch.q.value=='Enter a Stock #')
	{
	gsearch.q.value='';
	}
}

function checkstream2()
{
if (gsearch.q.value==gsearch.q.value)
	{
	gsearch.q.value='';
	}
}

function menu_bar()
{
	var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1");
}

function movepic(img_name,img_src)
{
	document[img_name].src=img_src;
}

function showpay() {
 if ((document.calc.loan.value == null || document.calc.loan.value.length == 0) ||
     (document.calc.months.value == null || document.calc.months.value.length == 0)
||
     (document.calc.rate.value == null || document.calc.rate.value.length == 0))
 { document.calc.pay.value = "Incomplete data";
 }
 else
 {
 var princ = document.calc.loan.value;
 var term  = document.calc.months.value;
 var intr   = document.calc.rate.value / 1200;
 document.calc.pay.value = princ * intr / (1 - (Math.pow(1/(1 + intr), term)));
 }

// payment = principle * monthly interest/(1 - (1/(1+MonthlyInterest)*Months))

}

function disp(url)
{  
window.open(url, "", "width=1010,height=700,scrollbars=1, resizable=1,toolbar=0,location=no,directories=no,status=no,menubar=no,copyhistory=no, ");
}   

function eraseSA(obj){ if (obj.value == obj.defaultValue) obj.value = ""; }

function multipleSwapData(src,des)
{
    var stemp=document.getElementById(src).innerHTML;
    document.getElementById(des).innerHTML=stemp;
}

function showMobileFooterLink() {
	if (document.getElementById('mobileFooterLink')) {
		if(navigator.userAgent.match(/iPhone/i)) {
			document.getElementById('mobileFooterLink').style.cssText='';
		}

		else if(navigator.userAgent.match(/iPod/i)) {
			document.getElementById('mobileFooterLink').style.cssText='';
		}

		else if(navigator.userAgent.match(/Android/i)) {
			document.getElementById('mobileFooterLink').style.cssText='';
		}
	
		else if(navigator.userAgent.match(/HTC_/i)) {
			document.getElementById('mobileFooterLink').style.cssText='';
		}
	
		else if(navigator.userAgent.match(/BlackBerry/i)) {
			document.getElementById('mobileFooterLink').style.cssText='';
		}
	}
}

function globalScriptLoader() {
	showMobileFooterLink();
}
