//base url fpr note popup
this_url = location.href;
if ( this_url.indexOf( "dulcolax_edit" ) != -1 ) {
	rootpath = this_url.replace( /dulcolax_edit.*/, "dulcolax_edit" );
	actualpath = this_url.substr(0, this_url.lastIndexOf("/")+1);
} else if ( this_url.indexOf( "dulcolax_prod" ) != -1 ) {
	rootpath = this_url.replace( /dulcolax_prod.*/, "dulcolax_prod" );
	actualpath = this_url.substr(0, this_url.lastIndexOf("/")+1);
} else {
	rootpath = "";
	actualpath = "";
}

  
//avoid loading in framesets
//if(self != top)
//{
//	top.location= self.location;
//}

// netscape resize
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator)
		{
			if ((appName=="Netscape")&&(parseInt(appVersion)==4))
			{
    		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
			}
		}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


//popup Global Website

popCom = function() {
  fe = window.open('http://www.dulcolax.com/','fenster');
  fe.focus();
}
 /*Contact/LocalSites  with flashcheck*/
//Netscape 

var ver = 0;
var flashOK = false;

if (navigator.plugins && navigator.plugins['Shockwave Flash']) {
  var words = navigator.plugins["Shockwave Flash"].description.split(" ");
  for (var a = 0; a < words.length; ++a) {
	  if (isNaN(parseInt(words[a]))) continue;
		ver = parseInt(words[a]);
  }
} 

//Internet Explorer
if (document.all) {
  document.write(''+
  '<s'+'cript language="VBScript">\nOn error resume next\n'+
  'ver=0\n'+
  'For i=7 to 3 step -1\n'+
  'Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)\n'+
  'v = IsObject(x)\n'+
  'if v then \n'+
  'ver=i\n'+
  'Exit For\n'+
  'End If\n'+
  'next\n'+
  '</scrip'+'t>')
}

//hier wird die Version angegeben
flashOK = (ver >= 6)? true : false;

function contactFlashCheck(){
if (flashOK) {
	 	popContact(/*VIPURL*/'http://www.dulcolax.com/com/Meta/LocalSites/flash.jsp?localsites=0');
	} else {
	    document.location.href= /*VIPURL*/'http://www.dulcolax.com/com/Meta/ContactUs/noFlash.jsp';
	}
}

function localFlashCheck(){
if (flashOK) {
	 	popContact('http://www.dulcolax.com/');
	} else {
	    document.location.href= 'http://www.dulcolax.com/';
	}
} 

//For Laksativ Akademiet
function new_window(page) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open (page,'Contact'); 
  	win.focus();
  }else{
   var posY=180;
   var posX=170;
   win=window.open (page,'Contact'); 
   win.focus();
}
}

// positionierter Contact
function popContact(page) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open (page,'Contact','width=721,height=520,scrollbars=no,top=0,left=0'); 
  	win.focus();
  }else{
   var posY=180;
   var posX=170;
   win=window.open (page,'Contact','width=721,height=520,scrollbars=no,top=210,left=170'); 
   win.focus();
  }
}

function popContactUS(page) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open ('http://www.bi-druginforequest.com/DulcolaxContactUsWeb/Controller.jpf?companyID=18&type=2','Contact','width=581,height=560,scrollbars=yes,resizable=yes,top=0,left=0'); 
  	win.focus();
  }else{
   var posY=10;
   var posX=10;
   win=window.open ('http://www.bi-druginforequest.com/DulcolaxContactUsWeb/Controller.jpf?companyID=18&type=2','Contact','width=900,height=740,scrollbars=yes,resizable=yes,top=50,left=50'); 
   win.focus();
  }
}



// positionierter Contact
function popContactBr(page) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open (page,'Contact','width=721,height=530,scrollbars=no,top=0,left=0'); 
  	win.focus();
  }else{
   var posY=180;
   var posX=170;
   win=window.open (page,'Contact','width=721,height=530,scrollbars=no,top=210,left=170'); 
   win.focus();
  }
}
// positionierter Contact
function popContactEs(page) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open (page,'Contact','width=721,height=520,scrollbars=yes,top=0,left=0'); 
  	win.focus();
  }else{
   var posY=180;
   var posX=170;
   win=window.open (page,'Contact','width=721,height=520,scrollbars=yes,top=210,left=170'); 
   win.focus();
  }
}

// positioniertes popup 
function popUp(page,name,param) { 
  if(screen.height<=600){
    var posY=10;
    var posX=10;
  	win=window.open (page,name,param+',top=0,left=0'); 
  	win.focus();
  }else{
   var posY=180;
   var posX=170;
   win=window.open (page,name,param+',top=170,left=170'); 
   win.focus();
  }
}
//glossary popup
if(document.layers) {
	var ns = true;
} else if (document.getElementById&&!document.all) {
	var ns6 = true;
} else {
	var ie = true;
}

//
var woher;
var schonmalda = 0;
if (ns) {
	var nixdrin = null;
} else var nixdrin = "";

function ladeSeite(welche) {
		if (opener && !opener.closed) {
			opener.location.href=welche;
			opener.focus();
		} else if (!schonmalda || woher.closed) {
			woher=window.open(welche,'','toolbar=yes,location=yes,status=yes,menubar=yes');
			schonmalda = 1;
		} else {
			woher.location.href=welche;
			woher.focus();
		}
}
//

if (ns){window.captureEvents(Event.MOUSEMOVE);	window.onMouseMove = setpos;}
if (ns6){if (typeof(document.addEventListener)=="function") document.addEventListener("mousemove",setpos,true);}

function setmousepos(){
	if (ie) {
		mouseX = window.event.screenX;
		mouseY = window.event.screenY;
	}
}
function setpos(ev){
	if (ns || ns6) {
		mouseX=ev.screenX;
		mouseY=ev.screenY;
	}
}

function openGlossary(htmlPage) { 

if (window['Glossary'] && !window['Glossary'].closed) {
	setmousepos();
	window['Glossary'].moveTo(mouseX+80,mouseY-30);
	window['Glossary'].location.href=htmlPage;
	window['Glossary'].focus();
} else {
	setmousepos();
	Glossary=window.open (htmlPage,'Glossary','toolbar=0,location=0,directories=0,menubar=0,status=0,scrollbars=yes,resizable=0,width=235,height=180,left='+(mouseX+80)+',top='+(mouseY-30)); 
	Glossary.focus();
}

}

// function Splashscreen: open Country Website 
    function countrySite(url){
      if(url == "") {
        document.site.reset();
        document.site.country.blur();
        return;
      } else {
       document.location.href=url;
      }
    } 
		
