	var g_omniture; 
	var isIOS =( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i) ) ? true : false;
	var isiPhone =( navigator.userAgent.match(/iPhone/i) ) ? true : false;
	var isiPad =( navigator.userAgent.match(/iPad/i) ) ? true : false;
	var isiPod =( navigator.userAgent.match(/iPod/i) ) ? true : false;
	var isChrome = ( navigator.userAgent.match(/Chrome/i) ) ? true : false;
	var isSafariMac = ( navigator.userAgent.match(/safari/i) && navigator.userAgent.match(/mac/i) )? true : false;
	var isSafariPC = ( navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/mac/i) )? true : false;
	var isSafari = ( navigator.userAgent.match(/safari/i) )? true : false;
	var isIE = ( navigator.userAgent.match(/MSIE/i) )? true : false;
	var isFF = ( navigator.userAgent.match(/firefox/i) )? true : false;
	var nodeData = "";
	var global_event_mode;
	var global_event_id;
	var evt = new Object();
	var t_o;    
	var t_o_norm = 30000;
	var t_o_accel = 6000;	
	var t_o_int = t_o_norm;
	
	
	function getEventData(pID,pDate){
			var pURL;
		pURL = "/USSub/Event/EventController.aspx?appid="+pID.toString()+"&date="+pDate+"&VNM="+varVersion+"&d="+new Date();
		$.ajax({
			type: "GET",
			url: pURL,
			dataType: "xml",
			contentType: "charset=utf-8",
			success: createEventObj,	
			error: function(e,xhr,opt){
				clearTimeout(t_o);
				t_o = setTimeout(function(){getEventData(pID,pDate)},t_o_accel);
				//alert(pURL + "\nError requesting " + opt.url + ": " + xhr.status + " " + xhr.statusText);
			}
		});
	}

	function createEventObj(xml){
		$(xml).find("eventdata").children().each(function(){
			nodeData = (this.childNodes[0]) ? escape(this.childNodes[0].nodeValue) : "";
			eval("evt." + this.nodeName.toLowerCase() + " = \"" + nodeData + "\"" );
			t_o_norm = isNaN(parseInt(evt.app_refresh_norm))?t_o_norm:parseInt(evt.app_refresh_norm);
			t_o_accel = isNaN(parseInt(evt.app_refresh_accel))?t_o_accel:parseInt(evt.app_refresh_accel);
			t_o_int = t_o_norm;
			
      //$("body").append(this.nodeName.toLowerCase() + ": <b>" + unescape(nodeData) + "</b><br />");
		});	
		configEVENT();
	}	
	function configEVENT(){alert('need to define configEVENT()');}
	function configPRE(){alert('need to define configPRE()');}
	function configPOST(){alert('need to define configPOST()');}
	function configLIVE(){alert('need to define configLIVE()');}
	function configDEF(){alert('need to define configDEF()');}
	
	function showTest(){
	// FOR TESTING //
		//$("div#ts").append("App ID: "+evt.app_id+"<br />"+global_event_mode+"<br />");
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	}

	// DATE FUNCTIONS
	//	Date(year, month, day, hours, minutes, seconds, milliseconds)
	//	getTime() - Number of milliseconds since 1/1/1970 @ 12:00 AM
	//	getSeconds() - Number of seconds (0-59)
	//	getMinutes() - Number of minutes (0-59)
	//	getHours() - Number of hours (0-23)
	//	getDay() - Day of the week(0-6). 0 = Sunday, ... , 6 = Saturday
	//	getDate() - Day of the month (0-31)
	//	getMonth() - Number of month (0-11)
	//	getFullYear() - The four digit year (1970-9999)
	//	getTimezoneOffset() - returns the time difference between Greenwich Mean Time (GMT) and local time, in minutes.

	function isDate(d) { 
	var dt = new Date(d)
		if(dt!="Invalid Date"){
			return true;
		}
		else{
			return false ;
		}
	}
	
	var dateFormat = function () {
		var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
			timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
			timezoneClip = /[^-+\dA-Z]/g,
			pad = function (val, len) {
				val = String(val);
				len = len || 2;
				while (val.length < len) val = "0" + val;
				return val;
			};	
		// Regexes and supporting functions are cached through closure
		return function (date, mask, utc) {
			var dF = dateFormat;	
			// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
			if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
				mask = date;
				date = undefined;
			}	
			// Passing date through Date applies Date.parse, if necessary
			date = date ? new Date(date) : new Date;
			if (isNaN(date)) throw SyntaxError("invalid date");
	
			mask = String(dF.masks[mask] || mask || dF.masks["default"]);	
			// Allow setting the utc argument via the mask
			if (mask.slice(0, 4) == "UTC:") {
				mask = mask.slice(4);
				utc = true;
			}
	
			var	_ = utc ? "getUTC" : "get",
				d = date[_ + "Date"](),
				D = date[_ + "Day"](),
				m = date[_ + "Month"](),
				y = date[_ + "FullYear"](),
				H = date[_ + "Hours"](),
				M = date[_ + "Minutes"](),
				s = date[_ + "Seconds"](),
				L = date[_ + "Milliseconds"](),
				o = utc ? 0 : date.getTimezoneOffset(),
				flags = {
					d:    d,
					dd:   pad(d),
					ddd:  dF.fmt.dayNames[D],
					dddd: dF.fmt.dayNames[D + 7],
					m:    m + 1,
					mm:   pad(m + 1),
					mmm:  dF.fmt.monthNames[m],
					mmmm: dF.fmt.monthNames[m + 12],
					yy:   String(y).slice(2),
					yyyy: y,
					h:    H % 12 || 12,
					hh:   pad(H % 12 || 12),
					H:    H,
					HH:   pad(H),
					M:    M,
					MM:   pad(M),
					s:    s,
					ss:   pad(s),
					l:    pad(L, 3),
					L:    pad(L > 99 ? Math.round(L / 10) : L),
					t:    H < 12 ? "a"  : "p",
					tt:   H < 12 ? "am" : "pm",
					T:    H < 12 ? "A"  : "P",
					TT:   H < 12 ? "AM" : "PM",
					Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
					o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
					S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
				};
	
			return mask.replace(token, function ($0) {
				return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
			});
		};
	}();
	
	// Some common format strings
	dateFormat.masks = {
		"default":      "ddd mmm dd yyyy HH:MM:ss",
		shortDate:      "m/d/yy",
		mediumDate:     "mmm d, yyyy",
		longDate:       "mmmm d, yyyy",
		fullDate:       "dddd, mmmm d, yyyy",
		shortTime:      "h:MM TT",
		mediumTime:     "h:MM:ss TT",
		longTime:       "h:MM:ss TT Z",
		isoDate:        "yyyy-mm-dd",
		isoTime:        "HH:MM:ss",
		isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
		isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
	};
	
	// Internationalization strings
	dateFormat.fmt = {
		dayNames: [
			"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
			"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
		],
		monthNames: [
			"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
			"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
		]
	};
	
	// For convenience...
	Date.prototype.format = function (mask, utc) {
		return dateFormat(this, mask, utc);
	};
	
	function trim(pStr)
	{
		var str = pStr + "";
		 return str.replace(/^\s*|\s*$/g,"");
	}
	
	function FlashBuilderInnerHTML(pSWF,pID,pName,pVersion,pWidth,pHeight,pScriptAccess,pQuality,pWmode,pBGColor,pFlashvars,pDivId){
		
        

		var vID,vName,vVersion,vWidth,vHeight,vScriptAccess,vSWF,vQuality,vWmode,vBGColor,vFlashvars;
		var pmName,pmVersion,pmScriptAccess,pmMovie,pmQuality,pmWmode,pmBGColor,pmFlashvars;
		var emID,emName,emScriptAccess,emSource,emQuality,emWmode,emBGColor,emFlashvars;
		var bParamsOK, cCodeBase, cClassID, cPluginspage, sOutput;
	
	// Check if SWF name passed...	
		bParamsOK = (pSWF!="") ? true : false;
		
	// Set constant values	...
		cClassID = "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
		cCodeBase = "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=";
		cPluginspage = "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" ";
		
	// Set Defaults if no values passed...
		vID = (trim(pID)!="") ? "id=\"" + pID + "\" " : "";
		vName = (trim(pName)!="") ? "name=\"" + pName + "\" " : "";
		vVersion = (trim(pVersion)!="") ? pVersion : "6,0,29,0";
		vWidth = (trim(pWidth)!="") ? "width=\"" + pWidth + "\" " : "width=\"100\" ";
		vHeight = (trim(pHeight)!="") ? "height=\"" + pHeight + "\" " : "height=\"100\" ";
		vScriptAccess = (trim(pScriptAccess)!="") ? pScriptAccess : "sameDomain";
		vQuality = (trim(pQuality)!="") ? pQuality : "high";
		vWmode = (trim(pWmode)!="") ? pWmode : "transparent";
		vBGColor = (trim(pBGColor)!="") ? pBGColor : "#ffffff";
	
	// Build <param> tag values for IE...
		pmScriptAccess = "<param name=\"allowscriptaccess\" value=\"" + vScriptAccess + "\"> ";
		pmWmode = "<param name=\"wmode\" value=\"" + vWmode + "\"> ";
		pmMovie = "<param name=\"movie\" value=\"" + pSWF + "\"> ";
		pmQuality = "<param name=\"quality\" value=\"" + vQuality + "\"> ";
		pmBGColor = "<param name=\"bgcolor\" value=\"" + vBGColor + "\"> ";
		pmFullScreen =  "<param name=\"allowFullScreen\" value=\"true\"> ";
		pmFlashvars = (trim(pFlashvars)!="") ? "<param name=\"flashvars\" value=\"" + pFlashvars + "\"> " : "" ;
	
	// Build <embed> tag name/value pairs for MAC / Netscape, etc...	
		emScriptAccess = "allowscriptaccess=\"" + vScriptAccess + "\" ";
		emWmode = "wmode=\"" + vWmode + "\" ";
		emSource = "src=\"" + pSWF + "\" ";
		emQuality = "quality=\"" + vQuality + "\" ";
		emBGColor = "bgcolor=\"" + vBGColor + "\" ";
		emFullScreen = "allowFullScreen=\"true\" ";
		emFlashvars = (trim(pFlashvars)!="") ? "flashvars=\"" + pFlashvars + "\" " : "" ;
	
	// Create document.write string...	
		sOutput = "";
		sOutput = "<object " + vID + vName + cClassID + cCodeBase + vVersion + "\" " + vWidth + vHeight + ">" ;
		sOutput = sOutput + pmScriptAccess + pmWmode + pmMovie + pmQuality + pmBGColor + pmFullScreen + pmFlashvars ;
		sOutput = sOutput + "<embed " + emSource + emScriptAccess + emWmode + emQuality + emBGColor + emFullScreen + emFlashvars ;
		sOutput = sOutput + cPluginspage + vWidth + vHeight + "</embed></object>" ;
		
		if(bParamsOK == true){
			//document.write(sOutput);
			var obj=document.getElementById(pDivId);
			if(obj && typeof obj == "object")
			{
				obj.innerHTML=sOutput;      
			}
			
			//alert(sOutput);
		}
		else{
			alert("Please specify the proper parameters for the Flash object...");
		}	
		
	}

function ImgChg(i,m,n){
	var img,obj,typ;
	if(typeof i =="object"){
		obj=i;
	}
	else{
		obj=document.getElementById(i);
	}
	typ = obj.src.substr(obj.src.length-3,3);
	if(n!=""){
		obj.src=n
	}
	else{
		img=obj.name+"_"+m+"."+typ;
		obj.src=strMainImagePath+img;
	}	
}

//Function Name 	: setCookie(name, value, expires, path, domain, secure)
//Purpose	    	: Sets Cookie
//Input Parameters	: name, value, expires, path, domain, secure
// 					name - name of the cookie
// 					value - value of the cookie
// 					[expires] - expiration date of the cookie (defaults to end of current session)
// 					[path] - path for which the cookie is valid (defaults to path of calling document)
// 					[domain] - domain for which the cookie is valid (defaults to domain of calling document)
// 					[secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// 					an argument defaults when it is assigned null as a placeholder
// 					a null placeholder is not required for trailing omitted arguments
//Output Parameters : None

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie ;
}

//Function Name 	: getCookie(name)
//Purpose	    	: Gets Cookie Name
//Input Parameters	: name - name of the desired cookie
//Output Parameters : return string containing value of specified cookie or null if cookie does not exist

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)) ;
  
}

/*
CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
	function css_browser_selector(u) {
		var ua=u.toLowerCase(),
		is=function(t) {
			return ua.indexOf(t)>-1
		},
		g='gecko',
		w='webkit',
		s='safari',
		o='opera',
		m='mobile',
		h=document.getElementsByTagName('body')[0],
		b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; 
		c = b.join(' '); 
		h.className += c; 
		return c;
	};
	
$(document).ready(function() {    
	if(!isIOS){ css_browser_selector(navigator.userAgent); }
});
