function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

function expandState(){
	var box = document.getElementById('stateOptions');
	box.className="clipOff";
}
function collapseState(){
	var box = document.getElementById('stateOptions');
	box.className="clip";
}
function expandCState(id){
	var box = document.getElementById(id);
	box.className="clipOff";
}
function collapseCState(id){
	var box = document.getElementById(id);
	box.className="clip";
}

//image swapping functions
function swapMainPhoto(id,img){
	var holder = document.getElementById('mainPhoto');
	holder.src='http://amsvehicleimages.wheelchair-accessible-vans.com/(192,144)'+img;
}
function swapDivPhoto(id,img){
	var holder = document.getElementById('divPhoto');
	holder.src='http://amsvehicleimages.wheelchair-accessible-vans.com/(278,208)'+img;
}
function addToFavorites(url,page){ 
	if (window.sidebar) {
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(page, url,"");
	} else if( window.external ) { 
		// IE Favorite
		window.external.AddFavorite( url, page);
	}	else if(window.opera && window.print) { 
		// Opera Hotlist
		return true; 
	}
}

function fncCenteredChildWindow(URL,vHeight,vWidth,vScroll,vStatus) {
	if (screen.width) {
		var winl=(screen.width-vWidth)/2;
		var wint=(screen.height-vHeight)/2;
	} else { 
		winl=0;wint=0;
	}
	if(winl<0)winl=0;
	if(wint<0)wint=0;
	var child = window.open(URL,'myWin','height='+vHeight+',width='+vWidth+',scrollbars='+vScroll+',status='+vStatus+',top='+wint+',left='+winl+',resizable=no');
	child.focus();
}
function getStyleClass (className) {
	for (var s = 0; s < document.styleSheets.length; s++){
		if(document.styleSheets[s].rules){
			for (var r = 0; r < document.styleSheets[s].rules.length; r++){
				if (document.styleSheets[s].rules[r].selectorText == '.' + className){
					return document.styleSheets[s].rules[r];
				}
			}
		}else if(document.styleSheets[s].cssRules){
			for (var r = 0; r < document.styleSheets[s].cssRules.length; r++){
				if (document.styleSheets[s].cssRules[r].selectorText == '.' + className){
                    return document.styleSheets[s].cssRules[r];
                }
			}
		}
	}
	
	return null;
}

function switchListStyles(which){
    var listClass = getStyleClass('listView');
    var detailClass = getStyleClass('detailView');
    
    if(which == 'list'){
        listClass.style.display='';
        detailClass.style.display='none';
    }else{
        listClass.style.display='none';
        detailClass.style.display='';
    }
}