﻿// JScript File

/*-------------------------------------------------*/

function CPopUp_show()
{    
 if ( ( this.m_wReference == null )
    || this.m_wReference.closed )
  {
	
    var iScreenX = ( screen.width - this.m_iWidth ) / 2;
    var iScreenY = ( screen.height - this.m_iHeight ) / 2;

    var strFeatures = "resizable"
					+ ",scrollbars=yes,status=yes" 
					+ ",width=" + this.m_iWidth
                    + ",height=" + this.m_iHeight
                    + ",screenX=" + iScreenX // for Netscape
                    + ",screenY=" + iScreenY // for Netscape
                    + ",left=" + iScreenX    // for IE
                    + ",top=" + iScreenY     // for IE

    this.m_wReference = open( this.m_strURL,
                              this.m_strName,
                              strFeatures );
  }
  else
  {
	
    this.m_wReference.focus();
  }
}


function CPopUp( strURL, strName, iWidth, iHeight )
{
    
  this.m_strURL = strURL;
  this.m_strName = strName;
  this.m_iWidth = iWidth;
  this.m_iHeight = iHeight;
  this.m_wReference = null;
  this.show = CPopUp_show;
}

//Added by Daisy, 03/02/2005
//Populate Passed in date to the selected relevant text box
function populateDate(target, date){		
	document.getElementById(target).value = date;		
}

/*-------------------------------------------------*/

/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=50

function slowhigh(which2,newOpacity){
baseopacity=newOpacity
cleartimer()
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfadein(imgobj)",40)
}

function slowlow(which2,newOpacity){
baseopacity=newOpacity
cleartimer()
imgobj =which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(100)
highlighting=setInterval("gradualfadeout(imgobj)",30)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfadeout(cur2){
	if (browserdetect=="mozilla" && cur2.style.MozOpacity > (baseopacity / 100) )
		cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)-0.10, 0.99);
	else if (browserdetect=="ie" && cur2.filters.alpha.opacity > baseopacity)
		cur2.filters.alpha.opacity-=10;
	else if (window.highlighting)
		clearInterval(highlighting)
}

function gradualfadein(cur2){
	if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
		cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.10, 0.99)
	else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=10
	else if (window.highlighting)
		clearInterval(highlighting)
}


function showPopup(url, title, height, width){                
                var subForm = new CPopUp(url ,title, height,width);                
	            subForm.show();
                }