
// Shared generic scripts

	function jumpTo(sel) {
		location.href=sel.options[sel.selectedIndex].value;
		return false;
	}
	
	// open link in new window (XHTML compliant)
	function externalLinks() {
		if (!document.getElementsByTagName) return;
	 	var anchors = document.getElementsByTagName("a");
	 	for (var i=0; i<anchors.length; i++) {
	   	var anchor = anchors[i];
	   	if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
	   		anchor.target = "_blank";
	 	}
	 	anchor.title += " This link will open in a new window.";
	}
	window.onload = externalLinks;
	
	var popupWindow = null;
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  if((popupWindow == null ) || popupWindow.closed) {
	   popupWindow = open(theURL,winName,features);
	   popupWindow.focus();
	  } else {
	   // popupWindow is open somewhere
	   popupWindow.location = theURL;
	   popupWindow.focus();   
	  }
	}
	
	
	// togglehide
	function xtoggle(targetId, selectID1){
	  if (document.getElementById){
	  		
			var target = document.getElementById( targetId );
			var selectBox1 = document.getElementById( selectID1 );	
				
			if (target.style.display == "none"){
  				target.style.display = "";

			} else {
  				target.style.display = "none";
				
  			}
			
			if (selectBox1 != null) {
				if (selectBox1.style.visibility == "hidden"){
  					selectBox1.style.visibility = "visible";
				} else { 
					selectBox1.style.visibility = "hidden"; 
				}
			}
			
	  	}
		return false;
	}

//clear add-ons 

function clearAddOns(paramNoThanks, paramBoxes) {
	
	var noThanks = paramNoThanks 
	var boxes = paramBoxes 
	//var labels = document.getElementsByName("addOnLabel")
	var n = boxes.length;
				
	for (var i=0; i<n; i++) {
		if (noThanks.checked) {
			boxes[i].checked=false;
			boxes[i].disabled=true;
		   //labels[i].style.color='#CCCCCC';
		} else {
			boxes[i].disabled=false;
			//labels[i].style.color='#000000';
		}
	}
}

var popup;
function showPopup(theURL,width,height) 
{
	if((width==0)||(height==0))
	{
		showPopup(theURL,450,350);
	}
	else
	{
		if ( ( popup == null ) || popup.closed ) 
		{
				popup = open( theURL, 'popupWindow', 'scrollbars=auto,width='+width+',height='+height+'' );
				popup.moveTo((screen.width-width)/2,(screen.height-height)/3);
				popup.focus();
		}
		else  
		{
				// popup is open somewhere
				popup.location = theURL;
				popup.resizeTo(width,height);
				popup.moveTo((screen.width-width)/2,(screen.height-height)/3);
				popup.focus();
		}
	}
}
	
	
