/*
16.04.2002/Pasi New parameter: scroll, default value: yes
22.04.2002/Mikko Lehtonen: people tend to use scroll=true instead of scroll=yes in windowOpener()
	even though true is not supported by window.open() (see http://developer.netscape.com/docs/manuals/javascript.html). 
	The windowOpener function is modified to support this incorrect but more intuitive value for scroll.
*/

function windowOpener(url,width,height,name,scroll)
{
  browserName = navigator.appName;
  browserVer  = navigator.appVersion.substring(0,1);
  if (width==null)  {width=417;}
  if (height==null) {height=470;}
  if (name==null)   {name="popUp1";}
  if (scroll==null  || scroll==true) {scroll="yes";}
  if (browserName != "Netscape" || browserVer != 2)
  {
    controlWindow=window.open(url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no");
  }
}


function SCpopupOpener(url,width,height,name,resizable,statusbar) 
{

  browserName = navigator.appName;
  browserVer = navigator.appVersion.substring(0,1);
  if (width==null || width.length==0) {width=450;}
  if (height==null || height.length==0) {height=510;}
  if (name==null|| name.length==0) {name="SCpopUp1";}
  if (resizable==null || resizable.length==0) {resizable="yes";}
  if (statusbar==null || statusbar.length==0) {statusbar="no";}
  
  if (browserName != "Netscape" || browserVer != 2)
  {
    controlWindow=window.open(url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status="+statusbar+",menubar=no,scrollbars=yes,resizable="+resizable+"");
    controlWindow.focus(); //This added to make the window stay on top
  }
}

//17.4.2002 Toni Laurila, winOpen function added for StarWars campaign
//function opens a popup window with specific size depending on users screen resolution
function winOpen(url,strName)
{
   if (strName==null || strName.length==0) 
   {
    strName="starwars";
   }
   
   if (screen.width >= 1024)
   {
    eval("window.open('"+url+"','"+strName+"','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=yes,resizable=1,width=800,height=700')")
   }

   if (screen.width == 800)
   {
    eval("window.open('"+url+"','"+strName+"','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=yes,resizable=1,width=720,height=505')")
   }

   if (screen.width <= 799)
   {
    eval("window.open('"+url+"','"+strName+"','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=yes,resizable=1,width=620,height=400')")
   }
}
