﻿function getSearchResults(section, indication) {
    var searchURL = '/' + indication + "/" + section + "/" + indication + "_" + section + "_Search_Results.aspx?q=" + $("#searchTxt").val();
    window.location = location.protocol + '//' + location.host + searchURL;

};

function showHCPMessage(page) {
    if (confirm()) {
        window.location = page;
    } else {

        window.location = "default.aspx";

    }
};



<!--
function confirmationCLL() {
	var answer = confirm("The information contained in this section of the site is intended for US healthcare professionals only. Click OK if you are a healthcare professional.")
	if (answer){
		
		window.location = "/CLL/HCP/CLL_HCP_home.aspx";
	}
	else{
		
		window.location = "default.aspx";
	}
}
//-->

<!--
function confirmationNHL() {
	var answer = confirm("The information contained in this section of the site is intended for US healthcare professionals only. Click OK if you are a healthcare professional.")
	if (answer){
		
		window.location = "/NHL/HCP/NHL_HCP_home.aspx";
	}
	else{
		
		window.location = "default.aspx";
	}
}
//-->


function exitInterstitial() {
    return confirm("By following this link, you are now leaving the TREANDA.com Web site.  Cephalon Oncology provides these links as a convenience but these sites are not controlled by Cephalon Oncology and Cephalon Oncology is not responsible for their content or your use of them.  For medical advice, please contact your healthcare provider.");
}

<!---
function decision(url){
if(confirm("By following this link, you are now leaving the TREANDA.com Web site.  Cephalon Oncology provides these links as a convenience but these sites are not controlled by Cephalon Oncology and Cephalon Oncology is not responsible for their content or your use of them.  For medical advice, please contact your healthcare provider.")) window.location.href = url;
}
// --->


$(document).ready(function() {	


// Track PDF clicks
    $('a[href*=".pdf"]').each(function () {
        $(this).attr("onclick", "_gaq.push(['_trackEvent','Downloads','PDF','" + $(this).attr("href") + "']);");
        
    });

    $('area[href*=".pdf"]').each(function () {
        $(this).attr("onclick", "_gaq.push(['_trackEvent','Downloads','PDF','" + $(this).attr("href") + "']);");
        
    });	

	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn('fast');	
		$('#mask').fadeTo("fast",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn('fast'); 
	
	});
	
	//if close button is clicked
	$('.close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
                $('.window').remove();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});		
    
    // Hide pixel tracker images
    $('.double-click-advertisement').css('display', 'none');
	
});
