sfHover = function() {
	var sfEls = document.getElementById("country_list").getElementsByTagName("LI");
	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); */

function goToPage(page) {
	document.location.href = page;
}


function ddHighLight(objReference, blOn) {

	var elem = document.getElementById(objReference);
	
	if (blOn) {
		elem.className = "ddCountryOn";
	} else {
		elem.className = "";
	}
	
}

function resetForm() {
	
	document.forms[0].reset();
	
	for (var i=0; i < document.forms[0].elements.length; i++) {
					
		if(document.forms[0].elements[i].type == "select-one") {
			document.forms[0].elements[i].selectedIndex = 0;
		}
		if(document.forms[0].elements[i].type == "text") { 
			document.forms[0].elements[i].value = "";
		}
		if(document.forms[0].elements[i].type == "checkbox") { 
			document.forms[0].elements[i].checked = false;
		}
		if(document.forms[0].elements[i].type == "radio") { 
			document.forms[0].elements[i].checked = false;
		}
		
	}
	
}

function popUpWindow(strURL, intWidth, intHeight) {
	window.open( strURL, "_blank", "status=1, height=" + intHeight + ", width=" + intWidth + ", resizable=1, scrollbars=1, toolbar=1, location=1" )
}
function popUpWindowNoScroll(strURL, intWidth, intHeight) {
	window.open( strURL, "_blank", "status=1, height=" + intHeight + ", width=" + intWidth + ", resizable=0, scrollbars=0, toolbar=0, location=0" )
}

// clickButton() function
// This function is used to make sure the "Enter" key submits the correct form button
function clickButton(event, buttonid) {
	var keyCode = event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode);
	var bt = document.getElementById(buttonid);
	if(keyCode == 13){
		bt.click();
		return false;
	}
	return true;
}

if (document.images) {

	home1on = new Image();
	home1on.src = "/c/images/nav/n_home_2.gif";
	home1off = new Image();
	home1off.src = "/c/images/nav/n_home_1.gif";

	explore1on = new Image();
	explore1on.src = "/c/images/nav/n_explore_2.gif";
	explore1off = new Image();
	explore1off.src = "/c/images/nav/n_explore_1.gif";
	
	patient1on = new Image();
	patient1on.src = "/c/images/nav/n_patients_2.gif";
	patient1off = new Image();
	patient1off.src = "/c/images/nav/n_patients_1.gif";
	
	living1on = new Image();
	living1on.src = "/c/images/nav/n_living_2.gif";
	living1off = new Image();
	living1off.src = "/c/images/nav/n_living_1.gif";
	
	diet1on = new Image();
	diet1on.src = "/c/images/nav/n_diet_2.gif";
	diet1off = new Image();
	diet1off.src = "/c/images/nav/n_diet_1.gif";
	
	understanding1on = new Image();
	understanding1on.src = "/c/images/nav/n_understanding_2.gif";
	understanding1off = new Image();
	understanding1off.src = "/c/images/nav/n_understanding_1.gif";
	
	working1on = new Image();
	working1on.src = "/c/images/nav/n_working_2.gif";
	working1off = new Image();
	working1off.src = "/c/images/nav/n_working_1.gif";
	
	studies1on = new Image();
	studies1on.src = "/c/images/nav/n_studies_2.gif";
	studies1off = new Image();
	studies1off.src = "/c/images/nav/n_studies_1.gif";
	
	tools1on = new Image();
	tools1on.src = "/c/images/nav/n_tools_2.gif";
	tools1off = new Image();
	tools1off.src = "/c/images/nav/n_tools_1.gif";
		
}

function changeImages(strImageID, strType) {
      if ((document.images) && (changeImages.arguments[0] != '')) {
            for (var i=0; i<2; i+=2) {          
                  strNewImagePath = eval(changeImages.arguments[i+1] + ".src").toString();                      
                  document[changeImages.arguments[i]].src = strNewImagePath;  
            }
      }
}



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 cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0)
	{ 
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{ 
		offset += search.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1) end = document.cookie.length;
		cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	return cookieValue;
}


/*
CRM PHASE 2
*/

function changebgover(menuitem){
menuitem.style.backgroundImage = "url(/c/images/nav/n_home_2.gif)"

}

function changebgout(menuitem){
menuitem.style.backgroundImage = "url(/c/images/nav/n_home_1.gif)"

}


/*
FAQs
*/
function makePseudoTabesq(){
	//loops through divs on page, if any div has a class name showDiv change it to hideDiv			
	var divs = document.getElementsByTagName('div');
	for (var i=0; i<divs.length; i++){
		if(divs[i].className=="showDiv"){
			divs[i].className="hideDiv";					
		}
	}
	var links = document.getElementsByTagName('a');
	for (var i=0; i<links.length; i++){
		if(links[i].className=="sectionon"){
			links[i].className="sectionoff";					
		}
	} 
}

function showDiv(linkid, divId){
	makePseudoTabesq();			 
	document.getElementById(divId).className="showDiv"
	linkid.className="sectionon"				
}

function showDivFaq(linkid, divId){
    
	makePseudoTabesq();			 
	document.getElementById(divId).className="showDiv"
	linkid.className="sectionon"
	createCookie("faqDiv", divId, 7);
	createCookie("linkDiv", linkid.id, 7);
}

function hideDiv(divId){			
	makePseudoTabesq();
	document.getElementById(divId).className="hideDiv"
}


/*
Web Links
*/

/***********************************************************************

Global variables for offRamp language

************************************************************************/
var iGlobalEng = 1;
var iThirdPartyEng = 2;
var iGlobalSpan = 3;
var iThirdPartySpan = 4;

/***********************************************************************
function FollowURL(iLanguage, sURL, bReturn, sWndName, sOptions)

Description:
	Shows the off-ramp language to the user before navigating to a third-
	party or global site. 
	
Parameters:
	iLanguage: integer value defined above identifying the language to use
		Global AZ English = 1
		Third Party English = 2
		Global AZ Spanish = 3
		Third Party Spanish = 4
	sURL: string value identifying the URL the user is attempting to navigate to
	bReturn: optional boolean value identifying whether a return value is required by the caller
	sWndName: optional string identifying the name of the target window
	sOptions: optional string identifying window.open options
	
Example:
	FollowURL(iGlobalEng, "http://www.cnn.com", false, "CNN", "top=10,left=10")

************************************************************************/
function FollowURL(iLanguage, sURL, bReturn, sWndName, sOptions)
{
	var sPrompt;
	
	switch (iLanguage)
	{
		case 1: // iGlobalEng
			sPrompt = "This link will take you to a global section of this site maintained by AstraZeneca.\nIt may contain information that does not fall within the indications and guidelines of United States regulatory agencies.\n\nClick Cancel to return or OK to continue."
			break;
		case 2: // iThirdPartyEng
			sPrompt = "This link will take you to a site maintained by a third party who is solely responsible for its contents.\n\nAstraZeneca provides this link as a service to web site visitors. AstraZeneca is not responsible for the Privacy Policy of any third party web sites. We encourage you to read the privacy policy of every web site you visit.\n\nClick Cancel to return or OK to continue."
			break;
		case 3: // iGlobalSpan
			sPrompt = "Este enlace lo llevará a una sección mundial de este sitio mantenida por AstraZeneca.\nEste sitio puede contener información que no entra dentro de las indicaciones y guías de las agencias reglamentarias de Estados Unidos.\n\nHaga clic en Cancelar para regresar o en OK para continuar."
			break;
		case 4: //iThirdPartySpan
			sPrompt = "Este enlace lo llevará a un sitio que es mantenido por terceros, que son los únicos responsables de su contenido.\n\nAstraZeneca proporciona este enlace como un servicio a los visitantes a su sitio web. AstraZeneca no es responsable de la Política de Privacidad de sitios web de terceros. Por favor, lea la política de privacidad de cada sitio web que visite.\n\nHaga clic en Cancelar para regresar o en OK para continuar."
			break;
	}
	
	if (sWndName == null) sWndName = "opener";
	if (sOptions == null) sOptions = "";

	if(! confirm(sPrompt))
		if (bReturn) return false;
		else return;

	var externalWin = window.open(sURL, null, sOptions);
	if (externalWin.opener == null)
		externalWin.opener = window;
	externalWin.opener.name = sWndName;
	if (bReturn) return true;
/*
	if (confirm(sPrompt))
  	{
		if (sURL != null) window.open(sURL, sWndName, sOptions);
		if (bReturn) return true;
	}
	else	
	{
		if (bReturn) return false;
	}
*/
}

function imgbuttonHoverOver(img){
	img.src="/c/images/cra/btn_next_active.gif"
}
function imgbuttonHoverOut(img){
	img.src="/c/images/cra/btn_next_notactive.gif"
}
function imgbuttonSignupHoverOver(img){
	img.src="/c/images/cra/btn_signup_now_hvr.gif";
	//document.getElementById("buttonSubmit").src="/c/images/cra/btn_signup_now_hvr.gif"
}
function imgbuttonSignupHoverOut(img){
	img.src="/c/images/cra/btn_signup_now_reg.gif";
	//document.getElementById("buttonSubmit").src="/c/images/cra/btn_signup_now_reg.gif"
}
function imgbutton360SignupHoverOver(img){
	img.src="/c/images/cra/btn_signup_fortheprogram_big_hvr.gif";
}
function imgbutton360SignupHoverOut(img){
	img.src="/c/images/cra/btn_signup_fortheprogram_big.gif";
}
function imgbuttonTAKSignupHoverOver(img){
	img.src="/c/images/cra/btn_getatakeactionkit_big_hvr.gif";
}
function imgbuttonTAKSignupHoverOut(img){
	img.src="/c/images/cra/btn_getatakeactionkit_big.gif";
}
function imgbuttonMPHoverOver(img){
	img.src="/c/mealplanner/images/btn_personalizemealplanner_big_hvr.gif";
}
function imgbuttonMPHoverOut(img){
	img.src="/c/mealplanner/images/get_started_btn.gif";
}
function imgbuttonConvStarterHoverOver(img){
	img.src="/c/images/cra/convo_starter_center_callout_rollover.gif";
}
function imgbuttonConvStarterHoverOut(img){
	img.src="/c/images/cra/convo_starter_center_callout.gif";
}
function imgbuttonDownloadHoverOver(){
	document.getElementById("_ctl0_MainContent_buttonDownload").src="/c/images/cra/btn_getfreetrialcert_big_hvr.gif"
}
function imgbuttonDownloadHoverOut(){
	document.getElementById("_ctl0_MainContent_buttonDownload").src="/c/images/cra/btn_getfreetrialcert_big.gif"
}

function openFTC() {
	popUpWindow('/c/explore-crestor/freetrial/freetrialoffer.aspx', 660, 740);
	window.document.location.href='/c/explore-crestor/freetrial/ftc_thankyou.aspx';
}

function tagAction(tag) {
	// get the tag and call the action for each tag
	switch (tag)
	{
		case 'clickelise': // Elise Clicked
			dcsMultiTrack('DCS.dcsuri', '/c/crestorpatients/PatientTestimonials/Elise.aspx', 'WT.ti', 'Patient Testimonials - Elise', 'WT.cg_n', 'crestor patients', 'WT.cg_s', 'Patient Testimonials')
			
			<!-- Activity Name for this tag is:CNS - Crestor Pats Testimonials Elise -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=crest484;cat=cnscr089;ord=1;num='+ a + '?';

			pageTracker._trackEvent('Patient Stories', 'clickelise')
			break;
		case 'clickdick': // Dick Clicked
			dcsMultiTrack('DCS.dcsuri', '/c/crestorpatients/PatientTestimonials/Dick.aspx', 'WT.ti', 'Patient Testimonials - Dick', 'WT.cg_n', 'crestor patients', 'WT.cg_s', 'Patient Testimonials')
		
			<!-- Activity Name for this tag is:CNS - Crestor Pats Testimonials Dick -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=crest484;cat=cnscr446;ord=1;num='+ a + '?';

			pageTracker._trackEvent('Patient Stories', 'clickdick')
			break;
		case 'clicksusan': // Susan Clicked
			dcsMultiTrack('DCS.dcsuri', '/c/crestorpatients/PatientTestimonials/Susan.aspx', 'WT.ti', 'Patient Testimonials - Susan', 'WT.cg_n', 'crestor patients', 'WT.cg_s', 'Patient Testimonials')
			
			<!-- Activity Name for this tag is:CNS - Crestor Pats Testimonials Susan -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=crest484;cat=cnscr301;ord=1;num='+ a + '?';

			pageTracker._trackEvent('Patient Stories', 'clicksusan')
			break;
		case 'clickleroy': // LeRoy Clicked
			dcsMultiTrack('DCS.dcsuri', '/c/crestorpatients/PatientTestimonials/Leroy.aspx', 'WT.ti', 'Patient Testimonials - Leory', 'WT.cg_n', 'crestor patients', 'WT.cg_s', 'Patient Testimonials')
			
            <!-- Activity Name for this tag is:CNS - Crestor Pats Testimonials - Leroy -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=crest484;cat=cnscr970;ord=1;num='+ a + '?';

			pageTracker._trackEvent('Patient Stories', 'clickleroy')
			break;
		case 'convstarterPDF':
			<!-- Web site URL where tag should be placed: http://www.crestor.com/c/pdf/conversation_starter.pdf -->
			<!-- Creation Date:12/10/2008 -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=about153;cat=cnsab426;ord=1;num='+ a + '?';
			window.open("/c/pdf/conversation_starter.pdf", 'PDF');
			break;
		case 'qfordrPDF':
			<!-- Web site URL where tag should be placed: http://www.crestor.com/c/pdf/Questions_for_your_doctor_f.pdf -->
			<!-- Creation Date:12/10/2008 -->
			var axel = Math.random()+"";
			var a = axel * 10000000000000;
			document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=crest484;cat=cnscr617;ord=1;num='+ a + '?';
			window.open("/c/pdf/Questions_for_your_doctor_f.pdf", 'PDF');
			break;
	}
}	

// The TrackTag variable refers to the location of the
// base action tag. In the actual implementation this 
// action tag will point to a 1x1 pixel GIF.

function GetActionTag(URL){ 
    var TrackTag = "http://switch.atdmt.com/action/"
	if (GetActionTag) { 
		switch (URL)
		{
			case 'ARCClickToPlay':
				document.action_tag.src = TrackTag + 'dihcre_ARCClicktoplay_1';
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-Clicktoplay.aspx', 'WT.ti', 'ARC - Clicktoplay', 'WT.cg_n', 'Home')
				break;
			default:
				document.action_tag.src = TrackTag + URL;
		}
		// The URL passed from the SWF will be appended to TrackTag.
		// The image will be loaded into the img src tags below the 
		// Flash ad's OBJECT tag.
		
		// add a generic GA tag for all ARC interaction
		pageTracker._trackEvent('ARC', 'interaction')
		
		switch (URL)
		{
			case 'ARCLumen': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-Lumen.aspx', 'WT.ti', 'ARC - Lumen', 'WT.cg_n', 'Home')
				break;
			case 'ARCFattyStreaks': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-FattyStreaks.aspx', 'WT.ti', 'ARC - Fatty Streaks', 'WT.cg_n', 'Home')
				break;
			case 'ARCLDL': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-LDL.aspx', 'WT.ti', 'ARC - LDL', 'WT.cg_n', 'Home')
				break;
			case 'ARCPlaque': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-Plaque.aspx', 'WT.ti', 'ARC - Plaque', 'WT.cg_n', 'Home')
				break;
			case 'ARCArtery': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-Artery.aspx', 'WT.ti', 'ARC - Artery', 'WT.cg_n', 'Home')
				break;
			case 'ARCHDL': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-HDL.aspx', 'WT.ti', 'ARC - HDL', 'WT.cg_n', 'Home')
				break;
			case 'ARCInflammation': // ARC - Home Screen Plus click
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-Inflammation.aspx', 'WT.ti', 'ARC - Inflammation', 'WT.cg_n', 'Home')
				break;

			case 'ARCTakeActionExpand': // ARC - TAK Upper Right
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-TAKUpperRight.aspx', 'WT.ti', 'ARC - TAK Upper Right', 'WT.cg_n', 'Home')

				// Activity Name for this tag is:CNS - Home page TAK
				var axel = Math.random()+"";
				var a = axel * 10000000000000;
				document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=homep705;cat=cnsho675;ord=1;num='+ a + '?';
				
				break;
			case 'ARCQuestionsforyourdoctor': // ARC - TAK Upper Right QFYD
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-TAKUpperRightQFYD.aspx', 'WT.ti', 'ARC - TAK Upper Right QFYD', 'WT.cg_n', 'Home')
				
				<!-- Activity Name for this tag is:CNS - Home page QFYD -->
				var axel = Math.random()+"";
				var a = axel * 10000000000000;
				document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=homep705;cat=cnsho072;ord=1;num='+ a + '?';

				break;
			case 'ARC3thingsyoucando': // ARC - TAK Upper Right Three
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-TAKUpperRightThree.aspx', 'WT.ti', 'ARC - TAK Upper Right Three', 'WT.cg_n', 'Home')
				
				<!-- Activity Name for this tag is:CNS - Home page Three -->
				var axel = Math.random()+"";
				var a = axel * 10000000000000;
				document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=homep705;cat=cnsho754;ord=1;num='+ a + '?';

				break;
			case 'ARCTakeActionKit': // ARC - TAK Upper Right TAK
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-TAKUpperRightTAK.aspx', 'WT.ti', 'ARC - TAK Upper Right TAK', 'WT.cg_n', 'Home')
				
				<!-- Activity Name for this tag is:CNS - Home page Get TAK -->
				var axel = Math.random()+"";
				var a = axel * 10000000000000;
				document.dart_tag.src = 'http://ad.doubleclick.net/activity;src=2077333;type=homep705;cat=cnsho202;ord=1;num='+ a + '?';

				break;
			case 'ARCQuestionsforyourdoctordownload': // ARC - TAK Upper Right QFYD Download
				dcsMultiTrack('DCS.dcsuri', '/c/Home/ARC-TAKUpperRightQFYDDownload.aspx', 'WT.ti', 'ARC - TAK Upper Right QFYD Download', 'WT.cg_n', 'Home')
				break;
		}
	}
}


function signmeup(chkbox)
		{
			//clientvalidation2(); //Goto submit button validation
			
			passinput = document.getElementById("reg_user_Password")
			conpassinput = document.getElementById("reg_user_ConfirmPassword")
			
			if(passinput){passinput.value=""}
			if(conpassinput){conpassinput.value=""}
			
			if(chkbox.checked)
			{				
				document.getElementById("reg_user_Password_ctr").style.display="";
				document.getElementById("reg_user_ConfirmPassword_ctr").style.display="";				
			}
			else
			{			
				document.getElementById("reg_user_Password_ctr").style.display="none";
				document.getElementById("reg_user_ConfirmPassword_ctr").style.display="none";				
			}
			
		}
