﻿// Script Provided By http://www.DesignerWiz.com
/********************************************************************
        Center-Size Window NN,IE v1.0 written By PV
//Feel free to use it on any page as long as you leave all comments
//as they are. So others can learn. 
//Any questions, suggestions, email me at PaulV420@usa.net
I will outline the script that you need, plus if you need the resize even handler
that will reload page when the user tries to resize the page.Thus makes it non-resizable
(note make sure there will be no scroll bars. if there is the resize will be triggered
and the page will be in constant loop of resizing)
There are also scripts for hiding layerrs, you don't need those i will out line what you need 
with comments. Have fun with this one. Updates coming!!
This Script was written by Paul Varshavsky
********************************************************************/
//Start script
function Is() {
  var agent = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.ns = ((agent.indexOf('mozilla')!=-1) &&
  ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible')== -1))); 
  this.ns4 = (this.ns && (this.major >= 4));
  this.ie = (agent.indexOf("msie") != -1);
  this.ie4 = (this.ie && (this.major >= 4));
}

function openWindow(windowUrl, windowName, windowW, windowH)
{
  var leftPos = (screen.availWidth - windowW)/2;
  var topPos = (screen.availHeight - windowH)/2;
  var win;

  win = window.open(windowUrl, windowName, "toolbar=0,menubar=0,location=0,status=0,scrollbars=1,width=" + windowW +
                 ",height=" + windowH + ",top=" + topPos + ",left=" + leftPos);
                 
  win.window.focus();
}

function openWindowEx(windowUrl, windowName, windowW, windowH)
{
  var openWindow;
  openWindow = window.open(windowUrl, windowName, "screenX=50,left=200,top=120,screenY=100,status=1,scrollbars=1,resizable=1,width=" + windowW +
                 ",height=" + windowH);
                 
  if(window.focus())
    openWindow.focus();
}

function CheckAll(checkAllBox, fieldName)
{
	var frm = document.forms['aspnetForm'];
	var actVar = checkAllBox.checked;
	for(i = 0; i < frm.length; i++)
	{
		e = frm.elements[i];
		if (e.type == 'checkbox' && e.name.indexOf(fieldName) != -1)
			e.checked = actVar ;
	}
}

function CheckAllEx(checkAllBox, fieldName)
{
	var frm = document.forms['form1'];
	var actVar = checkAllBox.checked;
	for(i = 0; i < frm.length; i++)
	{
		e = frm.elements[i];
		if (e.type == 'checkbox' && e.name.indexOf(fieldName) != -1)
			e.checked = actVar ;
	}
}