


//===========================================================
// This function is required for IE only, as it doesn't support
// the :hover pseudo class on elements other then <a>
//============================================================
		function InitializeMenu()
		{
			if (document.all && document.getElementById)
			{
				var navRoot = document.getElementById("Nav");
				for (i=0; i<navRoot.childNodes.length; i++)
				{
					node = navRoot.childNodes[i];
					if (node.nodeName == "LI")
					{
						node.onmouseover=function()
						{
							this.className+=" over";
						}
						node.onmouseout=function()
						{
							this.className=this.className.replace(" over", "");
						}
					}
				}
			}		
		  }


//=================================================
// Open an new window for send page to a frind with 
//	customized properties
//=================================================

function sendToFriend(objLink) {
	// get the url of the document being sent
	var strCurrentUrl = escape ( parent.document.URL ) ;
	// get the page <title> of the document being sent
	var strPageTitle = escape( parent.document.title );
	var strURLParams = '?ForceUserDeserialize=-1&pageToSend=' + strCurrentUrl + '&pageTitle=' + strPageTitle + '&mode=submitted';
	var strURL = objLink.href + strURLParams;
	var strWindowProperties = 'width=409,height=460,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';	

	// open the window
	openWindow(strURL ,'send_to_a_friend', strWindowProperties);	
	// prevent any further code from executing
	return false;
}

//=================================================
// Open an new window with customized properties
//=================================================
function openWindow(URL, Name, Args){
	popupWin = window.open(URL, Name, Args);
	popupWin.focus();
}

function printPage(){
alert("print");
if (window.print) window.print();
else alert('Your browser does not support javascript printing.\nTo print this page, select File: Print from your menu.\nThis page is already printer friendly.');
}

function dispPage(url){
var openPage = "http://" + document.domain + url;
window.open(openPage);
}


//=================================================
// Open an new window with for popupimage
//=================================================

function popupwindowscroll(url, intWidth,intHeight,blnScroll,blnResize){
    if (intWidth == null || intHeight == null) {intWidth=750;intHeight=535;}
	if (blnScroll == null) {blnScroll='yes';}
	if (blnResize == null) {blnResize='no';}
	// this is the common window for popups. it resizes to the size needed
	//NewWindow = window.open(url,"POPUPWINDOWSCROLL","toolbar=no,width="+intWidth+",height="+intHeight+",directories=no,status=no,scrollbars=yes,resizable="+blnResize+",menubar=no,top=0,left=20");
	window.name ="NewWindow";
	NewWindow = window.open(url,"POPUPWINDOWSCROLL","toolbar=no,width="+intWidth+",height="+intHeight+",directories=no,status=no,scrollbars="+blnScroll+",resizable="+blnResize+",menubar=no,top=0,left=20");
	NewWindow.resizeTo(intWidth, intHeight);
	NewWindow.focus();
}

function AttachEvent(obj,evt,fnc,useCapture){
	if (!useCapture) useCapture=false;
	if (obj.addEventListener){
		obj.addEventListener(evt,fnc,useCapture);
		return true;
	} else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
	else{
		MyAttachEvent(obj,evt,fnc);
		obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
	}
} 

//The following are for browsers like NS4 or IE5Mac which don't support either
//attachEvent or addEventListener
function MyAttachEvent(obj,evt,fnc){
	if (!obj.myEvents) obj.myEvents={};
	if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
	var evts = obj.myEvents[evt];
	evts[evts.length]=fnc;
}
function MyFireEvent(obj,evt){
	if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
	var evts = obj.myEvents[evt];
	for (var i=0,len=evts.length;i<len;i++) evts[i]();
}


Array.prototype.in_array = function(search_term) {
var i = this.length;
search_term=search_term.toUpperCase();
do {
if (i > 0) {
if (this[i-1].toUpperCase() === search_term)
return true; }
} while (--i);
return false;
}

//=================================================
// show leaving the site warning
//=================================================
var ExitPopUpsEnabled = false;
if ('yes' == 'yes') {
	var ExitPopUpsEnabled = true;
}




	
String.prototype.stripSpaces = function( ){ return this.replace( /\s/g, "" ); };


var SiteExceptions = "www.organon.com,hcp.organon.com,www.organon-conferences.com,www.psychiatrymatters.md,www.remeronsoltab.md,www.nuvaring.md,www.orgyn.com,www.implanon.md,www.cerazette.md,www.contraception.net,www.nuvaring.com,www.mycontraceptive.com,www.cyclessa.com,www.marvelon.ca,www.puregonpen.com,www.puregon.md,www.puregon.com,www.follistim.com,www.fertilityjourney.com,www.livial.md,www.liviella.de,hcp.livial.info,www.livial.com,www.andriol.md,www.andriol.com,www.andropause.com,www.anesthesianow.com,www.esmeron.md,www.zemuron.com,www.oncotice.md, www.kinderwens.nl, www.fertilityjourney.com.sg, www.unserwunschkind.at, www.kinderwunsch.de, www.jeveux1bebe.be, www.viajandohacialafertilidad.com, www.kinderwens.be, www.fertilityjourney.com.my, www.fertilitetsguiden.nu, www.organon.de, www.adobe.com,www.hcp-nuvaring-de.com, sms.nuvaring.de, smpc.organon.com,www.psychiatrymatters.co.jp,www.psychiatrymatters.jp, www.schering-plough.co.jp, www.organon.jp,medical.schering-plough.co.jp,".stripSpaces().split(',')	
var SiteInclusions = "www.europeanurology.com, journals.elsevierhealth.com".stripSpaces().split(',');	
function ReplaceLinks()
{
	var currentdomain = document.domain;
	if (ExitPopUpsEnabled)
	{
		for (l=0; l<document.links.length; l++)	
		{
			current_href = document.links[l].href.toLowerCase();
			if ( current_href.indexOf(currentdomain) == -1 && current_href.substring(0,1) != "/" && current_href.indexOf("(") == -1 )
			{
				if (!SiteExceptions.in_array(document.links[l].hostname))
				{ 
					var link = document.links[l];
					if (link && link.href.toLowerCase().substr(0,7)!= 'mailto:') AttachEvent(link,"click",ExitPopUp,false)
				}					
			} 
			else
			{	
				//This code will check whether the current link has any one of the site which is there in inclusion list
				//if yes then the popup-message box should be displayed for the link irrespective of its other properties
				var strSiteName;
				for(strSiteName in SiteInclusions)
				{
					if(SiteInclusions[strSiteName] != "" && current_href.indexOf(SiteInclusions[strSiteName]) != -1)
					{
						var link = document.links[l];
						AttachEvent(link,"click",ExitPopUp,false);
						break;
					}
				}				
			}
		}
	}
 }

function ExitPopUp(e){
	if (!e) var e = window.event;
	if (!confirm("ここより先はUrologyQOLのウェブサイトではございません。リンク先のウェブサイトに記載されている情報は、シェリング・プラウ株式会社の見解を述べるものではございません。".replace("[DOCUMENTDOMAIN]", document.domain)))
	{
		if (e.preventDefault) e.preventDefault();
		e.returnValue = false;
	}
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}
  

function ExitPopUpFlash(url,popuptreatment)
  {
	if (confirm("You are about to leave " + document.domain + ". The content of the site you are about to visit is not controlled by Schering-Plough"))
	{
			window.name ="NewWindow";
			NewWindow = window.open(url,"PopupWindow",popuptreatment);
			NewWindow.focus();			  	}  
  }
  
function ShowQuickPollJS(str) {

}

function removeBackground(doIt, strId)
{
	if (doIt && document.getElementById) document.getElementById(strId).style.background = 'none';
}

function disppage(openpage)
		{ 
			alert('this is for test');
			window.open(openpage);
		}

function clickSpotlightOrMasthead(strId)
{
	var spotlinkChild;

	if (document.getElementById) 
	{
		if (document.getElementById(strId)) 
		{
			tbody = document.getElementById(strId);
			for(var i=0; i<tbody.childNodes.length; i++){
				tbody2 = tbody.childNodes[i];
				for(var j=0; j<tbody2.childNodes.length; j++){
					if (tbody2.childNodes[j].nodeName == "A") {
						spotlinkChild = tbody2.childNodes[j];
						break;
					}
				}
				if (spotlinkChild) break;
			}
			
			if(spotlinkChild) {
		
				var strHref = spotlinkChild.getAttribute("href");
				var clickOk = true;
				if ( ExitPopUpsEnabled && strHref.indexOf(document.domain) == -1 && !SiteExceptions.in_array(strHref))
				{
					if (!confirm("ここより先はUrologyQOLのウェブサイトではございません。リンク先のウェブサイトに記載されている情報は、シェリング・プラウ株式会社の見解を述べるものではございません。".replace("[DOCUMENTDOMAIN]", document.domain)))
					{
						clickOk = false;
					}
				}
				if (clickOk)
				{
					if (spotlinkChild.getAttribute("target") != "_blank")
					{
						document.location = strHref;
					}
					else
					{
						window.open(strHref,strId);
					}
				}
			}
		}
		return false;
	}
	else
	{
		return true;
	}
}