
// dreamweaver rollovers

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// *******************************************************		easeInOut()
/*
	--Generic Animation Step Value Generator By www.hesido.com 
		powr > 1 produces ease-in
		powr < 1 produces ease-out
		powr = 1 produces linear animations
*/
function easeInOut(minValue, maxValue, totalSteps, actualStep, powr)
{
	var delta = maxValue - minValue; 
	var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
	return Math.ceil(stepp);
} 



// ************************************************* 

function showLoginBox(e, vehicleId, action, refUrl, siteRootHttps, imagesUrl)
{
	
	MM_preloadImages(imagesUrl+'/button-login.gif', imagesUrl+'/button-login_over.gif', imagesUrl+'/button-create_account.gif', imagesUrl+'/button-create_account_over.gif', imagesUrl+'/button-x.gif', imagesUrl+'/button-x_over.gif');
	
	var scrollXY = getScrollXY();
	var buttonPosX = findPosX('vehicleSave'+vehicleId);

	var top = scrollXY[1];
	var left = 0;
	
	var html = '<div style="padding: 12px; background-color: #EEEEEE; border: 1px solid #DDDDDD; ';
	html += 'position: absolute; top: '+top+'px; left: '+left+'px; z-index: 20; text-align: center;">';
	
	html += '<table style="width: 100%"><tr><td style="text-align: center;">To save this vehicle you will need to quickly login<br />or create a new account:</td>';
	html += '<td style="text-align: right; vertical-align: top;"><a href="javascript: hideLoginBox();">Close</a>';
	html += '<a href="javascript: hideLoginBox();"><img src="'+imagesUrl+'/button-x.gif" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'closeX\',\'\',\''+imagesUrl+'/button-x_over.gif\',1)"  alt="Close" name="closeX" id="closeX" style="position: relative; top: 6px; left: 5px;" /></a></td></tr></table>';
	
	html += '<form name="login" method="post" action="'+siteRootHttps+'/login2.php">';
	html += '<input type="hidden" name="action" value="'+action+'" />';
	html += '<input type="hidden" name="refUrl" value="'+refUrl+'" />';
	
	html += '<table style="margin: auto; width: 100%;" border="0" cellpadding="0" cellspacing="0">';
	html += '<tr><td class="tdLHead" colspan="2">Login To Your Account</td></tr>';
	html += '<tr><td class="tdR">Email Address:</td>';
	html += '<td class="tdL"><input type="text" size="30" name="emailAddress" /></td></tr>';
	html += '<tr><td class="tdR">Password:</td>';
	html += '<td class="tdL"><input type="password" size="30" name="password" /></td></tr>';
	html += '<tr><td class="tdC" colspan="2"><br />';
	html += '<input type="image" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'loginSubmit\',\'\',\''+imagesUrl+'/button-login_over.gif\',1)" src="'+imagesUrl+'/button-login.gif" alt="Login" name="loginSubmit" id="loginSubmit" />';
	html += '</td></tr></table></form><br />';
	
	html += '<div class="centerDiv">Forgot your password?  <a href="'+siteRootHttps+'/forgot_password.php">Click Here</a>.</div><br />';
	
	html += '<form name="signup" method="post" action="'+siteRootHttps+'/signup2.php">';
	html += '<input type="hidden" name="action" value="'+action+'" />';
	html += '<input type="hidden" name="refUrl" value="'+refUrl+'" />';
	html += '<table style="margin: auto; width: 100%;" border="0" cellpadding="0" cellspacing="0">';
	html += '<tr><td class="tdLHead" colspan="2">Create a New Account</td></tr>';
	html += '<tr><td class="tdR">Email Address:</td>';
	html += '<td class="tdL"><input type="text" size="30" name="emailAddress" /></td></tr>';
	html += '<tr><td class="tdR">Choose a Password:</td>';
	html += '<td class="tdL"><input type="password" size="30" name="password" /></td></tr>';
	html += '<tr><td class="tdR">Re-enter Password:</td>';
	html += '<td class="tdL"><input type="password" size="30" name="password2" /></td></tr>';
	html += '<tr><td class="tdC" colspan="2"><input type="checkbox" name="subscribe" checked="checked" /> &nbsp; Subscribe to newsletters and announcements</td></tr>';
	html += '<tr><td class="tdC" colspan="2"><br />';
	html += '<input type="image" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'signupSubmit\',\'\',\''+imagesUrl+'/button-create_account_over.gif\',1)" src="'+imagesUrl+'/button-create_account.gif" alt="Create Account" name="signupSubmit" id="signupSubmit" />';
	html += '</td></tr></table></form>';
	
	html += '</div>';

	document.getElementById('saveThisVehicleDiv').innerHTML = html;
}



function hideLoginBox()
{
	document.getElementById('saveThisVehicleDiv').innerHTML = '';
}

// ***************************************************************

function nullFunc()
{
	return;
}

// ***************************************************************


