// JavaScript Document
// Open borderless window

var PWindowWidth=0 // width
var PWindowHeight=0 // height
var PWindowPosX = 0 // from left
var PWindowPosY = 0 // from top
var PWindowTitle =  "dummydummy"
var PWindowURL = "dummydummy"
var autoclose = false
var beIE = document.all?true:false

var PopupOpen = false;
var aWindow;

function OpenWindow(URL,width,height)
{
	if (PopupOpen == true)
		aWindow.close();
			
		var scWidth = screen.availWidth;
		var scHeight = screen.availHeight;
    	var l = (screen.availWidth - width) / 2;
    	var t = (screen.availHeight - height) / 2;

		aWindow = window.open(URL,'Address','toolbar=no,scrollbars=auto,resizable=no,width=' + width + ',height=' + height + ',top=' + t + ',left=' + l);

	//aWindow.document.open();
	PopupOpen = true;
}


function openFrameless(PWindowTitle,PWindowURL,PWindowWidth,PWindowHeight)
{
var s;
var sQ;
// PWindowURL+='?'
// PWindowURL+=formQueryString()
 PWindowPosX = (screen.width) ? (screen.width-PWindowWidth)/2 : 0;
 PWindowPosY = (screen.height) ? (screen.height-PWindowHeight)/2 : 0;
  if (beIE){
 s = "width="+PWindowWidth+",height="+PWindowHeight;
 NFW = window.open("","popFrameless",s)
// NFW.blur()
    window.focus()
    NFW.resizeTo(PWindowWidth,PWindowHeight)
    NFW.moveTo(PWindowPosX,PWindowPosY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+PWindowTitle+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=1 frameborder=0>"+
"<frame name='top' src='"+PWindowURL+"' scrolling=no>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(PWindowURL,"popFrameless","scrollbar=no,"+s)
    NFW.blur()
    NFW.opener=self
    window.focus()
    NFW.resizeTo(PWindowWidth,PWindowHeight)

    NFW.moveTo(PWindowPosX,windowY)
  }
  NFW.opener=self
  NFW.focus()
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

function ResizePWindow(PWindowWidth,PWindowHeight)
{
    NFW.resizeTo(PWindowWidth,PWindowHeight)
}

function MovePWindow(leftright,updown)
{

 PWindowPosX=NFW.top
 PWindowPosX=NFW.left

 PWindowPosX=PWindowPosX+leftright
 PWindowPosY=PWindowPosY+updown

 NFW.moveTo(PWindowPosX,PWindowPosY)
}

function showDelivery()
{
	var ret;
    OpenWindow('delivery.htm',780,800)
}

function showGuarantee()
{
	var ret;
    OpenWindow('guarantee.htm',780,580)
}

