var windowW = 500;
var windowH = 700;
var windowX = 0;
var windowY = 0;
var urlPop = "/help/feedback.htm";
var title =  "This Is A Frameless Popup Window";
var autoclose = true;
var s = "resizable,width="+windowW+",height="+windowH;

function openFrameless(urlPop,w,h){
	var s = "resizable,width="+w+",height="+h;
	NFW=window.open(urlPop,"popFrameless","scrollbars,"+s);
//	NFW.blur()
//	window.focus();
	NFW.resizeTo(w,h);
//	NFW.moveTo(windowX,windowY)
	NFW.focus();
	if (autoclose){
		window.onunload = function(){NFW.close();}
	}
}

function getObj(name) { 
    if (document.getElementById) {
      return document.getElementById(name);
    }
    else if (document.all) {
      return document.all[name]; 	 
    }
    else if (document.layers) {
      return document.layers[name];
    }
}

function txtHide(idstr) {
    var divItem = getObj(idstr);
      divItem.style.display = "none";
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


// BEGIN CBH ADD rollovers.js 9.25.2005

var oldSrc;

function preloadimages() {
	/*
	pre-load a highlighted version 
	of each "nav_" image
	*/
	var num = document.images.length;
	var img,posn,temp,orig,newsrc;
	var preload = new Array();
	for(var i = 0; i<num; i++) {
		img = document.images[i].src;
		posn = img.indexOf("nav_");
		if(posn > -1 && img.indexOf("_over")< 0){
			dot = img.lastIndexOf(".");
			temp = img.substr(dot,img.length);
			orig = img.substr(0,dot);
			newsrc = orig + "_over" + temp;
			preload[i] = new Image();
			preload[i].src = newsrc;
		}//if
	}//for
 }

function getSrc(n){
    img = n.toString();
         eval("n = document." + img + ".src");
         if(n.indexOf("_over")< 0){
                 dot = n.lastIndexOf(".");
                 temp = n.substr(dot,n.length).toString();
                 orig = n.substr(0,dot).toString();
                 newsrc = orig + "_over" + temp;
                 newsrc = newsrc.toString();
         return newsrc;
         }
        else{return n;}
 }

function swap(imgname) {
       n = arguments[0].toString();
                  eval("oldSrc = document." + n + ".src");
                  old = n;
                  eval("document." + n + ".src=getSrc('" + imgname + "')");
 }

function restore(){
      eval("document." + img + ".src=oldSrc");

 }
 
// END CBH ADD rollovers.js 9.25.2005

function doLogoutButton() {
if (document.URL.indexOf('#printer_friendly') == -1) {
 if (getCookie('IISPROTECTLOGIN')) document.write ('<a href="/login/logout.asp?page=' + document.location +  '" onmouseover=\"swap(\'logout\');\" onmouseout="restore();"><img name="logout" border="0" src="/inc/img/nav_logout.gif" width="69" height="18" alt="Logout"></a>');
}
}

function doFeedbackButton() {
if (document.URL.indexOf('#printer_friendly') == -1) {
// document.write ('<a href="javascript:openFrameless(' + '\'/help/feedback.cfm?pageref=' + location.href + '\',500,580)" onmouseover=\"swap(\'feedback\');\" onmouseout="restore();"><img name="feedback" src="/inc/img/nav_feedback.gif" border="0" width="77" height="18" alt="Feedback"></a>');
 document.write ('<a href="javascript:openFrameless(' + '\'http://www.iabc.com/help/feedback.cfm?pageref=' + location.href + '\',500,580)" onmouseover=\"swap(\'feedback\');\" onmouseout="restore();"><img name="feedback" src="http://www.iabc.com/inc/img/nav_feedback.gif" border="0" width="77" height="18" alt="Feedback"></a>');

}
}

function doPrinterButton() {
if (document.URL.indexOf('#printer_friendly') == -1) {
 document.write ('<a href="#printer_friendly" target="_blank" onmouseover=\"swap(\'printer\');\" onmouseout="restore();"><img name="printer" src="/inc/img/nav_printer.gif" border="0" width="111" height="18" alt="Printer-friendly"></a>');
}
else
{
 document.write ('<p><a href="javascript:window.close();">close window</a></p><hr>');
}
}


function doPF() {
	// Modified 19 May 2008 by TD to disable all stylesheets except iabc_printable.css for printer-friendly pages
	if(document.styleSheets) {
		var thesht = document.getElementById('prncss');
		if (document.URL.indexOf('#printer_friendly') != -1) {
			var styles = document.getElementsByTagName('link');
			for (i = 0; i < styles.length; i++) {
				if (styles[i].id != "prncss") {
					styles[i].disabled = true;
				}
				else {
					styles[i].disabled = false;
				}
			}
			// thesht.disabled=false;
			if (window.print) {
				window.print();
			}
		}
		else {
		thesht.disabled=true;
		}
	}
}

function writeEmailAddress(a_mail_name,a_mail_domain){
	document.write("<a href='mailto:" + a_mail_name + "@" + a_mail_domain + "'>" + a_mail_name + "@" + a_mail_domain + "</a>"); 	
}

//	12/19/2006 - Added vars for site wide footer date M.N.
var currentTime = new Date();
var year = currentTime.getFullYear();

// 7/31/2008 - TD - Added delicious mp3 player controls.
if(typeof(Delicious) == 'undefined') Delicious = {}
Delicious.Mp3 = {
	playimg: null,
	player: null,
	go: function() {
		var all = document.getElementsByTagName('a')
		for (var i = 0, o; o = all[i]; i++) {
			if(o.href.match(/\.mp3$/i)) {
				var img = document.createElement('img')
				img.src = 'http://static.delicious.com/img/play.gif'; img.title = 'listen'
				img.height = img.width = 12
				img.style.border = 'none'
				img.style.marginRight = '4px'
				img.style.cursor = 'pointer'
				img.onclick = Delicious.Mp3.makeToggle(img, o.href)
				o.parentNode.insertBefore(img, o)
	}}},
	toggle: function(img, url) {
		if (Delicious.Mp3.playimg == img) Delicious.Mp3.destroy()
		else {
			if (Delicious.Mp3.playimg) Delicious.Mp3.destroy()
			var a = img.nextSibling, c=''
			if (document.defaultView && document.defaultView.getComputedStyle) c = document.defaultView.getComputedStyle(a,null).getPropertyValue('color')
			else if (a.currentStyle) c = a.currentStyle['color']
			c = c.replace(/^rgb|[ ()]/g, '')
			var hex = c.match(/^#?([a-f0-9]{6})$/), hexSm = c.match(/^#?([a-f0-9]{3})$/), rgb = c.match(/^([0-9]+),([0-9]+),([0-9]+)$/)
			if (rgb) { var c16 = "0123456789abcdef", c=''; for(var i=1,d;d=rgb[i];i++) { var j=d%16; c=c+c16.charAt((d-j)/16)+c16.charAt(j) } }
			else if (hex) c = hex[1]
			else if (hexSm) c = hexSm[1].charAt(0) + hexSm[1].charAt(0) + hexSm[1].charAt(1) + hexSm[1].charAt(1) + hexSm[1].charAt(2) + hexSm[1].charAt(2)
			else c = "000000"
			img.src = 'http://static.delicious.com/img/stop.gif'; Delicious.Mp3.playimg = img;
			Delicious.Mp3.player = document.createElement('span')
			Delicious.Mp3.player.innerHTML = '<object style="vertical-align:bottom;margin-right:0.2em" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' +
			'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
			'width="100" height="14" id="player" align="middle">' +
			'<param name="wmode" value="transparent" />' +
			'<param name="allowScriptAccess" value="sameDomain" />' +
			'<param name="flashVars" value="theLink='+url+'&amp;fontColor='+c+'" />' +
			'<param name="movie" value="http://static.delicious.com/swf/playtagger.swf" /><param name="quality" value="high" />' +
			'<embed style="vertical-align:bottom;margin-right:0.2em" src="http://static.delicious.com/swf/playtagger.swf" flashVars="theLink='+url+'&amp;fontColor='+c+'"'+
			'quality="high" wmode="transparent" width="100" height="14" name="player"' +
			'align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"' +
			' pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'
			img.parentNode.insertBefore(Delicious.Mp3.player, img.nextSibling)
	}},
	destroy: function() {
		Delicious.Mp3.playimg.src = 'http://static.delicious.com/img/play.gif'; Delicious.Mp3.playimg = null
		Delicious.Mp3.player.removeChild(Delicious.Mp3.player.firstChild); Delicious.Mp3.player.parentNode.removeChild(Delicious.Mp3.player); Delicious.Mp3.player = null
	},
	makeToggle: function(img, url) { return function(){ Delicious.Mp3.toggle(img, url) }}
}

Delicious.addLoadEvent = function(f) { var old = window.onload
	if (typeof old != 'function') window.onload = f
	else { window.onload = function() { old(); f() }}
}

Delicious.addLoadEvent(Delicious.Mp3.go)
// END delicious mp3 player controls.
