function Lopen(path){
}
function openWin(url){
	window.open (url,"UCCAWindow","menubar=0,resizable=0,scrollbars=1,width=400,height=500"); 
}
function dsp_by_id(divID){
	document.getElementById(divID).style.display = "block"
}

function hide_by_id(divID){
	document.getElementById(divID).style.display = "none"
}

function showHide_id(divID){
	if (document.getElementById(divID).style.display == "inline"){
		document.getElementById(divID).style.display = "none"
	}else{
		document.getElementById(divID).style.display = "inline"
	}
}

function hide_by_id(divID){
	document.getElementById(divID).style.display = "none"
}

//Added by NP - Avoids the :hover issue in internet explorer.//
function hoverfix_over(src)
	{
		src.style.width = '148px'; 
		src.style.height = 'auto';
		src.style.backgroundcolor = '#eeeeee';
		src.style.backgroundimage = 'url("/images/UCCA/bg-dropdown.gif")';
		src.style.backgroundrepeat = 'no-repeat';
		src.style.zIndex = '10';
		src.style.position = 'relative';
		document.getElementById('visible-holder').style.display = 'block';
	}

function hoverfix_out(src)
	{
		src.style.width= '148px'; 
src.style.height = '16px';
src.style.border = '1px solid #A4BF16';
src.style.overflow = 'hidden';
src.style.textalign = 'left';
src.style.padding ='0px';
src.style.margin = '0px';
src.style.zindex = '10';
src.style.backgroundcolor = '#A4BF16';
src.style.backgroundimage = 'url("/images/UCCA/bg-dropdown.gif")';
src.style.backgroundrepeat = 'no-repeat';
src.style.fontsize = '0.9em';
document.getElementById('visible-holder').style.display = 'none';
	}
	
// Show / Hide Collections menu in the gallery - Avoids the :hover issue in IE ( NP 21/11/06 )

// selection list page jump based on article id passed in:
function articleJump(articleID) {
	if( articleID != "" ){
		document.location.href = '/index.cfm?articleid='+articleID ;
	}
}

// Flash Player Version Detection - Rev 1.5
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;			
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}



//	*********************************************************
//	Program: 	Lightbox
//	Author:		Nick Power 2008
//	Summary		Displays Lightboxes and center positions.
//	*********************************************************

//	Functions Include:
//	-----------------
//
//	pageDimensions() - 2008
//	scrollDetect() - 2008
//	updatePos() - 2008
//	initLightbox() - 2008
//	hideLightbox() - 2008
//	
//	Stuff used with lightbox functions but can be used with other stuff
//	opacity - 5th Jan 2009 - fades the opacity of a HTML object in the DOM
//	fadeID - 5th Jan 2009 - Fades a HTML Element by its ID 
//	initAjax - 2008 - Initiates the Ajax object
// 	loadpage - 2008 - loads a page into a HTML element using AJAX and the innerHTML method.
// 




//	Function pageDimensions
//	=======================
//
//	Original Author:	Nick Power, 2008
//
//	Summary: 			Returns dimensions of the viewport, page and scrolling. This function is used by the 
//						Lightbox features throughout the university college website.
//
//	Parameters (In):	itemWidth - The width (in pixels) of the element which is to be positioned absolutely 
//						centred.

function updatePos(){
	
	//We'll need to declare some variables to store the dimensions.
	var viewPortWidth;
	var viewPortHeight;
	
	var scrollX;
	var scrollY;
	
	var windowWidth;
	var windowHeight;
	
	//var boxWidth = 760;
	//var boxHeight = 500;

	if (document.getElementById('setLightBoxDimensions')){
		var boxWidth = parseInt(document.getElementById('setLightBoxDimensions').style.width);
		var boxHeight = parseInt(document.getElementById('setLightBoxDimensions').style.height);
	}else{
		var boxWidth = 500;
		var boxHeight = 430;
	}
	
	//var newDiv = document.createElement('DIV');
	//newDiv.innerHTML = 'boxWidth=' + boxWidth + ';boxHeight=' + boxHeight + ' ;';
	//document.getElementById('lightbox').appendChild(newDiv);
	
	//Depending on the browser, populate our variables with the dimensions.
	
	//Scrolling Dimensions
	if (window.pageYOffset||window.pageXOffset)
	{
		scrollX = window.pageXOffset;
		scrollY = window.pageYOffset;
	}
    else 
	{
		scrollX = (document.body.parentElement) ? document.body.parentElement.scrollLeft : 0;
		scrollY = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
		
	//alert(scrollX);
	// View Port Dimensions
	if (self.innerHeight) {	// all except Explorer
		viewPortWidth = self.innerWidth;
		viewPortHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		viewPortWidth = document.documentElement.clientWidth;
		viewPortHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		viewPortWidth = document.body.clientWidth;
		viewPortHeight = document.body.clientHeight;
	}	
		
	// Window Dimensions
	windowWidth = document.body.clientWidth;
	windowHeight = document.body.clientHeight;
	
	scrollHeight = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	
	
	
	// Finallly-Work out the Box positioning
	
	//If there is a div with ID setLightBoxDimensions then use the top and left parameters of that div for out positioning. 
	
	//		> Grab Top, Left style property values
	
	//else
	
	// We wish to directly centre, so ...
	
	// 		> find middle point of the page (x and y)
	// 		> Now devide box width, height into 2
	// 		> Subtract this from our middle point
	

	boxX = Math.floor(viewPortWidth * 0.5) - (boxWidth / 2) + scrollX;
	boxY =  Math.floor(viewPortHeight * 0.5) - (boxHeight / 2) + scrollY;
	
	//Make sure values are at least zero
	if (boxX < 0){boxX=0;}
	if (boxY < 0){boxY=0;}

	//if the user resises the window smaller than the lightbox:
	
	//	Width - Do not move with scrolling or it will be infinite,  Keep to 0
	//	height - Move to the scroller position so that it is always visible.
	
	if (viewPortWidth < boxWidth){boxX = 0;}
	if (viewPortHeight < boxHeight){boxY = scrollY;}
	
	try{
	//Now position the Box and setup update the overlay
	if (document.getElementById('lightbox'))
	{
		var objOverlay = document.getElementById('overlay');
		var objLightbox = document.getElementById('lightbox');
	}
	
	objOverlay.style.width = '100%';
	objOverlay.style.height = viewPortHeight + 'px';
	objOverlay.style.top =  scrollHeight + 'px';

	if (boxY>=0 && boxX>=0){
	objLightbox.style.top = boxY + 'px';
	objLightbox.style.left =  boxX + 'px';
	}
	}catch(e){
		
	}
	
	//objLightbox.innerHTML = boxX + 'px';

}


//	Function scrollDetect
//	=======================
//
//	Original Author:	Nick Power, 2008
//
//	Summary: 			Keeps the pageDimensions function operating at a certain interval.  This is so that 
//						position is 			
//						updated straight away if the user resizes the browser window, maximises, etc

function scrollDetect(){
	//Make an initial call to populate the variables.
	updatePos();
	
	//Set an interval to repeat the operation of our function
	lightboxPos = setInterval("updatePos()", 250);
	
}


//	Function initAJAX
//	=======================
//
//	Original Author:	Nick Power, 2008
//
//	Summary: 			Creates a Http Request ready for any AJAX, Makes a request and returns it into a element.

//	Parameters:			target - ID of the target element. innerHTML of this element will be set.

var xmlHttp;
function initAJAX(target){
//Setup Ajax Object
//Npower 
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      }
    }
  }
// Provide the user with a Loading message...
document.getElementById(target).innerHTML='<p><small>Loading...</small></p>';
xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)//Ok
      {
      document.getElementById(target).innerHTML=xmlHttp.responseText;
      }
    }

}
function loadPage(pageURL,target){
// Initiate / Create LightBox
// Show Add Category Wizard in Lightbox
// Npower 2008
if (target=='lightbox'){
	showLightbox();
}

initAJAX(target);
xmlHttp.open("GET",pageURL,true);
xmlHttp.send(null);
}

function processForm(script,frm,target){
//Set Defaults
//Npower 2008
var theForm = document.forms[frm]
var frmData = ""
//Detect if the form has File Data
   for(i=0; i<theForm.elements.length; i++){
   		if (theForm.elements[i].type=='checkbox'){
			if (theForm.elements[i].checked){
			frmData += theForm.elements[i].name + '=' + theForm.elements[i].value;
	if (i<theForm.elements.length){frmData+='&';}
			}
		}else{
			frmData += theForm.elements[i].name + '=' + theForm.elements[i].value;
	if (i<theForm.elements.length){frmData+='&';}
		}
}
if (target.length > 0){
initAJAX(target);
}
xmlHttp.open("POST",script,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", frmData.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(frmData);
}
//Function Showlightbox - Nick Power 2008
function showLightbox()
{
	
		// Lightbox and Overlay Elements
		objOverlay = document.getElementById('overlay');
		objLightbox = document.getElementById('lightbox');
	
		objLightbox.style.height = "auto";
		objLightbox.style.width = "auto";
		
		// Hide select boxes as they will 'peek' through the image in IE
		selects = document.getElementsByTagName("select");
        for (i = 0; i != selects.length; i++) {
                selects[i].style.visibility = "hidden";
        }

		//Fade the lightbox into display
		
		//set opacity to zero
		changeOpac(0,'overlay');
		
		if (fadeID('overlay',0,80,500)){
			objLightbox.style.display = 'block';
		}
		
		if (fadeID('lightbox',0,100,600)){
			objOverlay.style.display = 'block';
		}

		//For the gallery
		if (document.getElementById('gall-view-full-image'))
		{
			document.getElementById('gall-view-full-image').style.display = 'none';
		}
		
		if (document.getElementById('featureimg'))
		{
			document.getElementById('featureimg').style.visibility = 'hidden';
		}
		
		//document.getElementById('lightbox').style.width = '500px';
		
		//Start the function that detects dinmensions and positions the lightbox
		scrollDetect();
		
		//Stop scroll movement on the body (this is reverted in hidelightbox function)
		
		// View Port Dimensions
	if (self.innerHeight) {	// all except Explorer
		viewPortWidth = self.innerWidth;
		viewPortHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		viewPortWidth = document.documentElement.clientWidth;
		viewPortHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		viewPortWidth = document.body.clientWidth;
		viewPortHeight = document.body.clientHeight;
	}	
		
		//if (document.body.style.height = viewPortHeight + 'px'){alert('Body height ok')};
		//if (document.body.style.width = viewPortWidth - 17 + 'px'){alert('Body width ok')};
		//if (document.body.style.overflow = 'hidden'){alert('Body overflow ok')};
		
		document.body.style.height = viewPortHeight + 'px';
		document.body.style.width = viewPortWidth - 17 + 'px';
		document.body.style.overflow = 'hidden';
		
		return false;
	}
	
		
	//Cookie Funtions - NPOWER
	
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	//For functions like Do Not Display again etc
	//NPOWER
	
	function lightboxToggle(type,value){
		if (type==0&&value==0){// Display 
		
		var expDate = new Date("June 24, 1985");
		expDate = expDate.toGMTString();
		
			//Write a cookie if possible (erase by using a date in the past)
			document.cookie = "type0=x; expires=" + expDate+ "; path=/";
			
		}
		else if (type==0&&value==1){// Do not display
		
		var FutDate = new Date("September 1, 2009"); //end of clearing date
		//this expiry exists so that the cookie/feature can be used again in the future.
		FutDate = FutDate.toGMTString();
		
		//Write a cookie if possible
			document.cookie = "type0=1; expires=" + FutDate + "'; path=/";
			
		}
		else if (type==0&&value==3){// Read cookie
		//Read the cookie
		
		if (readCookie('type' + type)&&readCookie('type' + type)==1){
			
		}else{//Not present then show lightbox
		
		//Flash movie will only execute its Actionscript if its shown on a page the same as its hosting domain.
		
		//So detect the domain and then execute lightbox accordingly...
		
		//For example, Do we need "www." or not ?
	
			if(window.location.host == 'www.ucreative.ac.uk'){
				loadPage("http://www.ucreative.ac.uk/webapps/splashLightbox/clearing2009.cfm","lightbox");
				//updatePos();
				clearInterval(lightboxPos);
				document.getElementById('lightbox').style.top = '100px';
				document.getElementById('lightbox').style.left = '180px';
				
			}else{
				loadPage("http://ucreative.ac.uk/webapps/splashLightbox/clearing2009.cfm","lightbox");
				//updatePos();
				clearInterval(lightboxPos);
				document.getElementById('lightbox').style.top = '100px';
				document.getElementById('lightbox').style.left = '180px';	
				
			}
			
		}
		
		}
	}
	
//
// hideLightbox()
//
function hideLightbox()
{
	// get objects
	objOverlay = document.getElementById('overlay');
	objLightbox = document.getElementById('lightbox');

	//fade it out of display and then set display:block when fading had completed
		if (fadeID('lightbox',100,0,400)){
			
			objLightbox.style.display = 'none';
			objLightbox.innerHTML = '';
		}
		
		if (fadeID('overlay',80,0,400)){
			
			objOverlay.style.display = 'none';
			objLightbox.innerHTML = '';
			
		}


	// make select boxes visible
	selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}

	
	//For the gallery
		if (document.getElementById('gall-view-full-image'))
		{
			document.getElementById('gall-view-full-image').style.display = 'block';
		}
		
		if (document.getElementById('featureimg'))
		{
			document.getElementById('featureimg').style.visibility = 'visible';
		}

	//restore the visible and srollable state for body
	document.body.style.height = 'auto';
	document.body.style.overflow = 'visible';
	

}



function initLightbox()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "lightbox")){
			anchor.onclick = function () {showLightbox(this); return false;}
		}
	}

		
	var objBody = document.getElementsByTagName("body").item(0);
	
	// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','overlay');
	objOverlay.onclick = function () {hideLightbox(); return false;}
	objOverlay.style.display = 'none';
	objOverlay.style.position = 'absolute';
	objOverlay.style.top = '0';
	objOverlay.style.left = '0';
	objOverlay.style.zIndex = '90';
 	objOverlay.style.width = '100%';
	objBody.insertBefore(objOverlay, objBody.firstChild);
	
	// create lightbox div, same note about styles as above
	//var objLightbox = document.createElement("div");
	if (document.getElementById("lightbox")){
		var objLightbox = document.getElementById("lightbox");
	}else{
		var objLightbox = document.createElement("div");
		objLightbox.setAttribute('id','lightbox');
	}
	objLightbox.setAttribute('id','lightbox');
	objLightbox.style.display = 'none';
	objLightbox.style.position = 'absolute';
	objLightbox.style.zIndex = '100';	
	objBody.insertBefore(objLightbox, objOverlay.nextSibling);
	
	// create link
	var objLink = document.createElement("a");
	objLink.setAttribute('href','#');
	objLink.setAttribute('title','Click to close');
	objLink.onclick = function () {hideLightbox(); return false;}
	objLightbox.appendChild(objLink);

}

//2009, Npower

//fadeID - Fades an HTML object by its ID
// Example usage:

// 	fadeID('body',10,100,500);
// 	
//	This would fade the body object from 10% opacity until 100% which a delay of 500 milliseconds in between 
//	each percentage increment.

function fadeID(elementID,opacityStart,opacityEnd,delay) { 
      
   //set some defaults
    var speed = Math.round(delay / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacityStart > opacityEnd) { 
        for(i = opacityStart; i >= opacityEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + elementID + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacityStart < opacityEnd) { 
        for(i = opacityStart; i <= opacityEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + elementID + "')",(timer * speed)); 
            timer++; 
        } 
    } 
	
	//return true to indicate fading has completed - used in some lightboxing functions
	return true;
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
	
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

//End of the Lightbox functions, NP 2008

//Flash JS
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

