function OpenWindowCentreOnOpener( url, name, window_width, window_height ) {
	var root = window.top;

	var opener_width = root.document.body.clientWidth;
	var opener_height = root.document.body.clientHeight;
	var opener_left = root.screenLeft;
	var opener_top = root.screenTop;
	var window_left = Math.max( opener_left + ( ( opener_width - window_width ) / 2 ), 0 );
	var window_top  = Math.max( opener_top + ( ( opener_height - window_height ) / 2 ), 0 );
		
	win = window.open( url, name, 'width=' + window_width + ',height=' + window_height + ',left=' + window_left +',top=' + window_top + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes' );
	win.focus();
	
	return win;
}

function CorrectPNG() {
   var arVersion = navigator.appVersion.split( "MSIE" );
   var version = parseFloat( arVersion[1] );
   if( ( version >= 5.5 ) && ( version < 7.0 ) && ( document.body.filters ) ) {
      for( var i=document.images.length; --i >= 0; ) {
         var img = document.images[i];
         var imgName = img.src.toUpperCase();
         if( imgName.substring( imgName.length-3, imgName.length ) == "PNG" ) {
            var imgID = ( img.id ) ? "id='" + img.id + "' " : "";
            var imgClass = ( img.className ) ? "class='" + img.className + "' " : "";
            var imgTitle = ( img.title ) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
            var imgStyle = "display:inline-block;" + img.style.cssText; 
            if( img.align == "left" ) imgStyle = "float:left;" + imgStyle;
            if( img.align == "right" ) imgStyle = "float:right;" + imgStyle;
            if( img.parentElement.href ) imgStyle = "cursor:hand;" + imgStyle;
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
            img.outerHTML = strNewHTML
         }
      }
   }
}

function SetParentFrameParameters(params) {
    var queryStringStartIndex = parent.parent.location.href.indexOf("?");
    if (queryStringStartIndex != -1) {
        var entireLocation = parent.parent.location.href.substring(0, queryStringStartIndex);
        var correctLocation = entireLocation + '?' + params;
        parent.parent.location = correctLocation;
    }
    else {
        parent.parent.location = parent.parent.location + '?' + params;
    }
}
