
//Check pop-up
//------------------------------------------------------------------------

function popCheck()
{	
	window.open('check/check.asp', 'Check','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=350,height=228');
}

//special pop-up
//------------------------------------------------------------------------

function popSpecial(image)
{	
	window.open('Specialspopup.asp?IMG=' + image, 'Deal','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=450,height=160');
}

//------------------------------------------------------------------------

function popQQuote_old(series)
{	
	var linkAdd = '';

	if (series != 'NA')
	{
		linkAdd = '&SERIES=' + series
	}
//http://www.dealerqq.com/app/default.aspx?qqid=1017
	window.open('http://app.dealerqq.com/security.asp?DLR_ID=' + jsDLR_ID + '&DLR_URL=' + jsSITE_ID + '&DLR_MAKE=' + jsMAKE + linkAdd, 'QuickQuote','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=600,height=520');
}
function popQQuote(series)
{	
	var linkAdd = '';

	if (series != 'NA')
	{
		linkAdd = '&SERIES=' + series
	}
//http://www.dealerqq.com/app/default.aspx?qqid=1017
	window.open('http://www.dealerqq.com/app/default.aspx?qqid=1017', 'QuickQuote','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=653,height=730');
}

function popCreditApp(fname, lname, hphone, wphone)
{
	//var url = 'https://secure.dealersource.net/creditapp/default.aspx?DLR_ID=' + jsDLR_ID + '&SITE_ID=' + jsCRDAP_ID + '&FNAME=' + fname + '&LNAME=' + lname + '&WPHONE=' + wphone + '&HPHONE=' + hphone 
	var url = 'https://secure.automotiveinventory.com/CreditApplication.aspx?DealerCreditApplicationId=170'
	window.open(url, 'CreditApp','toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=1,copyhistory=1,scrollbars=2,width=700,height=600');
}

//==============================================================================
// Email to a Friend pop up
//==============================================================================
function popEmailtoFriend(CarId)
{	
	window.open('http://www.dealerqq.com/shared/EmailtoFriend/index.asp?DLRNAME=Max Madsen Mitsubishi Aurora&DLRURL=maxmadsen.com&DLRMAKE=mitsubishi&DLRPAGE=/InvNewDetail.asp&DLR_ID={9BACF440-5AE1-40B5-90AB-FAFA89B1D67C}&SITE_ID=aurora&CARID=' + CarId , 'EmailtoFriend','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=360,height=260');
}

//==============================================================================
// VALIDATE E-MAIL
//==============================================================================
function val_email(field) 
{
  var str = field.value; // email string
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid

	if (str != "")
	{
		if (!reg1.test(str) && reg2.test(str)) 
		{ 
			// if syntax is valid
			return true;
		}
			//if is invalid
			alert("\"" + str + "\" is an invalid E-mail! eg: username@domain.com'"); // this is also optional
			field.focus();
			field.select();
			return false;
	}
}


//==============================================================================
// VALIDATE NUMBER
//==============================================================================
function val_num(field) 
{
	//change here if needed
	var valid = "0123456789"
	var ok = "yes";
	var temp;
	
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (ok == "no") 
	{
		alert("Only numbers are accepted!");
		field.focus();
		field.select();
	}
}




//==============================================================================
// DEALER QUICK CALL - THRID PARTY
//==============================================================================
function popQuickCall()
{	
	window.open('http://www.gphone.com/webcallback/webrequest.asp?siteid=www.maxmadsen.com', 'QuickCall','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,copyhistory=0,scrollbars=0,width=400,height=300')
}

//==============================================================================
// LOAD N/A ../images ON PRE-OWNED AND NEW CAR DETAIL PAGE IN CASE IMAGE IS NOT IN DEALERQQ
//==============================================================================
function LoadNaPic()
{	
	document.all.car_pic.src = "graphics/na.jpg"
}

//==============================================================================
// carfax - 
//==============================================================================
function popCarFax()
{
	window.open('extras/carfax.asp?DLR_ID=' + jsDLR_ID + '&SITE_ID=' + jsSITE_ID, 'CarFax','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=255,height=225');
}

//==============================================================================
// 2006 ECLIPSE POP UP - 
//==============================================================================
function pop06eclipse()
{	
	window.open('extras/06eclipse.asp?DLR_EMAIL=quickquoteaa@maxmadsen.com&DLR_NAME=Max Madsen Mitsubishi Aurora', 'Advertisment','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=380,height=450');
}

function pop06raider()
{	
	window.open('extras/06raider.asp?DLR_EMAIL=quickquoteaa@maxmadsen.com&DLR_NAME=Max Madsen Mitsubishi Aurora', 'Advertisment','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=380,height=450');
}


//==============================================================================
// VIDEO POP UP 2 - 
//==============================================================================
function popVideo(LINK)
{
	var url = "video.asp?LINK=" + LINK
	window.open(url, 'Video','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=350,height=320');
}

function popAudio(LINK)
{
	var url = "audio.asp?LINK=" + LINK
	window.open(url, 'Audio','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=350,height=25');
}

function popAd()
{	
	window.open('extras/ad.asp?DLR_EMAIL=quickquoteaa@maxmadsen.com&DLR_NAME=Max Madsen Mitsubishi Aurora', 'Advertisment','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=380,height=450');
}


function popGas()
{	
	window.open('extras/ad_gas.asp?DLR_EMAIL=quickquoteaa@maxmadsen.com&DLR_NAME=Max Madsen Mitsubishi Aurora', 'Advertisment','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars=0,width=380,height=540');
}