// Javascript Document

if (document.images)
{
  pic1= new Image(); 
  pic1.src="/images/menu_back_over.gif";   
}


function parentPosition(ch) {

var valueT = 0, valueL = 0;

do 
{
valueT += ch.offsetTop || 0;
valueL += ch.offsetLeft || 0;
ch = ch.offsetParent;
} 
while (ch);
return [valueL, valueT];

}

function menu() {
    navRoot = document.getElementById("backmenu"); 
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i]; 
      if (node.nodeName=="TD") {
        node.onmouseover=function() 
        {
        this.className+=" over";
        }
        node.onmouseout=function() 
        {
        this.className=this.className.replace("over", "");
        }
        
        
        
        tagA = document.getElementsByTagName("UL");
        for(a = 0; a < tagA.length; a++) {
          if (tagA[a].className == 'subMenu') {
            parentPosition(tagA[a]);
          }
        }
      
      }
    }
}





function allf() {
menu();
}
window.onload=allf;

////////////////////////////////////////////////////////////////
function menuOpen(child) {
    var v = document.getElementById(child);
    if (null != v)
        v.className = v.className == "collapsed" ? "expanded" : "collapsed";
}

window.name = "main"

function showcalc(doc_name)
{
	remote = window.open(doc_name, "calc", "height=250,width=350")
}

/////////////////////////////////////////////////////
var myImage = new Array()

myImage[1] = "<?=$images[0][0]?>";
myImage[2] = "<?=$images[2][0]?>";
myImage[3] = "<?=$images[4][0]?>";
myImage[4] = "<?=$images[6][0]?>";
myImage[5] = "<?=$images[8][0]?>";
myImage[6] = "<?=$images[10][0]?>";
myImage[7] = "<?=$images[12][0]?>";
myImage[8] = "<?=$images[14][0]?>";
myImage[9] = "<?=$images[16][0]?>";
myImage[10] = "<?=$images[18][0]?>";

function SetImage(i)
{

	document.mainimage.src=myImage[i];

}

window.name = "main"

function launchRemote(doc_name)
{
	remote = window.open(doc_name, "order", "height=250,width=450")
}

function launchRemoteVin(doc_name)
{
	remote = window.open(doc_name, "vin", "height=350,width=300")
}


function launchRemotePhoto(doc_name)
{
	remote = window.open(doc_name, "photo", "width=640, toolbar=no, resizeable=yes, scrollbar=yes")
}

function showcalc(doc_name)
{
	remote = window.open(doc_name, "calc", "height=250,width=350")
}
function bg(id, color) {
  document.getElementById(id).style.borderColor = '#'+color;
}

