var FlashMode=(document.all ? 1 : 0);

// NETSCAPE
if (navigator.plugins && navigator.plugins.length > 0)
    {
	if (navigator.plugins["Shockwave Flash"])
	    {
		var plugin_version = 0;
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");

		for (var i = 0; i < words.length; ++i)
		    {
			if (isNaN(parseInt(words[i])))
			    continue;
			plugin_version = words[i];
		    }
		if (plugin_version >= 6)
		    {
			var plugin = navigator.plugins["Shockwave Flash"];
			var numTypes = plugin.length;
			for (j = 0; j < numTypes; j++)
			    {
				mimetype = plugin[j];
				if (mimetype)
				    {
					if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1))
					    FlashMode = 1;
					// Mac wierdness
					if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
					    FlashMode = 0;
				    }
			    }
		    }
	    }
    }
do_dw_var = FlashMode;
browser_flash_version = plugin_version;

function LoadFlash(elementId, url, w, h, bgcolor, wmode) {
    var e = document.getElementById(elementId);
    if (FlashMode) {
	e.innerHTML = 
	    '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'" align="middle">'+
	    '<param name="allowScriptAccess" value="sameDomain" />'+
	    '<param name="movie" value="'+url+'" />'+
	    '<param name="quality" value="high" />'+
	    '<param name="bgcolor" value="#ffffff" />'+
	    '<param name="wmode" value="transparent" />'+
	    '<embed src="'+url+'" wmode="transparent" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />'+
	    '</object>';
    } else {

    }
}

function LoadHead(elementId, url, w, h, bgcolor, wmode) {
    if (elementId == 'wthvideo') {
	if (getInsightCookie('wthvideo')) return;
	setInsightCookie('wthvideo', 1);
    }

    var e = document.getElementById(elementId);
    if (FlashMode) {
	e.innerHTML = 
	    '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'" align="middle">'+
	    '<param name="allowScriptAccess" value="sameDomain" />'+
	    '<param name="movie" value="'+url+'" />'+
	    '<param name="quality" value="high" />'+
	    '<param name="bgcolor" value="#ffffff" />'+
	    '<param name="wmode" value="transparent" />'+
	    '<embed src="'+url+'" wmode="transparent" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />'+
	    '</object>';
    } else {

    }
}


function LoadCs(elementId, url, w, h, bgcolor, wmode) {
    return LoadFlash(elementId, url, w, h, bgcolor, wmode);
}



function displayHide(id) {
    var objStyle=document.getElementById(id).style;
    objStyle.display=(objStyle.display=='none' ? 'block' : 'none');
}


function toCenter(el) {                                                                                                  	
			
    //var bl = null // $("blackOut");
			
    el.style.display = 'block';
    //bl.style.display = 'block';

    el.style.position = "absolute";
			
    if (window.innerWidth) {
	var screenMaxW = window.innerWidth;
	var screenMaxH = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientWidth) {
	var screenMaxH = document.documentElement.clientHeight;
	var screenMaxW = document.documentElement.clientWidth;
    } else if (document.body) {
	var screenMaxW = document.body.clientWidth;
	var screenMaxH = document.body.clientHeight;
    }
    var x = (screenMaxW - el.clientWidth)/2;
    var y = (screenMaxH - el.clientHeight)/2;


    if (document.all) {	
	iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
	y = y + iebody.scrollTop;
	bl.style.height = iebody.scrollWidth;

    } else {
	// el.style.position = "fixed";
	//bl.style.position = "fixed";
    }

    //el.style.left = x + 'px';
    //_a.effect(el).show();
    //el.style.top = "-600px"; /*y + 'px';*/
			
    //if (_a.browser.msie) {
				
    /*$(bl).fadeIn("slow");
      $(el).animate({"top":y}, "slow", "swing");*/
    //} else {
    /*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
    //}
    /*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
    //_a.effect(el).animate({"top":y}, "slow", "swing");
}

function hideDiv() { document.getElementById('wthvideo').style.visibility = 'hidden'; }

/**
 * 
 *
 * @access Public
 * @param string name
 * @param string value
 * @param string expiration in seconds relative to the current time
 * @param string path
 * @param string domain
 * @param bool secure
 * @return void
 */
function setInsightCookie(name, value) {
    name='insight_'+name;
    var expiration=3600 * 24 * 30;
    var path='/';
    var domain=document.location.host.replace(/^www.?\./, '');
    var secure=false;

    var expirationDate;
    if (expiration) {
	expirationDate=new Date();
	expirationDate.setTime (expirationDate.getTime() + expiration);
    } 
    document.cookie = name + "=" + escape (value) + ((expirationDate) ? "; expires=" + expirationDate.toGMTString() : "") + (path ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}

/**
 * 
 *
 * @access private
 * @param int 
 * @param 
 * @param 
 * @return void
 */
function getInsightCookie(name) {
    name='insight_'+name;		
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
	    return _getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;
    }
    return null;
}

/**
 * 
 *
 * @access private
 * @param int 
 * @param 
 * @param 
 * @return void
 */
function _getCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
	endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}


 var lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "85476698",'lpProtocol' : "http"}; function
lpAddMonitorTag(src){if(typeof(src)=='undefined'||typeof(src)=='object'){src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';}if(src.indexOf('http')!=0){src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;}else{if(src.indexOf('site=')<0){if(src.indexOf('?')<0)src=src+'?'; else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;}};var
s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','iso-8859-1');s.setAttribute('src',src);document.getElementsByTagName('head').item(0).appendChild(s);} if (window.attachEvent) window.attachEvent('onload',lpAddMonitorTag); else window.addEventListener("load",lpAddMonitorTag,false);

if (typeof(lpMTagConfig.sessionVar) == "undefined"){ lpMTagConfig.sessionVar = new Array();}
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'operator=jmonaghan';
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'skill=ServiceCEO Marketing';
if (typeof(lpMTagConfig.visitorVar) == "undefined"){ lpMTagConfig.visitorVar = new Array();}
lpMTagConfig.visitorVar[lpMTagConfig.visitorVar.length] = 'Login name=<%=LOGIN NAME%>';



