﻿// JScript File
var childWindow;
var pickDateWindow;
//======================================================================================================//
  function GetScreenResolution(){
    intScreenWidth = screen.width;
    msgbox(intScreenWidth);
    return intScreenWidth;
  }
//======================================================================================================//
function IsChildWindow() {
  if (opener == null || self.name != "childWindow") {
    document.location.href = errorScriptPage & "?error=childFunction";
  	return false;
  }
  else return true;
}
//======================================================================================================//
function NewHiddenWindow(url, width, height) {
  wLeft = screen.width / 2 - width / 2;
  wTop = screen.height / 2 - height / 2;
  if (opener != null && opener.childWindow != null && opener.childWindow.open) {
    opener.childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
	  childWindow.blur();
  }
  else if (childWindow != null && childWindow.open) {
    childWindow.close();
    childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
	  childWindow.blur();
  }
  else
  childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  childWindow.blur();
}
//======================================================================================================//
function NewWindow(url, width, height) {
  wLeft = screen.width / 2 - width / 2;
  wTop = screen.height / 2 - height / 2;
  if (opener != null && opener.childWindow != null && opener.childWindow.open) {
    opener.childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else if (childWindow != null && childWindow.open) {
    childWindow.close();
    childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else
    childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
}
//======================================================================================================//
function NewScrollWindow(url, width, height) {
  wLeft = screen.width / 2 - width / 2;
  wTop = screen.height / 2 - height / 2;
  if (opener != null && opener.childWindow != null && opener.childWindow.open) {
    opener.childWindow.location.href = url;
    opener.childWindow.resizeTo(width, height);
    opener.childWindow.moveTo(wLeft, wTop);
  }
  else if (childWindow != null && childWindow.open) {
    childWindow.close();
    childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=1,status=0,scrollbars=1,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else
    childWindow = window.open(url, 'childWindow', 'location=0,toolbar=0,menubar=0,resizable=1,status=0,scrollbars=1,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
}
//======================================================================================================//
function NewPickDateWindow(url, width, height) {	
  wLeft = screen.width / 2 - width / 2;
  wTop = screen.height / 2 - height / 2;
  if (opener != null && opener.pickDateWindow != null && opener.pickDateWindow.open) {
    opener.pickDateWindow = window.open(url, 'pickDateWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else if (pickDateWindow != null && pickDateWindow.open) {
    pickDateWindow.close();
    pickDateWindow = window.open(url, 'pickDateWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else
    pickDateWindow = window.open(url, 'pickDateWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop); 
    }
//======================================================================================================//
function NewMemberWindow(url, width, height) {	
  wLeft = screen.width / 2 - width / 2;
  wTop = screen.height / 2 - height / 2;
  if (opener != null && opener.NewMemberWindow != null && opener.NewMemberWindow.open) {
    opener.NewMemberWindow = window.open(url, 'NewMemberWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else if (NewMemberWindow != null && NewMemberWindow.open) {
    NewMemberWindow.close();
    NewMemberWindow = window.open(url, 'NewMemberWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop);
  }
  else
    NewMemberWindow = window.open(url, 'NewMemberWindow', 'location=0,toolbar=0,menubar=0,resizable=0,status=0,scrollbars=0,width=' + width + ',height=' + height + ',left=' + wLeft + ',top=' + wTop); 
    }
