<!--

/*
if( (!(navigator.appName.indexOf("Netscape")!=-1 && parseInt(navigator.appVersion)>=5))
		&& window.location.href.toString().toLowerCase().indexOf("admin")==-1 )
	document.write("<style>body {overflow:scroll}</style>")


var oldMsg = window.status;
var newMsg = "Открыть новое окно с деталями о машине";

///////////////////////////////////
function ShowMsg()
{
	window.status = newMsg;
	return true;
}
function ClearMsg()
{
	window.status = oldMsg;
	return true;
}
function Details( StockID )
{
	var url = "Details.aspx?sid=" + StockID;
	var options = "width=790,scrollbars";
	window.open(url,'',options);
	return false;
}
*/

function ShowMsg(msg)
{
	window.status = msg;
	return true;
}
function ClearMsg()
{
	window.status = "";
	return true;
}

function email( name, domain, subject )
{
	if(! domain ) domain = "TheAffordableAuto.com"
	var fullAddress = "mailto:" + name + "@" + domain
	var address = name + '@' + domain
	if( subject ) fullAddress += "?subject=" + subject
	document.write('<a href="' + fullAddress + '">' + address + '</a>')
}

function Highlight(CB,cssHi,cssLo)
{
	if( CB.checked )
	{
		while( CB.tagName!="TR" )
			CB = CB.parentElement;
		CB.className=cssHi;
	}
	else
	{
		while( CB.tagName!="TR" )
			CB = CB.parentElement;
		CB.className=cssLo;
	}
}

//IMAGE PREVIEW (ENLARGEMENT)
var ie=document.all
var ns6=document.getElementById&&!document.all

var myWindow = window.parent.window
var origmousemove = myWindow.document.onmousemove

function ietruebody(){
	return (myWindow.document.compatMode && myWindow.document.compatMode!="BackCompat" && !window.opera)? myWindow.document.documentElement : myWindow.document.body
}
function enlarge(which, e){
	if (ie||ns6){
		crossobj=document.getElementById? myWindow.document.getElementById("showimage") : myWindow.document.all.showimage
		//crossobj.style.visibility="hidden"
		crossobj.style.display="block"
		crossobj.innerHTML='<div align="right" id="dragbar" onmousedown="initializedrag(event)"><span id="closetext" title="close" onClick="closepreview()">[X]</span> </div><img src="'+which+'" onLoad="AdjustPictureSize(this.width,this.height)">'
		return false
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true
}
function AdjustPictureSize(imgwidth,imgheight)
{
	crossobj=document.getElementById? myWindow.document.getElementById("showimage") : myWindow.document.all.showimage
	crossframe=document.getElementById? myWindow.document.getElementById("imageframe") : myWindow.document.all.imageframe
	pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
	horzpos=ns6? pageXOffset+myWindow.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
	vertpos=ns6? pgyoffset+myWindow.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
	if (window.opera && myWindow.innerHeight) //compensate for Opera toolbar
		vertpos=pgyoffset+myWindow.innerHeight/2-imgheight/2
	vertpos=Math.max(pgyoffset, vertpos)

	crossobj.style.left=horzpos+"px"
	crossobj.style.top=vertpos+"px"

	crossframe.style.left = crossobj.style.left;
	crossframe.style.top = crossobj.style.top;
	crossframe.style.width = imgwidth+2;
	crossframe.style.height = imgheight+17;

	crossframe.style.display="block"
	crossobj.style.visibility="visible"
}
function closepreview(){
	crossobj=myWindow.document.getElementById? myWindow.document.getElementById("showimage") : myWindow.document.all.showimage
	crossframe=myWindow.document.getElementById? myWindow.document.getElementById("imageframe") : myWindow.document.all.imageframe
	crossobj.style.display="none"
	crossframe.style.display="none"
	document.onmousemove = origmousemove
}
function drag_drop(e){
	crossobj=myWindow.document.getElementById? myWindow.document.getElementById("showimage") : myWindow.document.all.showimage
	crossframe=myWindow.document.getElementById? myWindow.document.getElementById("imageframe") : myWindow.document.all.imageframe
	if (ie&&dragapproved){
		crossobj.style.left=tempx+event.clientX-offsetx+"px"
		crossobj.style.top=tempy+event.clientY-offsety+"px"
		crossframe.style.left=crossobj.style.left
		crossframe.style.top=crossobj.style.top
	}
	else if (ns6&&dragapproved){
		crossobj.style.left=tempx+e.clientX-offsetx+"px"
		crossobj.style.top=tempy+e.clientY-offsety+"px"
		crossframe.style.left=crossobj.style.left
		crossframe.style.top=crossobj.style.top
	}
	return false
}
function initializedrag(e){
	crossobj=myWindow.document.getElementById? myWindow.document.getElementById("showimage") : myWindow.document.all.showimage
	crossframe=myWindow.document.getElementById? myWindow.document.getElementById("imageframe") : myWindow.document.all.imageframe
	offsetx=e.clientX
	offsety=e.clientY

	tempx=parseInt(crossobj.style.left)
	tempy=parseInt(crossobj.style.top)

	dragapproved=true
	document.onmousemove=drag_drop
}
document.onmouseup=new Function("dragapproved=false")
//END OF IMAGE PREVIEW (ENLARGEMENT)

/* PAGE LOADING message

<div id="hidepage" style='display:"none"; position:"absolute"; height:"100%"; width:"100%";'>
 <table width=100% height=100%>
  <tr height=100% valign=middle align=center>
   <td>
    <h1>Page loading ... Please wait.</h1>
   </td>
  </tr>
 </table>
</div>

function showPage()
{
	if( document.getElementById ) //IE5, NS6
		crossHidePageStyle = document.getElementById('hidepage').style;
	else if( document.layers ) //NS 4
		crossHidePageStyle = document.hidepage;
	else //IE 4
		crossHidePageStyle = document.all.hidepage.style;
	crossHidePageStyle.visibility = 'hidden';
}

function hidePage()
{
	if( document.getElementById ) //IE5, NS6
		crossHidePageStyle = document.getElementById('hidepage').style;
	else if( document.layers ) //NS 4
		crossHidePageStyle = document.hidepage;
	else //IE 4
		crossHidePageStyle = document.all.hidepage.style;
	crossHidePageStyle.visibility = 'visible';
}

*/
// -->
