function home_opt(par)
{
	window.location.href="index.php?pagename="+par
}


function checkdigits(obj)
{
str=document.getElementById(obj).value;
if (isNaN(str))
{
return false;
}
if (str.length!=10)
{
return false;
}
return true;
}


function checkformat(obj)
{
pat=/^[0-9]+$/;
str=document.getElementById(obj).value;
if (str!="")
{
first=str.substr(0,3);
second=str.substr(4,3);
third=str.substr(8,4);
status1=0;
if ((first.length==3) && (first.match(pat))) 
{
	if ((second.length==3) && (second.match(pat)))
	{
		 if ((third.length==4) && (third.match(pat)))
		 status1=1;
	}
}
return status1; 
}
else
return 0;
}

function check_char(obj)
{
str=document.getElementById(obj).value;
pat=/^[0-9]+$/;
first=str.substr(0,3);
if (!first.match(pat))
{
document.getElementById(obj).value="";
document.getElementById(obj).focus();
}
}

function format_field(obj,e)
{
str=document.getElementById(obj).value;
var key = window.event ? e.keyCode : e.which;
cd=e.keyCode-48;
fc=str.substr(3,1);
if ((cd==-3))
return false;
else if (e.charCode==45)
return false;
///////////////////////////////////
pat=/^[0-9]+$/;
first=str.substr(0,3);
if (first.length <3)
first="111";
second=str.substr(4,3);
if (second.length <3)
second="111";
third=str.substr(8,4);
if (third.length<4)
third="1111";

if ((!first.match(pat)) || (!second.match(pat)) || (!third.match(pat)))
{
document.getElementById(obj).value="";
document.getElementById(obj).focus();
}
if ((str.length==3) && (key !=8))
{
str+="-";
document.getElementById(obj).value=str;
}
else if ((str.length==7) && (key !=8))
{
str+="-";
document.getElementById(obj).value=str;
}
}




function check()
{
fn1=document.getElementById("first_name").value;
ln1=document.getElementById("last_name").value;
add1=document.getElementById("address").value;
city1=document.getElementById("city").value;
state1=document.getElementById("state").value;
zip1=document.getElementById("zip").value;
tel1=document.getElementById("telephone").value;
email1=document.getElementById("email").value;
age1=document.getElementById("age");

stat=0;
pat=/^[a-zA-Z\s]+$/;
	if (!fn1.match(pat))
	{
	document.getElementById("fn").style.color="red";
	stat=1;
	}
	else
	document.getElementById("fn").style.color="#999";
	if (!ln1.match(pat))
	{
	document.getElementById("ln").style.color="red";
	stat=1;
	}
	else
	document.getElementById("ln").style.color="#999";
	if (add1=="")
	{
	document.getElementById("add").style.color="red";
	stat=1;
	}
	else
	document.getElementById("add").style.color="#999";
	if (!city1.match(pat))
	{
	document.getElementById("cty").style.color="red";
	stat=1;
	}
	else
	document.getElementById("cty").style.color="#999";
	if (state1==-1)
	{
	document.getElementById("st").style.color="red";
	stat=1;
	}
	else
	document.getElementById("st").style.color="#999";
	pat=/^[0-9]+$/;
	len=zip1.length;
	if (!zip1.match(pat) || (len !=5))
	{
	document.getElementById("zp").style.color="red";
	stat=1;
	}
	else
	document.getElementById("zp").style.color="#999";
	
	if (tel1!="")
	{
	if ((!checkformat('telephone')) && (!checkdigits('telephone')))
	{
	document.getElementById("ph").style.color="red";
	stat=1;
	}
	else
	document.getElementById("ph").style.color="#999";
	}
	
	pat=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	if (!email1.match(pat))
	{
	document.getElementById("em").style.color="red";
	stat=1;
	}
	else
	document.getElementById("em").style.color="#999";
	
	if (age1.checked!=true)
	{
	document.getElementById("ag").style.color="red";
	stat=1;
	}
	else
	document.getElementById("ag").style.color="#999";
	
	if (stat ==1)
	{
	document.getElementById("msg").style.color="red";
	document.getElementById("msg").innerHTML="Enter the fields marked red";
	return false;
	}
	else
	{
	document.getElementById("msg").style.color="#999";
	document.getElementById("msg").innerHTML="";
	return true;
	}
}

/*** Main Menu Function ******/

function stepin()
{
	window.location.href="mks2010.php";
}

function ecoboost()
{
	//window.location.href="ecoboost.php";
}

function features()
{
window.location.href="features.php";
}


function lincolnlogo()
{
url="http://www.lincoln.com/"
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: lincoln exit"
s.server=window.location.hostname;
s.prop5="ll: home: lincoln exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open(url,'mywindow','width=920,height=780,scrollbars=yes');
}


function view_all()
{	
url="http://www.fordcredit.com/"
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: ford credit"
s.server=window.location.hostname;
s.prop5="ll: home: ford credit exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open(url,'mywindow','width=920,height=780,scrollbars=yes');
}

function check2011mkx()
{	
url="http://www.lincoln.com/2011mkx/"
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: the vehicles: 2010 mkx: check 2011 mkx exit"
s.server=window.location.hostname;
s.prop5="ll: the vehicles: 2010 mkx: check 2011 mkx exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open(url,'mywindow','width=920,height=780,scrollbars=yes');
}


function build_own()
{	
url="http://www.lincoln.com/Configurator/BuildAndPriceVehicle.aspx?configAction=configTrim&brandCode=Lincoln&referrer=LMBrand"
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: build your own exit"
s.server=window.location.hostname;
s.prop5="ll: home: build your own exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open(url,'mywindow','width=920,height=780,scrollbars=yes');
}

function exploremore()
{
window.open('lincoln_files/index.php','mywindow','width=920,height=780,scrollbars=yes');
}

function getupdates()
{
	window.location.href="update.php";
}

function gallery()
{
	window.location.href="gallery.php";
}
/*** Main Menu Function ******/

/*** Bottom Menu Options *****/

function lincoln_exit()
{
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: lincoln exit"
s.server=window.location.hostname;
s.prop5="ll: home: lincoln exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open("http://www.lincoln.com/?bannerid=lincolnlounge");
}


function contactus()
{
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: contact us exit"
s.server=window.location.hostname;
s.prop5="ll: home: contact us exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open("http://www.lincoln.com/help/contact_us.asp?bannerid=lincolnlounge");
}

function terms_conditions()
{
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: terms conditions exit"
s.server=window.location.hostname;
s.prop5="ll: home: terms conditions exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open("http://www.lincoln.com/privacy.asp?bannerid=lincolnlounge");
}

function rssopen(url)
{	
s.linkTrackVars="pageName,server,channel,prop5,prop14,prop15,eVar4,eVar14,eVar15,events";
s.linkTrackEvents="event4";
s.channel="home"
s.pageName="ll: home: urban daddy exit"
s.server=window.location.hostname;
s.prop5="ll: home: urban daddy exit"
s.prop14="lincoln lounge"
s.prop15="lincolnlounge.com"
s.events="event4"
s.eVar4="eng"
s.prop11= ""
s.eVar14="lincoln lounge"
s.eVar15="lincolnlounge.com"
s.tl(this, 'e', s.prop5);
window.open(url,'mywindow','width=300,height=300,scrollbars=yes,resizable=1');
}
/**** Bottom Menu Options ****/
