// JavaScript Document

function leaveSite(myUrl) {
	handler = myUrl.split('/');
	for(var x=0; x<handler.length; x++) {
		if(handler[x] == "sankyopharma.com" || handler[x] == "www.sankyopharma.com") {
			// Leaving the site is leading to the Daiichi-Sankyo site, init and return
			document.getElementById('popOverTextString').innerHTML = "Please Note: You are about to leave the AZOR.com website and<br> go to the Daiichi Sankyo, Inc. corporate website.";
			//set_url = "tooltip('headerArea', 'popOverArea', 'show', '" + myUrl + "'); return false;";
			//document.getElementById('okayButtonLink').attachEvent("onclick", set_url );
			document.getElementById('okayButtonLink').setAttribute('href', myUrl);
			document.getElementById('okayButtonLink').setAttribute('onclick', 'tooltip("headerArea", "popOverArea", "hide")');
			tooltip('headerArea', 'popOverArea', 'show', '', -300, -250, 'Appear', 0.40);
			return;
		}
		if(handler[x] == "welcholkit.com" || handler[x] == "www.welcholkit.com") {
			// Leaving the site is leading to the Daiichi-Sankyo site, init and return
			document.getElementById('popOverTextString').innerHTML = "Please Note: You are about to leave the WelcholKit.com website and<br> go to the Daiichi Sankyo, Inc. corporate website.";
			//set_url = "tooltip('headerArea', 'popOverArea', 'show', '" + myUrl + "'); return false;";
			//document.getElementById('okayButtonLink').attachEvent("onclick", set_url );
			document.getElementById('okayButtonLink').setAttribute('href', 'http://www.sankyopharma.com');
			document.getElementById('okayButtonLink').setAttribute('onclick', 'tooltip("headerArea", "popOverArea", "hide")');
			tooltip('headerArea', 'popOverArea', 'show', '', -300, -250, 'Appear', 0.40);
			return;
		}
		if(handler[x] == "myazorkit.com" || handler[x] == "www.myazorkit.com" || handler[x] == "azor.com" || handler[x] == "www.azor.com") {
			document.getElementById('popOverTextString').innerHTML = "Please Note: You are about to leave the AZOR.com website by opening a new web page.";
			document.getElementById('okayButtonLink').setAttribute('href', myUrl);
			tooltip('headerArea', 'popOverArea', 'show', '', -300, -250, 'Appear', 0.40);
			document.getElementById('okayButtonLink').setAttribute('onclick', 'tooltip("headerArea", "popOverArea", "hide")');
			return;
		}
		if(handler[x] == "ndep.nih.gov" || handler[x] == "www.diabetes.niddk.nih.gov" || handler[x] == "www.nhlbi.nih.gov" || handler[x] == "www.adobe.com") {
			// Leaving the site is leading to the referenced site, init and return
			document.getElementById('popOverTextString').innerHTML = "Please Note: You are about to leave the WelcholKit.com website by opening a new web page. Daiichi Sankyo, Inc. does not control the content of the website connected to this link.";
			//set_url = "tooltip('headerArea', 'popOverArea', 'show', '" + myUrl + "'); return false;";
			//document.getElementById('okayButtonLink').attachEvent("onclick", set_url );
			document.getElementById('okayButtonLink').setAttribute('href', myUrl);
			document.getElementById('okayButtonLink').setAttribute('onclick', 'tooltip("headerArea", "popOverArea", "hide")');
			tooltip('headerArea', 'popOverArea', 'show', '', -300, -250, 'Appear', 0.40);
			return;
		}
	}
	
	document.getElementById('popOverTextString').innerHTML = "Please Note: You are about to leave the AZOR.com website by opening a new web page. Daiichi Sankyo, Inc. does not control the content of the website connected to this link.";
	document.getElementById('okayButtonLink').setAttribute('href', myUrl);
	tooltip('headerArea', 'popOverArea', 'show', '', -300, -250, 'Appear', 0.40);
	document.getElementById('okayButtonLink').setAttribute('onclick', 'tooltip("headerArea", "popOverArea", "hide")');
	return;	
}


function change_button_on(level){
	
	switch(level) {
		case "1":
			document.getElementById('submit_btn_refer').src = "../images/btn_send_on.gif"; 
			break;
		case "2":
			document.getElementById('submit_btn_refer').src = "../../images/btn_send_on.gif";
			break;
	}
	
}

function change_button_off(level){
	
	switch(level) {
		case "1":
			document.getElementById('submit_btn_refer').src = "../images/btn_send_off.gif";
			break;
		case "2":
			document.getElementById('submit_btn_refer').src = "../../images/btn_send_off.gif";
			break;
	}
	
}