function initpage() {
	var flashobj = returnObjById('flashcontent');
	flashobj.style.visibility = "visible";
}

function changeMainPic(pic) {
	var carpics = returnObjById('carpics');
	pic2load = "url('phpthumb/phpThumb.php?src=../"+pic+"&w=340&q=100')";
	carpics.style.backgroundImage = pic2load;
}

function changeCarPage(list, url) {
	model = list.value;
	//var sel = list.selectedIndex;
	//var model = list.options[sel].text;
	//model = model.toLowerCase();
	if (model != '0') {
		document.location.href = url+"&model="+model;
	}
}

function getTopPos(inputObj)
   {      
	var returnValue = inputObj.offsetTop;
     while((inputObj = inputObj.offsetParent) != null){
        if(inputObj.tagName!='HTML'){
           returnValue += (inputObj.offsetTop - inputObj.scrollTop);
           if(document.all)returnValue+=inputObj.clientTop;
        }
     }
     return returnValue;
   } 



function jumpToAnchor(anchor_name){
	var anchor_node = document.getElementById(anchor_name);
	var anchor_pos = getTopPos(anchor_node);
	alert(anchor_pos);
	//window.scrollTo(0, anchor_pos);
	//window.location.hash="car"+carid; 
}

function testJS(){
	alert("Reached!!");	
}

