var marked_row = new Array;

		
function setP(theRow, theAction, theDefaultColor)
{
    var theCells = null;
    var thePointerColor ='#5C8BAD';
    var theMarkColor ='#FFCC99';
    var theRowNum = 1;
    if ((thePointerColor == '' && theMarkColor == '')
	|| typeof(theRow.style) == 'undefined') {
	return false;
    }

    if (typeof(document.getElementsByTagName) != 'undefined') {
	theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
	theCells = theRow.cells;
    }
    else {
	return false;
    }

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
     if (typeof(window.opera) == 'undefined'
	&& typeof(theCells[0].getAttribute) != 'undefined') {
	currentColor = theCells[0].getAttribute('bgcolor');
	domDetect    = true;
    }
    else {
	currentColor = theCells[0].style.backgroundColor;
	domDetect    = false;
    } 

    if (currentColor == ''
	|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
	if (theAction == 'over' && thePointerColor != '') {
	    newColor              = thePointerColor;
	}
	else if (theAction == 'click' && theMarkColor != '') {
	    newColor              = theMarkColor;
	    marked_row[theRowNum] = true;
	}
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
	     && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
	if (theAction == 'out') {
	    newColor              = theDefaultColor;
	}
	else if (theAction == 'click' && theMarkColor != '') {
	    newColor              = theMarkColor;
	    marked_row[theRowNum] = true;
	}
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
	if (theAction == 'click') {
	    newColor              = (thePointerColor != '')
				  ? thePointerColor
				  : theDefaultColor;
	    marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
				  ? true
				  : null;
	}
    } 
    if (newColor) {
	var c = null;

	if (domDetect) {
	    for (c = 0; c < rowCellsCnt; c++) {
		theCells[c].setAttribute('bgcolor', newColor, 0);
	    } 
	}
	else {
	    for (c = 0; c < rowCellsCnt; c++) {
		theCells[c].style.backgroundColor = newColor;
	    }
	}
    } 

    return true;
} 

function setP_2(theRow, theAction, theDefaultColor, theID, hasIMG)
{
    
    
    var theCells = null;
    var thePointerColor ='#5C8BAD';
    var theMarkColor ='#FFCC99';
    var theRowNum = 1;
    
    var carDiv,carDiv2,carImg;
    var y,x,e;

   //status = 'X:';
   
  x = event.x+document.body.scrollLeft;
  y  = event.y+document.body.scrollTop;


    carDiv = document.getElementById('carthumbDiv');
    carImg = document.getElementById('carthumbImg');
    carDiv2 = document.getElementById('carthumbDiv2');
  
    carDiv.style.top = y - 75;
    
    if ( y - 75< 550) { 
   	 carDiv.style.top = 550;
   	 y = 550+ 75;
    }else{
    	 carDiv.style.top = y - 75;
    	 
    }
    
    carDiv.style.left = 0;
    carDiv2.innerHTML ="";
   // carDiv.style.top = findPosY(document.getElementById('row'+i)) + Yoffset + 'p
    
		
			
    if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined') {
	return false;
	 
    }

    if (typeof(document.getElementsByTagName) != 'undefined') {
	theCells = theRow.getElementsByTagName('td');
	
    }else if (typeof(theRow.cells) != 'undefined') {
	theCells = theRow.cells;
	
    }else {

	return false;
    }
    

	
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
     if (typeof(window.opera) == 'undefined'
	&& typeof(theCells[0].getAttribute) != 'undefined') {
	currentColor = theCells[0].getAttribute('bgcolor');
	domDetect    = true;
    }
    else {
	currentColor = theCells[0].style.backgroundColor;
	domDetect    = false;
    } 

    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
	if (theAction == 'over' && thePointerColor != '') {
	    newColor              = thePointerColor;
	    
	    if (hasIMG == 1){
	    	carImg.src = "/west/images/225x175/"+theID+"f.jpg";
	    }else{
	    	 carImg.src = "/images_hp/nopicture_bg.jpg";
	    	 carDiv.style.top = y- 75;
	    	// carDiv2.innerHTML ="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face='verdana' >NO PICTURE</font>";
	    }
	}
	else if (theAction == 'click' && theMarkColor != '') {
	    newColor              = theMarkColor;
	    marked_row[theRowNum] = true;
	}
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
	     && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
	if (theAction == 'out') {
	    newColor              = theDefaultColor;
	    carImg.src = "/images/blank.gif";
	    carDiv.style.top = 5000;

	}
	else if (theAction == 'click' && theMarkColor != '') {
	    newColor              = theMarkColor;
	    marked_row[theRowNum] = true;
	}
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
	if (theAction == 'click') {
	    newColor              = (thePointerColor != '')
				  ? thePointerColor
				  : theDefaultColor;
	    marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
				  ? true
				  : null;
	}
    } 
    if (newColor) {
	var c = null;

	if (domDetect) {
	    for (c = 0; c < rowCellsCnt; c++) {
		theCells[c].setAttribute('bgcolor', newColor, 0);
	    } 
	}
	else {
	    for (c = 0; c < rowCellsCnt; c++) {
		theCells[c].style.backgroundColor = newColor;
	    }
	}
    } 

    return true;
} 


//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)



