//SWAP IMAGE
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function swapImage() {
	strImage = (arguments[1]=='on')?'style/images/leftmenu_r.gif':'style/images/leftmenu.gif';
	MM_swapImage(arguments[0],'',strImage,1)
}

function MM_homeMenu(targ,selObj,restore){ //v3.0
	if (selObj.selectedIndex == 4 || selObj.selectedIndex == 0 ) {
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		}
		else {
			window.open(selObj.options[selObj.selectedIndex].value,'new')
		}
  if (restore) selObj.selectedIndex=0;
	return false;
}



// Exit disclaimer
var popupWidth;
var popupHeight;

// check type size
function textSizeDetect() {
	var intTextSize = (document.layers)?document.layers["textsizedetect"]:(document.all)?document.all["textsizedetect"]:(document.getElementById)?document.getElementById("textsizedetect"):"";

	if (intTextSize) {
		 intTextSize = intTextSize.offsetHeight
	}
	if (intTextSize>14){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=240;
	} else if (intTextSize>12){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=220;
	} else{
		popupWidth=220;
		popupHeight=200;
	
	}
}


// get all links with the class name disclaimer and add to them
// an onclick event going to the disclaimer, and an onKeyPress event 
// going to the onClick event
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("disclaimer")) {
      links[i].onclick = function() {
		textSizeDetect()
		window.open(this.href,'disclaimer','width='+popupWidth+',height='+popupHeight+',scrollbars=auto,resizable');
        return false;
      }
	  links[i].onkeypress = function(){
	  	verifyKey(this,'this.onclick();');
	  }
    }
  }
}
// Called in on index.asp
// window.onload = doPopups;




// Accessible popup window
var _POPUP_TARGET = '_blank';
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=750,height=570';

function raw_popup(url, target, features)
{
 if (features) {
  theFeatures = features;
 } else {
  theFeatures = _POPUP_FEATURES;
 }
 if (target) {
  theTarget = target
 } else {
  theTarget = _POPUP_TARGET;
 }
  var theWindow = window.open(url, theTarget, theFeatures);
  theWindow.focus();
  return theWindow;
}

function link_popup(src, target, features) {
  return raw_popup(src, target, features);
}

// the disclaimer popup code
function externalsite(){
  var disclaimerWindow = window.open('managed_content/components/disclaimer.htm','_blank','scrollbars=yes,width=223,height=268')
  disclaimerWindow.focus();
  return disclaimerWindow;
}
function link_popup_disclaimer(src, target, features) {
  var disclaimerWindow = window.open('managed_content/components/disclaimer.htm','_blank','scrollbars=yes,width=223,height=268')
  return raw_popup(src, target, features);
}

//SWAP IMAGE
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function swapImage() {
	strImage = (arguments[1]=='on')?'style/images/leftmenu_r.gif':'style/images/leftmenu.gif';
	MM_swapImage(arguments[0],'',strImage,1)
}

// jump menu for the drop downs
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}


function launchBulletin(issue) {
	if (issue) {
		strQueryString = "?issue=" + issue
	}else{
		strQueryString = ""
	}
	window.open("files/bulletin/index.asp" + strQueryString);
	//link_popup('files/bulletin/index.asp' + strQueryString,'irsbulletin','width=775px,height=518px,toolbar=yes,scrollbars=yes')
}

function checkServiceProvidersForm(form) {
	objSelect = document.getElementById(form)
	if (objSelect.selectedIndex==0) {
		strField = (form=="service")?"service":"company";
		alert("Please select a " + strField)
		return false;
	}
}

<!--- THE FOLLOWING SCRIPT IS REQUIRED FOR THE CONSOLE ON EVENT PRESENTATIONS-->

function isAttendee(eventID) {
	return (document.cookie.indexOf('attendee' + eventID + '=true') > -1)
}

function setAttendee(eventID) {
	document.cookie = 'attendee' + eventID + '=true'
}

function getConsoleURL(eventID, playerID, urlID, aSize, baseURL, aBrand, altSize) {
	if (!altSize) { altSize = aSize }
	if (!aBrand) { aBrand = 'Vcall' }
	if (isAttendee(eventID)) {
		if (aBrand == 'PCS') {
			window.open('http://www.vcall.com//console/PCS/ConsoleFrameset.asp?brand=' + aBrand + '&ClickType=listen&ID=' + eventID + '&playerID=' + playerID + '&urlID=' + urlID, 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + altSize)
		} else if (aBrand == 'PCSWOD') {
			window.open('http://www.vcall.com//console/PCS/ConsoleFramesetd.asp?brand=' + aBrand + '&ClickType=listen&ID=' + eventID + '&playerID=' + playerID + '&urlID=' + urlID, 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + altSize)
		} else {
			window.open('http://www.vcall.com//console/ConsoleFrameset.asp?brand=' + aBrand + '&ClickType=listen&ID=' + eventID + '&playerID=' + playerID + '&urlID=' + urlID, 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + altSize)
		}
		return false
	} else {
		if (baseURL) {
			window.open(baseURL, 'RealAudioConsole', 'status,resizable=no,' + aSize)
			return false
		} else {
			window.open('http://secure.wilink.com/blank.html', 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + aSize)
			return true
		}
	}
}

function getConsoleURL2(eventID, picURL, picSize, consoleURL, consoleSize) {
	if (!consoleSize) { consoleSize = picSize }
	if (isAttendee(eventID)) {
		window.open(consoleURL, 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + consoleSize)
		return false
	} else {
		if (picURL) {
			window.open(picURL, 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + picSize)
			return false
		} else {
			window.open('http://secure.wilink.com/blank.html', 'RealAudioConsole', 'status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no,' + picSize)
			return true
		}
	}
}

function quicklinks(){
 sel = document.quickdo.menu.selectedIndex;
 use = document.quickdo.menu[sel].value;
 if(use != "nochange"){location.replace(use);}
}

/*opens links in a new window*/
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";
		if (anchor.getAttribute("rel") == "external") {
			var strTitle = anchor.getAttribute("title")
			if (strTitle == "" || strTitle == null) {
				anchor.title = "Opens in a new browser window";} 
			else { // if (strTitle != null || strTitle != ""){
				anchor.title = strTitle +" - Opens in a new browser window";
				}
		}
    }
}

window.onload = externalLinks;