

$(document).ready(function() {
  assignWindowEvents();
}); 

function assignWindowEvents() {
  $("a.xLink").click(function () {
     window.open($(this).attr("href"),'newWindow');
     return false;
  });
  $("a.xConf").click(function (e) {
     	e.preventDefault()
	var tempUrl = $(this).attr("href")
	var temp = confirm("You are about to leave mirena.com to go to an external site" + '\n' + tempUrl + " - which will open in a new window." + '\n \n' + "Click OK to continue or cancel to return to the page you were on.")
	if(temp){
		     window.open($(this).attr("href"),'newWindow');
     return false;
	}else{return false;}

  });
    $("a.bayerLogo").click(function (e) {
     	e.preventDefault()
	var tempUrl = $(this).attr("href")
	var temp = confirm("You are about to leave mirena.com to go to an external site" + '\n' + tempUrl + " - which will open in a new window." + '\n \n' + "Click OK to continue or cancel to return to the page you were on.")
	if(temp){
		     window.open($(this).attr("href"),'newWindow');
     return false;
	}else{return false;}

  });
    $("ul.footerLinks a").click(function (e) {
     	e.preventDefault()
	var tempUrl = $(this).attr("href")
	var temp = confirm("You are about to leave mirena.com to go to an external site" + '\n' + tempUrl + " - which will open in a new window." + '\n \n' + "Click OK to continue or cancel to return to the page you were on.")
	if(temp){
		     window.open($(this).attr("href"),'newWindow');
     return false;
	}else{return false;}

  });
  $(".hiddenPanel a").click(function (e) {
     	e.preventDefault()
	var tempUrl = $(this).attr("href")
	var temp = confirm("You are about to leave mirena.com to go to an external site" + '\n' + tempUrl + " - which will open in a new window." + '\n \n' + "Click OK to continue or cancel to return to the page you were on.")
	if(temp){
		     window.open($(this).attr("href"),'newWindow');
     return false;
	}else{return false;}

  });
 
  $("a.xPopup").click(function () {
     this.newWindow = window.open($(this).attr("href"),'popup','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=760');
     this.newWindow.focus();
     this.newWindow.opener = window;
     return false;
  });
}


