// addLoadEvent() gets passed a function that you want to fire off on page load
function addLoadEvent(objFunc) {
	var objOldOnload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = objFunc;
	} else {
		window.onload = function() {
			if (objOldOnload) {
				objOldOnload();
			}
			objFunc();
		}
	}
}

// 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;
}

// So we don't have flicker on rollover background image swaps
(function(){

    /*Use Object Detection to detect IE6*/
    var  m = document.uniqueID /*IE*/
    && document.compatMode  /*>=IE6*/
    && !window.XMLHttpRequest /*<=IE6*/
    && document.execCommand;
    
    try{
        if(!!m){
            m("BackgroundImageCache", false, true) /* = IE6 only */
        }
        
    }catch(oh){};
})();


// External sites
function leaveSite(url) {
 /*	msg = 'Thanks for visiting www.ZOMIG.com!\n\nPlease note: 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.'
  if (confirm(msg)) {
		window.open(url);
	};
*/	
}

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" )

}

//Change Background style on Login Textboxes
function hideBgkd(thisObj){
	thisObj.className='nobg'
}

function atdmt_switch(atdmt_switch_url, redirect_url)
{
    var io = new Image();
    io.src = atdmt_switch_url;
    window.location = redirect_url;
    return false;
}