﻿/*collapse expand single item
by Leo Charre & Jesse Fergusson
Internet Connection  2004 2005 ©
www.internetconnection.net
*/
//lang=<%=lang%>;
imgout=new Image(9,9);
imgin=new Image(9,9);

	imgout.src="/_design/images/"+lang+"/dev/arrow_expand.gif";
	imgin.src="/_design/images/"+lang+"/dev/arrow_collapse.gif";

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

// Zip Code

function clearZip(el) {
  if (el.defaultValue==el.value) el.value = "";
}
function fillZip(el) {
  if (el.value=="") el.value = "Zip Code";
}


// Dropdown Navigation Where Only Some Links Open New Windows
function parseNavigation(ob) {
// created by joe crawford october 2002
// http://artlung.com/lab/scripting/dropdown-only-some-new-window/
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

	if (targetWindow!=='') {
	// if a new Window name is specified, then it will
	// open in a new Window.
	window.open(targetURL,targetWindow,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=600');
	// if we open a new window, then we have to re-set
	// the select box to the first option
	// which should have no value
	ob.selectedIndex = 0;
		} else {
	// or else it will open in the current window		
	window.open(targetURL,'_top')
	}
}
