if (document.implementation && document.implementation.createDocument) 
{
	XMLDocument.prototype.selectNodes = function(sExpr, contextNode)
	{
		var oResult = this.evaluate(sExpr, 
                                    (contextNode ? contextNode:this), 
                                    this.createNSResolver(this.documentElement),
                                    XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
		var nodeList = new Array(oResult.snapshotLength);
		nodeList.expr = sExpr;
		for(i = 0; i < nodeList.length; i++)
			nodeList[i] = oResult.snapshotItem(i);
		return nodeList;
	};
    
	Element.prototype.selectNodes = function(sExpr)
	{
		var doc = this.ownerDocument;
		if(doc.selectNodes)
			return doc.selectNodes(sExpr, this);
		else
			throw "Method selectNodes is only supported by XML Nodes";
	};
	
	XMLDocument.prototype.selectSingleNode = function(sExpr, contextNode)
	{
		var ctx = contextNode?contextNode:null;
		sExpr += "[1]";
		var nodeList = this.selectNodes(sExpr, ctx);
		if(nodeList.length > 0)
			return nodeList[0];
		else 
			return null;
	};

	Element.prototype.selectSingleNode = function(sExpr)
	{
		var doc = this.ownerDocument;
		if(doc.selectSingleNode)
			return doc.selectSingleNode(sExpr, this);
		else
			throw "Method selectSingleNode is only supported by XML Nodes";
	};
	
	HTMLElement.prototype.__defineGetter__("innerText", function(){
			var tmp = this.innerHTML.replace(/<br>/gi,"\n");
			return tmp.replace(/<[^>]+>/g,"");
	});

	HTMLElement.prototype.__defineSetter__("innerText", function(txtStr){
		var parsedText = document.createTextNode(txtStr);
		this.innerHTML = "";
		this.appendChild( parsedText );
	});
}

var XmlServer = new DbNetServer()

DbNetLink.prototype.isIE = false;
DbNetLink.prototype.IEVersion = -1;
DbNetLink.prototype.getEventSrcElement = DbNetLink_getEventSrcElement
DbNetLink.prototype.getParentElement = DbNetLink_getParentElement
DbNetLink.prototype.openModalDialog = DbNetLink_openModalDialog
DbNetLink.prototype.openNonModalDialog = DbNetLink_openNonModalDialog
DbNetLink.prototype.openDialog = DbNetLink_openDialog
DbNetLink.prototype.textFromNode = DbNetLink_textFromNode
DbNetLink.prototype.getElementById = DbNetLink_getElementById
DbNetLink.prototype.elementAttribute = DbNetLink_elementAttribute;


DbNetLink.prototype.sizeDialog = DbNetLink_sizeDialog
DbNetLink.prototype.centreDialog = DbNetLink_centreDialog

var dbNetPage = new DbNetLink()

/////////////////////////////////////////////////////////////////////
function DbNetLink()
//////////////////////////////////////////////////////////////////////
{
	if (document.all)
		this.isIE = true;
	
	if ( this.isIE )
	{
		navigator.userAgent.toLowerCase().match(/msie (\d{1,}\.\d{1,})/)
		if ( RegExp.$1 != "" )
			this.IEVersion = parseFloat( RegExp.$1 );
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_getElementById(rootNode, id)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (rootNode == null) alert("root node is null " + id)
	if (rootNode.all)
		return rootNode.all[id];
	else
	{
		if (rootNode.getElementsByTagName) 
		{		
			var all = rootNode.getElementsByTagName('*');	
			for (i=0; i < all.length; i++) 
			{
				if (all[i].getAttribute)
					if (all[i].getAttribute('id'))
						if (all[i].getAttribute('id').toLowerCase() == id.toLowerCase()) 
							return all[i];	
			}
		}	
	}
	return null;
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_textFromNode(n)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (n == null)
		return '';

	if (n.text)
			return n.text;

	if (n.childNodes.length > 0)
	{
		var returnText = '';
		for (var i = 0; i < n.childNodes.length; i++)
			returnText += n.childNodes[i].nodeValue;
		return (returnText);
	}

	return '';
}

//////////////////////////////////////////////////////////////////////
function DbNetLink_getEventSrcElement( event )
//////////////////////////////////////////////////////////////////////
{
	return (this.isIE) ? event.srcElement : event.target
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_getParentElement( e, tagName )
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	while ( e.tagName != tagName.toUpperCase() )
	{
		if ( e.parentNode )
			e = e.parentNode;
		else
			break;
	}
	return e;
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_openModalDialog(url, winName, args, features)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	this.openDialog(url, winName, args, true, features)
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_openNonModalDialog(url, winName, args, features)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	return ( this.openDialog(url, winName, args, false, features) )
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_openDialog(url, winName, args, modal, optFeatures)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var top = (parseInt(window.screen.availHeight) -100) / 2;
	var left = (parseInt(window.screen.availWidth) -100) / 2;

	winName += (this.isIE) ? "" : ("_" + new Date().valueOf());

	var features;
	if (typeof(optFeatures) == 'undefined')
		optFeatures = '';

	if (window.showModalDialog)
	{
		features = "dialogHeight=200px;dialogWidth=200px;status=yes;help=no;resizable=yes";
		if (optFeatures != '')
			features += ';' + optFeatures.replace(/\,/g,';');
		if (modal)
			return window.showModalDialog(url, args, features)
		else
			return window.showModelessDialog(url, args, features)
	}
	else
	{		
		features = "top=" + top + ",left=" + left + ",toolbar=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,dependent=yes,modal=yes"
		if (optFeatures != '')
			features += ',' + optFeatures.replace(/\;/g,',').replace('dialogHeight', 'height').replace('dialogWidth', 'width');
		if ( features.indexOf('height=' < 0) )
			features += ',height=100px'
		if ( features.indexOf('width=' < 0) )
			features += ',width=100px'
		
		if (!window.dialogArguments)
			window.dialogArguments = new Object();
		window.dialogArguments[winName] = args;

		return window.open(url, winName, features);
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_elementAttribute( e, id, v )
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if ( e[id] )
		return e[id];
	else if ( e.getAttribute( id ) )
		return e.getAttribute( id );
	else
		return (v) ? v : null;
}

//////////////////////////////////////////////////////////////////////////////////////////////
function getWindowArguments()
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (opener)
		if (opener.dialogArguments)
			return opener.dialogArguments[ window.name ];

	if (window.dialogArguments)
		return window.dialogArguments;

	return null;
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_centreDialog()
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var h = parseInt(window.screen.availHeight);
	var w = parseInt(window.screen.availWidth);

	if (window.dialogTop)
	{
		var left = (w - parseInt(window.dialogWidth)) / 2;
		var top = (h - parseInt(window.dialogHeight)) / 2;
		window.dialogTop = top + "px";
		window.dialogLeft = left + "px";
	}
	else
	{
		var left = (w - window.outerWidth) / 2;
		var top = (h - window.outerHeight) / 2;
		window.moveTo(left, top);
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetLink_sizeDialog( centre )
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (typeof(centre) == 'undefined')
		centre = true;

	if (!document.all)
	{
		window.sizeToContent();
	}
	else
	{
		var layout = document.getElementById('layout');
		if ( ! layout )
		 layout = document.body.childNodes[0];

		var xpad = 0;
		var ypad = 0;
		
		if ( this.IEVersion < 7 )
		{
			xpad = this.elementAttribute( layout, "xpad", 10);
			ypad = this.elementAttribute( layout, "ypad", 30);

		}
		
		var h = (parseInt(layout.offsetHeight) + parseInt(ypad));
		var w = (parseInt(layout.offsetWidth) +  parseInt(xpad));

		var h2 = (parseInt(layout.offsetHeight) + (layout.ypad ? parseInt(layout.ypad): 30))
		var w2 = (parseInt(layout.offsetWidth) + (layout.xpad ? parseInt(layout.xpad): 10))


		window.dialogHeight = h2 + "px";
		window.dialogWidth = w2 + "px";
	}

	if (centre)
		this.centreDialog();
}


//////////////////////////////////////////////////////////////////////
function sendContactForm()
//////////////////////////////////////////////////////////////////////
{
	if (document.all.text.value == '')
	{
		message('Please enter your message')
		return
	}

	if ( !validEmail(document.all.from.value) )
	{
		message('Invalid email address')
		document.all.from.focus()
		return
	}

	var xmlObj = new Object()
	xmlObj.to = document.all.to.value
	xmlObj.from = document.all.from.value
	xmlObj.subject = document.all.subject.value
	xmlObj.text = document.all.text.value

	var xml = buildXmlString(xmlObj);
	

	if ( XmlServer.call(xml, "send") )
	{
		document.all.from.value = ''
		document.all.subject.value = ''
		document.all.text.value = ''

		if ( XmlServer.getNodeValue("status") == 'ok' )
			message("Your message has been sent.")
		else
			message("Error --> " + XmlServer.getNodeValue("status") )
	}

}

////////////////////////////////////////////////////////////////
function validEmail(src) 
////////////////////////////////////////////////////////////////
{
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
}

//////////////////////////////////////////////////////////////////////////////////////////////
function message(messageText, scroll)
//////////////////////////////////////////////////////////////////////////////////////////////
{ 
	if (typeof(scroll) == "undefined")
		scroll = false

	document.getElementById("messageLine").innerHTML = messageText
	if (messageText != '&nbsp;') 
	{
		document.getElementById("messageLine").style.backgroundColor = 'gold'
		if (scroll)
			document.getElementById("messageLine").scrollIntoView()
		window.setTimeout("message('&nbsp;')",3000)
	}
	else
		document.getElementById("messageLine").style.backgroundColor = ''
}

/////////////////////////////////////////////////////////////////////////////////////////////
function buildXmlString(xmlObj)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var xmlString = "<root>"

	for (var node in xmlObj )
		xmlString += buildNode(node, xmlObj[node]);
	
	xmlString += "</root>"

	return (xmlString)

}

/////////////////////////////////////////////////////////////////////////////////////////////
function buildNode(nodeName, nodeValue)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	return '<' + nodeName + '><![CDATA[' + nodeValue + ']]></' + nodeName + '>'
}

DbNetServer.prototype.textFromNode = DbNetServer_textFromNode
DbNetServer.prototype.call = DbNetServer_call
DbNetServer.prototype.get = DbNetServer_get
DbNetServer.prototype.getNode = DbNetServer_getNode
DbNetServer.prototype.processResponse = DbNetServer_processResponse
DbNetServer.prototype.getNodeValue = DbNetServer_getNodeValue
DbNetServer.prototype.xml = DbNetServer_getXml
DbNetServer.prototype.fileExists = DbNetServer_fileExists
DbNetServer.prototype.checkReadyState = DbNetServer_checkReadyState

DbNetServer.prototype.silent = false
DbNetServer.prototype.debug = false
DbNetServer.prototype.showBusy = false
DbNetServer.prototype.callbackFunction = null

/////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer()
/////////////////////////////////////////////////////////////////////////////////////////////
{
	this.XmlHttp = getXmlHttp()

	if (this.XmlHttp == null)
	{
		alert("Could not create XmlHttp object")
		return
	}
	
	this.XmlDoc = null
	this.text = ''
}

/////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_call(xml, method, url, returnText, showErrorStatusText)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	if (xml.indexOf('<root>') != 0 )
		xml = '<root>' + xml + '</root>'

	if (!url)
		url = document.location.href.split('&')[0]

	url = url.replace(/#/,'')
	url += (( url.indexOf('?') == -1) ? '?' : '&') + 'method=' + method

	this.XmlDoc = null
	this.text = ''

	if ( this.showBusy )
		window.document.body.style.cursor = 'wait'		

	if ( this.callbackFunction )
	{
		this.XmlHttp.open( "POST", url, true )
		this.XmlHttp.onreadystatechange = this.checkReadyState(this)
	}
	else
		this.XmlHttp.open( "POST", url, false )

	this.XmlHttp.setRequestHeader( "Content-Type","text/XML" )
	this.XmlHttp.send( xml )

	if ( this.showBusy )
		window.document.body.style.cursor = ''	

	this.url = url
	this.showErrorStatusText = showErrorStatusText
	this.returnText = returnText

	if ( this.callbackFunction )
	{
		window.XmlHttp = this.XmlHttp
		return true
	}

	return this.processResponse()
}


/////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_get(url)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	this.XmlHttp.open( "GET", url, false )
	this.XmlHttp.send()

	if ( this.XmlHttp.status == 200 )
		return this.XmlHttp.responseText
	else
		return null
}


/////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_processResponse()
/////////////////////////////////////////////////////////////////////////////////////////////
{
	if ( this.debug )
	{
		alert( this.XmlHttp.responseText )
		alert( this.XmlHttp.status )
		alert( this.XmlHttp.statusText )
		alert( this.XmlHttp.responseXML.xml )
	}

	if (this.XmlHttp.status != 200 || ( ( this.XmlHttp.responseXML == null) || ( this.XmlHttp.responseXML.xml == "" ) ) )
	{
		if ( this.XmlHttp.status == 404 )
		{
				alert("Page: " + this.url + " not found.")
				return false
		}
		if (this.silent == true)
		{
				this.silent = false
				return false
		}
		if ( this.XmlHttp.status == 999 && this.showErrorStatusText && this.XmlHttp.statusText != '')
		{
				alert(this.XmlHttp.statusText)
				return false
		}

		if ( this.XmlHttp.responseText != '' )
		{
			if (this.returnText)
			{
				this.text = this.XmlHttp.responseText
				return true
			}
			else
			{
				if (( this.XmlHttp.responseXML == null) || ( this.XmlHttp.responseXML.xml == "" ) && this.XmlHttp.responseXML.parseError)
				{
					var errorReason = (dbNetPage.isIE) ? this.XmlHttp.responseXML.parseError.reason : this.XmlHttp.statusText
					var errorCode = (dbNetPage.isIE) ? this.XmlHttp.responseXML.parseError.errorCode : "No error code available"
					alert("XML Parse Error: " + errorReason  + " (" + errorCode + ")" )
				}

				showContent(this.XmlHttp.responseText)
				return false
			}	
		}
		else
			return false
	}

	this.silent = false
	this.XmlDoc = this.XmlHttp.responseXML
	return true

}

////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_checkReadyState(XmlSvr)
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	return function()
	{
		if ( XmlSvr.XmlHttp.readyState != 4 )
			return
	
		if ( XmlSvr.processResponse() )
			XmlSvr.callbackFunction()
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_getNode( nodeName )
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	if (this.XmlDoc == null)
	{
		alert( "No valid XML document (" + nodeName + ")" )
		return null
	}
	else
		return ( this.XmlDoc.selectSingleNode("//" + nodeName) );
}

//////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_textFromNode(n)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (n == null)
		return '';

	if (n.text)
			return n.text;

	if (n.childNodes.length > 0)
	{
		var returnText = ''
		for (var i = 0; i < n.childNodes.length; i++)
			returnText += (n.childNodes[i].nodeValue != 'null') ? n.childNodes[i].nodeValue : "";
		return (returnText)
	}

	return '';
}


////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_getNodeValue( nodeName )
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	if (this.getNode(nodeName))
		return( this.textFromNode( this.getNode(nodeName) ) )
	else
		return ''
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_getXml()
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	return this.XmlDoc.documentElement.xml
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function DbNetServer_fileExists(url)
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	this.XmlHttp.open( "GET", url, false )
	this.XmlHttp.send( "" )
	return (this.XmlHttp.status == 200) 
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function getXmlHttp()
////////////////////////////////////////////////////////////////////////////////////////////////////
{
	var xmlHttpProgIds = 'MSXML2.XMLHTTP,Microsoft.XMLHTTP';
	var xmlHttp = null

	if (window.XMLHttpRequest) 
		xmlHttp = new XMLHttpRequest();
	else
		if (window.ActiveXObject)
		{
			var arr = xmlHttpProgIds.split(",");

			for (var i in arr)
			{
				try
				{
					xmlHttp = new ActiveXObject( arr[i] );
				}
				catch(e)
				{
					continue;
				}
				break;
			}
		}
	return (xmlHttp)
}


/////////////////////////////////////////////////////////////////////////////////////////////
function showContent(text)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var win = window.open("about:blank",null,'toolbars=no,height=500,width=500,resizable=yes')
	win.document.open()
	win.document.write(text)
	win.document.close()
}

//////////////////////////////////////////////////////////////////////////////////////////////
function navigate(page)
//////////////////////////////////////////////////////////////////////////////////////////////
{ 
	location.href=page
}

//////////////////////////////////////////////////////////////////////////////////////////////
function showWebHelp(url)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var width = parseInt(window.screen.availWidth * 0.8)
	var height = parseInt(window.screen.availHeight * 0.8)
	var options = 'toolbars=no,height=' + height + ',width=' + width + ',resizable=yes'
	var win = window.open(url,null,options)
}

//////////////////////////////////////////////////////////////////////////////////////////////
function viewSource(e)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var width = parseInt(window.screen.availWidth * 0.8)
	var height = parseInt(window.screen.availHeight * 0.8)
	var url = '/shared/viewsource.aspx?'

	if (document.frames)
	{
		if (document.frames.length != 0)
		{
			url += "url=" + document.frames[0].document.location.href
		}
		else
			url += "faqid=" + e
	}
	else
	{
		if (window.length != 0)
		{
			url += "url=" + window.frames[0].document.location.href
		}
		else
			url += "faqid=" + e
	}
	
	window.open(url, null, "width=" + width + ",height=" + height + ", status=no, help=no, resizable=yes");
}

////////////////////////////////////////////////////////////////////////////////////////////////////
function formatNumber(expr, decplaces) {
////////////////////////////////////////////////////////////////////////////////////////////////////
	var decimalSymbol = '.'
	if (isNaN(expr) || expr == '')
		return expr

	if (!decplaces)
		decplaces = 2
	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));

	while (str.length <= decplaces) 
	{
		str = "0" + str;
	}

	var decpoint = str.length - decplaces;

	return str.substring(0,decpoint) + decimalSymbol + str.substring(decpoint, str.length);
}

var privacyWin

////////////////////////////////////////////////////////////////
function showPrivacyPolicy()
////////////////////////////////////////////////////////////////
{
	if (privacyWin)
		privacyWin.close()

	var leftPos=(window.screen.availWidth-500)/2
	var topPos=(window.screen.availHeight-350)/2
	var posStr=('left='+leftPos+',top='+topPos+',width=500,height=350,toolbar=no')
	privacyWin=window.open('../shared/privacy.htm', null, posStr)
}

/////////////////////////////////////////////////////////////////////////////////////////////
function copyToClipboard( id )
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var e
	if ( typeof(id) == "string" )
		e = document.all[ id ]
	else
		e = id
		
	if ( !e )
		return

	var textRange
	
	try
	{
		textRange = e.createTextRange()
	}
	catch(ex)
	{
		textRange = document.body.createTextRange()
		textRange.moveToElementText(e);
		textRange.select()
	}

	textRange.execCommand('Copy')

	if (document.selection)
		document.selection.clear()

	alert('Copied')
}


//////////////////////////////////////////////////////////////////////////////////////////////
function windowOpen(win) 
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (win)
		if (!win.closed)
			return true

	return false
}

var screenshotWindow

//////////////////////////////////////////////////////////////////////////////////////////////
function showScreenShot(image, text, flashDemoLink)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var sURL = "/shared/screenshotview.aspx?image=" + encodeURIComponent(image) + "&text=" + encodeURIComponent(text) + "&flashDemoLink=" + encodeURIComponent(flashDemoLink) 
	
	if (windowOpen(screenshotWindow))
	{
		screenshotWindow.navigate(sURL)
		screenshotWindow.focus()
	}
	else
		screenshotWindow = window.open(sURL, null, ";help=no;resizable=yes;scroll=no;")
}

/////////////////////////////////////////////////////////////////////////////////////////////
function buildURL(demoID, recordId, searchToken)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var url = getAppFromURL()
	
	if (demoID != "" && demoID != null )
		url += "section=" + demoID
	if (searchToken != "" && searchToken != null )
		url += "&searchtoken=" + searchToken
	if (recordId != "" && recordId != null )
		url += "&recordid=" + recordId 
	return (url)
}

//////////////////////////////////////////////////////////////////////////////////////////////
function getAppFromURL()
//////////////////////////////////////////////////////////////////////////////////////////////
{
	var app = window.location.href.replace(/#/ig, "").split('/');
	app = app[app.length-1]
	app = app.split('?')
	app = app[0]
	return (app + "?")
}

//////////////////////////////////////////////////////////////////////////////////////////////
function selectdemo(demoID) 
//////////////////////////////////////////////////////////////////////////////////////////////
{	
	document.location = buildURL(demoID)
}

////////////////////////////////////////////////
function displayStrapLine()
////////////////////////////////////////////////
{
	if ( ! document.getElementById("strapLine") )
		return

	if ( strapLineIdx == strapLines.length )
		strapLineIdx = 0

	var e = document.all.strapLine

	if ( typeof( window.createPopup ) == "object" )
	{
		e.filters[0].Apply();
		e.filters[0].transition = 12;
		e.filters[0].Play();
	}

	var html = strapLines[strapLineIdx].split('~')
	var img = ""
	if (html.length > 1)
		img = "<img src='images/icons/" + html[1] + "'>&nbsp;"
	e.innerHTML = "<table style='border:1pt outset;background-color:whitesmoke'><tr><td style='vertical-align:top'>" + img + "</td><td style='text-align:left;width:100%;vertical-align:middle'>" + html[0] + "</td></tr></table>"
	strapLineIdx++
}

////////////////////////////////////////////////
function addStrapLine()
////////////////////////////////////////////////
{
	displayStrapLine()
	window.setInterval( displayStrapLine, 5000 )
}

/////////////////////////////////////////////////////////////
function hideTableCells( cellCollection, classNameToHide )
/////////////////////////////////////////////////////////////
{
	cellCollection = document.getElementsByTagName( cellCollection )
	for (var i = 0; i < cellCollection.length; i++)
	{
		var cell = cellCollection[i]
		if (cell.className == classNameToHide)
			cell.style.display = "none"
	}
}

// Common Mozilla & IE functions
/////////////////////////////////////////////////////////////
function displayImage(e)
/////////////////////////////////////////////////////////////
{	
	var html = "<scr" + "ipt>function sizeWin(){var w=document.getElementById('previewImg').width+20; var h=document.getElementById('previewImg').height+80;var l = parseInt((window.screen.availWidth - w)/2);var t = parseInt((window.screen.availHeight - h)/2);window.resizeTo(w,h);window.moveTo(l,t);}</sc" + "ript><body leftMargin=0 topMargin=0 scroll=no onload=sizeWin()><img id=previewImg src=" + e.src.replace("_thumb","") + "></img></body>"
	var w = window.open("",null,"height=300,width=300,toolbars=no,resizable=yes")
	w.document.open()
	w.document.write(html)
	w.document.close()

	w.focus()
}
