//Use this as the starting point for all rollover scripts.
//Make sure to include the trailing slash in the URL, even if it's the top-level domain.
//
//var baseURL = "http://www.rigneygraphics.com/clients/lanadil/website/";
var baseURL = "http://www.lanadil.com/dev";

//Navigation Rollover Images
//Providing the file type is optional, defaults to .GIF.
//Be sure to exclude the dot.
//
function switchNav(target_img, highlight, ext){
	var root_dir = "images/nav/";
	target_src = document.getElementById(target_img);
	if(!ext){
		ext = "gif";
	}	
	
	target_src.src = root_dir + target_img + highlight + "." + ext;
}

//Footer and 'Feature' Rollover Images
//Functions the same as above, but pulls images from separate folder.
//
function swapFeature(target_img, highlight, ext){
	root_dir = "images/features/";
	target_src = document.getElementById(target_img);
	if(!ext){
		ext = "gif";
	}	
	
	target_src.src = root_dir + target_img + highlight + "." + ext;
}

//'Button' Rollover Images
//Functions the same as above two items, but pulls images from yet another separate folder.
//
function swapButton(target_img, highlight, ext){
	root_dir = "images/buttons/";
	target_src = document.getElementById(target_img);
	if(!ext){
		ext = "gif";
	}	
	
	target_src.src = root_dir + target_img + highlight + "." + ext;
}

//Footer Toggle Feature
//The footer is composed of three div tags. This code toggles between them.
//
function swapFeaturesDiv(id) {
	divId = "textFeature"+id;
	document.getElementById(divId).style.display='block';
	for (i=1; document.getElementById("textFeature"+i); i++) {
		setId = "textFeature"+i;
		if (i != id) {
			document.getElementById(setId).style.display='none';
		}
	}
}

//Popular Questions Rollover Code
//
function toggleTip(id) {
	divId = "tooltip"+id;
	if(document.getElementById(divId).style.display == "block"){
		document.getElementById(divId).style.display = 'none';
	}

	else{
		document.getElementById(divId).style.display='block';
		for (i=1; document.getElementById("tooltip"+i); i++) {
			setId = "tooltip"+i;
			if (i != id) {
				document.getElementById(setId).style.display='none';
			}
		}
	}
}

//Bookmark Generation Code
//If functionality is not supported, generates popup window.
//Instructions follow to guide visitor to manually create bookmark.
//
function addBookmark(title,url) {
	if(window.sidebar) { window.sidebar.addPanel(title, url,""); }
	else if(document.all) { window.external.AddFavorite( url, title); }
	else { return true; }
}