/* Fix IE6/7 ActiveX activation */
function ieFlash(path, fwidth, fheight, nojs) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ fwidth +'" height="' + fheight +'">');
	document.write('<param name="movie" value="'+ path +'" />');
	document.write('<param name="wmode" value="transparent" />');
	// This embed tag fixes the IE problems with preloaders (use the compliant version if not needed)
	document.write('<![CDATA[<embed src="'+ path +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ fwidth +'" height="'+ fheight +'"></embed>]]>');
	document.write(nojs);
	document.write('</object>');
}

// NewWindow popup functionality
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// Redirects the parent window from a popup
function parentOpen(url, close) {
	if (close == 'yes') {
		window.opener.location = url; window.close();
	} else {
		window.opener.location = url;
	}
}

function blankwin(mypage, myname) {
	var winprops = 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

/* Hides div or displays div with id of myname */
function hideDiv(myname, hide, option, inputItem) {
              
    var divelement = document.getElementById(myname);
    if(hide == false) {
        divelement.className = "";
    }
    else {
        divelement.className = "alt";
    }
    
    if(option) {                
        if(inputItem.checked == true) {
            divelement = document.getElementById(option);
            divelement.className = "";            
        }
    }
}       

/* Toggles an element between being displayed and hidden */
function toggleElement(myname) {
    var divelement = document.getElementById(myname);
    if(divelement.className == "alt") {
        divelement.className = "";
    }
    else {
        divelement.className = "alt";
    }
  }

/* toggles the "other" box if "Other" is/is not selected */
function toggleOtherBox(el, myname) {
  if (el.options[el.selectedIndex].value == "Other") {
    var divelement = document.getElementById(myname);
    divelement.className = "";
  }
  else {
    var divelement = document.getElementById(myname);
    divelement.className = "alt";
  }
}
