// JavaScript Document
var newWin = null;
function popUp(strURL, strHeight, strWidth)
	{
	if (newWin != null && !newWin.closed)
   		newWin.close();
 
 	var strOptions="";
	
	var centerWidth = (window.screen.width - strWidth) / 2;
    var centerHeight = (window.screen.height - strHeight) / 2;

 	strType = "console";
	if (strType=="console")
   		strOptions = "scrollbars,height=" + strHeight + ",width=" + strWidth + ",left=" + centerWidth + ",top=" + centerHeight;
 	if (strType=="fixed")
 		strOptions = "status,height=" + strHeight + ",width=" + strWidth;
 	if (strType=="elastic")
   		strOptions = "toolbar,menubar,scrollbars,"+"resizable,location,height=" + strHeight + ",width=" + strWidth;
 	
	newWin = window.open(strURL, 'newWin', strOptions);
 	newWin.focus();
	}
	
function popUp2(strURL, strHeight, strWidth)
	{
 	var strOptions="";
	
	var centerWidth = (window.screen.width - strWidth) / 2;
    var centerHeight = (window.screen.height - strHeight) / 2;

 	strType = "console";
	if (strType=="console")
   		strOptions = "scrollbars,height=" + strHeight + ",width=" + strWidth + ",left=" + centerWidth + ",top=" + centerHeight;
 	if (strType=="fixed")
 		strOptions = "status,height=" + strHeight + ",width=" + strWidth;
 	if (strType=="elastic")
   		strOptions = "toolbar,menubar,scrollbars,"+"resizable,location,height=" + strHeight + ",width=" + strWidth;
 	
	newWin2 = window.open(strURL, 'newWin2', strOptions);
 	newWin2.focus();
	}

//<a href="my-pop-up-window.htm" onclick="popUp(this.href,'console',400,200);return false;"  target="_blank">This is my link</a>


function popUp_refreshParent(strURL)
	{
  	self.opener.location = strURL;
	self.close();
	}


function textCounter(field, countfield, maxlimit)
	{
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
        // otherwise, update 'characters left' counter
    else
        countfield.value = maxlimit - field.value.length;
	}

