var forrid = getCookie("forrid");
function Mp3Pop (audioID) {
	if (forrid == "" || forrid == null) {
		var re = new RegExp("(http://[^/]*/)");
		var matches = re.exec(window.location);
		window.location = matches[1] + "vvlogin?referer=" + location.href;
	} else {
		url = "http://www.cramereventmedia.com/videoviews/mp3Download.aspx?videoViewID=" + audioID;
		newWindow = window.open (url,"mp3Popup","width=400,height=200,status=no,resize=no,directories=no,menubar=no,toolbar=no,location=no,scrollbars=auto");	
		newWindow.focus();
	}
}

function AVMediaPop (videoID) {
	if (forrid == "" || forrid == null) {
		var re = new RegExp("(http://[^/]*/)");
		var matches = re.exec(window.location);
		window.location = matches[1] + "vvlogin?referer=" + location.href;
	} else {
		url = "http://www.cramereventmedia.com/custom/forrester01.asp?webcastID=" + videoID;
		newWindow = window.open (url,"AVMediaPopup","width=748,height=546,status=no,resize=no,directories=no,menubar=no,toolbar=no,location=no,scrollbars=auto");	
		newWindow.focus();
	}
}

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));
}

