//******************************************************************************************************
// On load handling

	function page_load()
	{
		callPreloader();
		
		// Declare default font-size
		m_iFontSize_Default = 11;
		m_iFontSize_Max = 13;
		m_iFontSize_Step = 1;
	}

//******************************************************************************************************


//******************************************************************************************************
// Image handling

	function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	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 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_showHideLayers() { //v6.0
		var i,p,v,obj,args=MM_showHideLayers.arguments;
		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}

	// Pre-load handling
	var m_sPreloadImgs = "";
	
	function addToPreload(v_sImgPaths)
	{
		(m_sPreloadImgs == "") ? m_sPreloadImgs += v_sImgPaths : m_sPreloadImgs += ", " + v_sImgPaths;
	}

	function callPreloader()
	{
		if (m_sPreloadImgs != "") eval("MM_preloadImages(" + m_sPreloadImgs + ");");
	}
//******************************************************************************************************


//******************************************************************************************************
// Page Tools

	// Bookmark current page
	function BookmarkThisPage()
	{
		var sTitle = "AstraZeneca - " + window.document.title;
		var sUrl = window.document.location.href;
	
		if (window.sidebar)			// Mozilla Firefox Bookmark
			window.sidebar.addPanel(sTitle, sUrl, "");
		else if (window.external)	// IE Favorite
			window.external.AddFavorite(sUrl, sTitle);
		else if (navigator.appVersion.indexOf('Mac') != -1)
			alert('Press Apple+D to bookmark this site.');
		else
			alert('Press Control+D to bookmark this site.');
	}


	// Print current page
	function PrintThisPage()
	{
		if (window.print)
			window.print();
		else
			alert('Select PRINT from the File menu.');
	}

	
	// Share current page - 
	function ShareWithFriend()
	{
		createCookie("page_title", window.document.title, null);
		createCookie("page_address",window.document.location.href, null);
	
		var winShare = window.open("/share-page.aspx", "winShare", "width=400,height=480,toolbar=no,directories=0,status=0,menubar=no,resizable=no,scrollbars=no");
	}
	
	
//*****************************************************************************************************
// Alternate Stylesheet handling

function getPreferredStyleSheet()
{
	var i, a;
	
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
		if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("rel").indexOf("alt") == -1) && (a.getAttribute("title")))
			return(a.getAttribute("title"));
			
	return(null);
}

function setActiveStyleSheet(title)
{
	var i, a, main;
	
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
		if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("title")))
			{
			a.disabled = true;
			if(a.getAttribute("title") == title)
				a.disabled = false;
			}
		
	createCookie('FontSize', title);
}
//*****************************************************************************************************






//***********************************************************************************************
// Cookie related functions 

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
//***********************************************************************************************



//******************************************************************************************************
// URLEncode - 

function URLDecode(str){
    str=str.replace(new RegExp('\\+','g'),' ');
    return unescape(str);
}
function URLEncode(str){
    str=escape(str);
    str=str.replace(new RegExp('\\+','g'),'%2B');
    str=str.replace(new RegExp('-','g'),'%96');
    return str.replace(new RegExp('%20','g'),'+');
}
//******************************************************************************************************




//******************************************************************************************************
// Expand/contract HTML elements - 

function displaySwitch(r_arrOpen, r_arrClose, v_strDisplayType)
{
	// Open the elements in the first array passed
	for (var i=0; i<r_arrOpen.length; i++)
		if (document.getElementById(r_arrOpen[i]))		
			document.getElementById(r_arrOpen[i]).style.display = (v_strDisplayType == null) ? 'block' : v_strDisplayType;
	
	// Close the elements in second array passed
	for (i=0; i<r_arrClose.length; i++)
		if (document.getElementById(r_arrClose[i]))
			document.getElementById(r_arrClose[i]).style.display = 'none';
}
//******************************************************************************************************


//******************************************************************************************************
// Switch CSS Class

function switchClass(v_sId, sCssClass)
{
	if (document.getElementById(v_sId))
		document.getElementById(v_sId).className = sCssClass;
}
//******************************************************************************************************


//******************************************************************************************************
// Open Window - 

function openWindow(v_sURL, v_sName, v_sFeatures)
{
	winRef = window.open(v_sURL, v_sName, v_sFeatures);

}
//******************************************************************************************************


// Show/Hide Second Date Field for "Between" Option
function showSpan(grup,elemId){
	if (elemId == 1){
		document.getElementById(grup+'EndDate').style.visibility="visible";
	}else{
		document.getElementById(grup+'EndDate').style.visibility="hidden";
	}
}

// EMail this Page
function mailpage()
{
mail_str = "mailto:?subject=Check out " + document.title;
mail_str += "&body=I thought you might be interested in: " + document.title;
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}

// Clear Default Text from Textboxs
	function clearText(thefield){
		if (thefield.defaultValue==thefield.value)
		thefield.value = ""
	} 
	function addText(thefield,thetext){
		if (thefield.value=="")
		thefield.value = thetext;
	}

//******************************************************************************************************
// TEXT ZOOMING

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
//******************************************************************************************************
// HOVER EFFECTS FOR MENU
sfHover = function() {
	if (document.getElementById("left_nav")) {
	    var sfEls = document.getElementById("left_nav").getElementsByTagName("DIV");
	    for (var i=0; i<sfEls.length; i++) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" sfhover";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		    }
	    }
	} 
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// Cookie related functions 
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

//survey tool
function launchAsthmaAssessment()
{
	// Save path
	createCookie("SiteSection","1");
	var pageURL = '/asthma/survey/start.aspx';
    openWindowNoChrome(pageURL,'survey',790,600,0,1);
}

var localLink = false;	
			
		function setupLinks(){
		    
			for (var i=0;i<document.links.length;i++){
			    if (
			        (document.links[i].href.substring(0,16) == 'http://localhost') || 
			        (document.links[i].href.substring(0,28) == 'http://cdws05.cgdev.com:1000') || 
			        (document.links[i].href.substring(0,33) == 'http://symbicortv3.cadientdev.com')|| 
			        (document.links[i].href.substring(0,33) == 'http://mysymbicort.cadientdev.com')|| 
			        (document.links[i].href.substring(0,28) == 'http://stage.mysymbicort.com') || 
			        (document.links[i].href.substring(0,26) == 'http://www.mysymbicort.com')|| 
			        (document.links[i].href.substring(0,27) == 'https://www.mysymbicort.com')||
			        (document.links[i].href.substring(0,34) == 'http://www.mymeasuresofsuccess.com') ||
			        (document.links[i].href.substring(0,35) == 'http://www.mymeasuresforsuccess.com') ||
			        (document.links[i].href.substring(0,36) == 'https://www.mymeasuresforsuccess.com')
			        ){
			        document.links[i].onclick = function(){ localLink = true };
			    }//if
			}//for		
	    }//function
	    
        function setLocal2(rb){
            var list = document.getElementById(rb); //Client ID of the radiolist
            var inputs = list.getElementsByTagName("input");
            var selected;
            for (var i = 0; i < inputs.length; i++) {
                if (inputs[i].checked) {
                    selected = inputs[i];
                    break;
                }
            }
        if (selected) {
           if(selected.value==1){
                localLink=false;
            }else{
              localLink=true;
            }
         }else{
            localLink=true;
        }
}
function setLocal(){
    localLink=true;
}
//smaller popup with Yes/No options that will lead to the main survey
function launchPreSurvey(){
    if (!localLink){
        //JD - 02/24/10:  Commented as part of In The News activity.
        //if (readCookie('viewedPreAsthmaSurvey')==null){
        //    var pageURL = '/asthma/survey/presurvey.aspx';
	    //    var w = openWindowNoChrome(pageURL,'presurvey',300,200,0,0);			       
        //}	
    }
}
            
 //Main Key Survey when 'Yes' is clicked
function launchKeySurvey(vid){
    if (readCookie('viewedPreAsthmaSurvey')==null){
        createCookie('viewedPreAsthmaSurvey', 1, 999);
		var newwindow = 'http://www.keysurvey.com/survey/244853/2e42/';
		var lLeft =(screen.width - 1000)/2;
		var lTop = (screen.height - 655)/2;	
		openPopUp('http://www.keysurvey.com/survey/244853/2e42/?LQID=1&VID=' + vid,'survey','width=1000,height=655,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
		window.close();			
	    newwindow.focus();
	}
}
function launchCardWindow(strQString){  
    var lLeft =(screen.width - 700)/2;
    var lTop = (screen.height - 655)/2;
	if (strQString){
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma'+'&r='+ strQString,'PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
	}else{			
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma','PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
	}
}
function launchBillboardCardWindow(strQString){                
    var lLeft =(screen.width - 700)/2;
    var lTop = (screen.height - 655)/2;
    if (strQString){
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma'+'&r='+ strQString + "&cmp_id=homepagelink&cmp_a_1=start%20saving%20asthma&cmp_a_3=internal%20link",'PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
    }
    else {
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma'+"&cmp_id=homepagelink&cmp_a_1=start%20saving%20asthma&cmp_a_3=internal%20link",'PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
    }
}
function launchBillboardCardWindow2(strQString){                
    var lLeft =(screen.width - 700)/2;
    var lTop = (screen.height - 655)/2;
    if (strQString){
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma'+'&r='+ strQString + "&cmp_id=homepagelink&cmp_a_1=free%20rx%20offer%20save%20now%20asthma&cmp_a_3=internal%20link",'PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
    }
    else {
        openPopUp('http://www.mymeasuresforsuccess.com/Portal/UI/card.aspx?caller=asthma'+"&cmp_id=homepagelink&cmp_a_1=free%20rx%20offer%20save%20now%20asthma&cmp_a_3=internal%20link",'PrescriptionSavingCard','width=700,height=675,top=' + lTop.toString() + ',left=' + lLeft.toString() + ',scrollbars=yes,align=left,border=0,resizable=no')
    }
}
//Close the popup when 'No' is clicked	
function closeWindow() {
createCookie('viewedPreAsthmaSurvey', 1, 999);
window.close();
}
            
            
         

// Print current page
function PrintThisPage()
{
	if (window.print)
		window.print();
	else
		alert('Select PRINT from the File menu.');
}


//******************************************************************************************************
// POPUP WINDOWS  - 

//variables for centering pop-up windows
var width = screen.width;
var height = screen.height;
var popUpWidth = 0;
var popUpHeight = 0;
var positionTop = 0;
var positionLeft = 0;
var popup = 0;

//popup withOUT browser controls
        //opens current URL in new popup window
function openSameWindowNoChrome(windowName,pWidth,pHeight,pResize,pScrollbars, param,anchor) {
  positionTop = ((height/2) - (pHeight/2));
  positionLeft = ((width/2) - (pWidth/2));
    
  if (param && param!='')
    sameurl = document.location.href + "&print=true";
  else 
    sameurl = document.location.href + "?print=true";
    
  if (anchor && anchor!='')
    sameurl = sameurl + anchor
    
  popup=window.open(sameurl,windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=0,location=0,directories=0,toolbar=0,scrollbars=' + pScrollbars + ',status=0');
	popup.focus();
}
        //opens specific URL in new popup window
function openWindowNoChrome(pageURL,windowName,pWidth,pHeight,pResize,pScrollbars) {
  positionTop = ((height/2) - (pHeight/2));
  positionLeft = ((width/2) - (pWidth/2));
  var popup=window.open(pageURL,windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=0,location=0,directories=0,toolbar=0,scrollbars=' + pScrollbars + ',status=0');
  popup.focus();
  return popup;
}

//popup with browser controls
        //opens current URL in new popup window
function openSameWindow(windowName,pWidth,pHeight,pResize,pScrollbars,param,anchor) {
  positionTop = ((height/2) - (pHeight/2));
  positionLeft = ((width/2) - (pWidth/2));

  if (param && param!='')
    sameurl = document.location.href + "&print=true";
  else 
    sameurl = document.location.href + "?print=true";
       
  if (anchor && anchor!='')
    sameurl = sameurl + anchor
    
  popup=window.open(sameurl, windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=1,location=1,directories=0,toolbar=1,scrollbars=' + pScrollbars + ',status=1');
	popup.focus();
}
        //opens specific URL in new popup window
function openWindow(pageURL,windowName,pWidth,pHeight,pResize,pScrollbars) {
  positionTop = ((height/2) - (pHeight/2));
  positionLeft = ((width/2) - (pWidth/2));
  popup=window.open(pageURL,windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=1,location=1,directories=0,toolbar=1,scrollbars=' + pScrollbars + ',status=1');
	popup.focus();
}

function openPopUp(v_sURL, v_sName, v_sFeatures)
{
	winRef = window.open(v_sURL, v_sName, v_sFeatures);
}

function disableEnterKey() 
{
	if (window.event.keyCode==13)
	{   
	    return false;
	}	
}

//DOM ready functions
$(function(){
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/')+1);
    
    if (sPage.length!=0 && sPage!='default.aspx') {     //if page is other than the triage.
        if (sPage!='index.aspx' && readCookie('viewedPressPage')==null){
            $.get('/asthma/news/default.aspx', function(data) { $.facebox(data) });
            
            $(document).bind('reveal.facebox', function() {
                //temporarily hide the jellyvision iframe while the lightbox is shown.
                    $('#iFrameJV').hide();
                //temporarily hide the how-to-use video while the lightbox is shown.
                    $('#flashHowTo').hide();
            })
            $(document).bind('close.facebox', function() {
                //display the iframe after the lightbox closes.
                    $('#iFrameJV').show();
                //display the video after the lightbox closes.
                    $('#flashHowTo').show();
            })
		    createCookie("viewedPressPage", 1, null);
        }
        if (sPage=='index.aspx') {          //set cookie if the asthma homepage is accessed directly.
		    createCookie("viewedPressPage", 1, null);
        }
    }

    //alternate text for the SYMBICORT logo as rendered by the hyperlink control
    $('.logoProduct a img').attr('alt','SYMBICORT (budesonide/formoterol' + '\r' + 'fumarate dihydrate)');
	//navigation rollover function
	$('div.leftNav li').hover(
		function(){
			if ($(this).hasClass('on') == false && $(this).hasClass('sub') == false && $(this).hasClass('espanol') == false){
				$(this).addClass('over');
			}
		},
		function(){
			if ($(this).hasClass('on') == false && $(this).hasClass('sub') == false && $(this).hasClass('espanol') == false){
				$(this).removeClass('over');
			}
		}
	);
	
	//button hovers - buttons and their over state must be named like btnPrintLetterOver.gif and btnPrintLetterOver.gif
	$('input.viewLetter, input.printLetter, input.editName, input.sendLetter').hover(
		function(){
			var currentSrc = ($(this).attr('src')).toString();
			currentSrc = currentSrc.substr(0, currentSrc.length - 4);
			$(this).attr('src', currentSrc + 'Over.gif');
		},
		function(){
			var currentSrc = ($(this).attr('src')).toString();
			currentSrc = currentSrc.substr(0, currentSrc.length - 8);
			$(this).attr('src', currentSrc + '.gif');
		}
	);	

	 $(".rightNav a[href!='#'] img").bind("click",function(){
        var uri = parseUri(this.src);
        trackEvent.event('event.action',{activity:'link', internalcallout:uri.fileName,internalcalloutaction:'c'});
        return true;
    })
	
	$("input[rel*='mask']").focus(function () {
         if($(this).val()=='MM' ||$(this).val()=='DD'||$(this).val()=='YYYY'){
            $(this).val('')
         }
      
    });

   $("a[href*='.pdf'],[href*='az_pi.cgi']").bind("click",function(){
            var uri = parseUri(this);
            if ((uri.fileName.toLowerCase()=='symbicort.pdf'||uri.fileName.toLowerCase()=='az_pi.cgi')){
                if (this.id=='medguide2'){
                    getDartTag("http://fls.doubleclick.net/activityi;src=2079641;type=mysym956;cat=symfe226;ord=1");
                }
                else if (this.id=='medguide3'){
                     getDartTag("http://fls.doubleclick.net/activityi;src=2079641;type=mysym956;cat=symfe939;ord=1");
                }
                else
                {
                    getDartTag("http://fls.doubleclick.net/activityi;src=2079641;type=mysym956;cat=symfe693;ord=1");
                }
            }else{
                 if (uri.fileName.toLowerCase()=='symbicort-dose-tracking.pdf'){
                   getDartTag("http://fls.doubleclick.net/activityi;src=2079641;type=mysym956;cat=symfe944;ord=1");
                    }
            }
         
           trackEvent.event('event.action',{activity:'download',download: uri.fileName});
          
           return true;
        
    })
//      $("a[href*='.pdf'][id*='medguide'],[href*='az_pi.cgi'][id*='medguide']").bind("click",function(){
//            var axel = Math.random()+"";
//            var a = axel * 10000000000000;
//           (new Image()).src = "http://fls.doubleclick.net/activityi;src=2079641;type=mysym506;cat=symco561;ord=1;num="+ a + "?" 
           
//            var uri = parseUri(this);
//           trackEvent.event('event.action',{activity:'download',download: uri.fileName,internal_campaign_action:'c'});
          
//           return true;
//    })
});

function  getDartTag(trackUrl){
    //var axel = Math.random()+"";
    //var a = axel * 10000000000000;
   //(new Image()).src = trackUrl+ ";num=" + a + "?"
   GetDartTag(trackUrl);    //The flash piece was coded to call GetDartTag, while the other ASPX pages use getDartTag.
}

function  GetDartTag(trackUrl){
    var axel = Math.random()+"";
    var a = axel * 10000000000000;
   (new Image()).src = trackUrl+ ";num=" + a + "?" 
}

function parseUri(sourceUri){
    var uriPartNames = ["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"],
    uriParts = new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(sourceUri),
    uri = {};

    for(var i = 0; i < 10; i++){
	    uri[uriPartNames[i]] = (uriParts[i] ? uriParts[i] : "");
    }

    /* Always end directoryPath with a trailing backslash if a path was present in the source URI
    Note that a trailing backslash is NOT automatically inserted within or appended to the "path" key */
    if(uri.directoryPath.length > 0){
	    uri.directoryPath = uri.directoryPath.replace(/\/?$/, "/");
    }
    return uri;
}


function hideCascade()
{
    hideVideo("imagecontent","flashContent")
}

function showVideo(imageId,videoid)
{
	var videocntr = document.getElementById(videoid);
	if (videocntr)
	{	
		videocntr.style.display = "block";
		videocntr.style.visibility = "visible";
	}
	
	var imagecntr = document.getElementById(imageId);
	if (imagecntr)
	{	
		imagecntr.style.display = "none";
		imagecntr.style.visibility = "hidden";
	}
	
}
function hideVideo(imageId,videoid)
{
	var videocntr = document.getElementById(videoid);
	if (videocntr)
	{	
		videocntr.style.display = "none";
		videocntr.style.visibility = "hidden";
	}
	
	var imagecntr = document.getElementById(imageId);
	if (imagecntr)
	{	
		imagecntr.style.display = "block";
		imagecntr.style.visibility = "visible";
	}
	
}

// ****************************************************
// Functions for toggling of images on mouseover event.
// Creation Info : 04/20/2009 JD
// ****************************************************
	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 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;
	}
var js;
function include_js(file) {
    var html_doc = document.getElementsByTagName('head')[0];
    js = document.createElement('script');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', file);
    html_doc.appendChild(js);

    js.onreadystatechange = function () {
        if (js.readyState == 'complete') {
           // alert('JS onreadystate fired');
        }
    }

    js.onload = function () {
     //   alert('JS onload fired');
    }
    return false;
}
