﻿var NewPopWin = null;

function PopupWindow(inLocation)
{
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=340,height=300,top=300,left=300";
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupWindowWithScrollbar(inLocation)
{
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=400,top=50,left=50";
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupWindow(inLocation,width,height)
{
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ";"
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupDetailedProductWindow(inLocation)
{
  var width= "420";
  var height = "300";
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=0,left=0";
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupAllowableCountries(inLocation)
{
  var width= "350";
  var height = "180";
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=10,left=10";
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}


function PopupWindow(inLocation,width,height,bNormal)
{
  if (bNormal)
  {
    var features = "fullscreen=no,channelmode=no,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",top=300,left=300";
  }
  else
  {
    var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=300,left=300";
  }
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupWindow(inLocation,width,height,top,left)
{
  if(top == null && left == null){
	top = parseInt((screen.height)/2 - (height/2));
	left = parseInt((screen.width)/2 - (width/2));
  }
  
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}

function PopupWindowHelp(inLocation)
{
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=400,top=" + parseInt((screen.height)/2 - 200) + ",left=" + parseInt((screen.width)/2 - 250);
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(inLocation,null,features,true);
}