function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function TheFormCheck() {
if (document.form.email_from.value=="")if( document.form.telephone.value=="")if( document.form.name_from.value=="")
{
alert("name, email and telephone are required");
document.form.name_from.focus();return false
}
if (document.form.email_from.value=="")if( document.form.telephone.value=="")
{
alert("email and telephone are required");
document.form.email_from.focus();return false
}
if( document.form.telephone.value=="")if( document.form.name_from.value=="")
{
alert("name and telephone are required");
document.form.name_from.focus();return false
}
if (document.form.email_from.value=="")if( document.form.name_from.value=="")
{
alert("name and email are required");
document.form.name_from.focus();return false
}

if (document.form.email_from.value=="") 
{
alert("email is required");
document.form.email_from.focus();return false
}
if (document.form.telephone.value=="") 
{
alert("telephone is required");
document.form.telephone.focus();return false
}
if (document.form.name_from.value=="") 
{
alert("name is required");
document.form.name_from.focus();return false
}
if (document.form.email_from.value!="") 
{if (document.form.email_from.value.indexOf("@")==-1 || document.form.email_from.value.indexOf(".")==-1 || document.form.email_from.value.indexOf(" ")!=-1 || document.form.email_from.value.length<6) 
{alert("Sorry, your email address is not valid.");
document.form.email_from.focus();return false}
}
} 
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function TheHelpdeskFormCheck() {

if (document.form.email_from.value=="")if( document.form.name_from.value=="")
{
alert("name and email are required");
document.form.name_from.focus();return false
}
if (document.form.email_from.value=="") 
{
alert("email is required");
document.form.email_from.focus();return false
}
if (document.form.name_from.value=="") 
{
alert("name is required");
document.form.name_from.focus();return false
}
if (document.form.email_from.value!="") 
{if (document.form.email_from.value.indexOf("@")==-1 || document.form.email_from.value.indexOf(".")==-1 || document.form.email_from.value.indexOf(" ")!=-1 || document.form.email_from.value.length<6) 
{alert("Sorry, your email address is not valid.");
document.form.email_from.focus();return false}
}
} 
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;


function newsNav(){ 
var newslinks  = '<p>AVM IN THE PRESS</p>';
	
	//open press-latest and save as press-X.htm (i.e if x is the largest number x+1)
	//create a new link for this file at the top of the nav - 1 use current press-latest code
	//open press-latest again and edit file
	//edit line below
	//change the page titles!!!!
	newslinks += '<a href="press-latest.htm"><span class="date">August 2010</span>Matrix Launches The Media Hub Site For Digital Signage Users</a>';
	newslinks += '<a href="press-11.htm"><span class="date">July 2010</span>AVM gets ISO 14001 and 18001</a>';
	newslinks += '<a href="press-10.htm"><span class="date">June 2010</span>AVM to supply Microsoft OCS</a>';
	newslinks += '<a href="press-9.htm"><span class="date">June 2010</span>Spread the word</a>';
	newslinks += '<a href="press-8.htm"><span class="date">May 2010</span>Global projects call for global solutions</a>';
	newslinks += '<a href="press-7.htm"><span class="date">Jan 2010</span>AVM lecture install</a>';
	newslinks += '<a href="press-6.htm"><span class="date">August 2009</span>Archbishop Sumner C of E School  full of praise for visualiser technology</a>';
	//newslinks += '<a href="press-5.htm"><span class="date">July 2009</span>AVM certified by major vcon players</a>';
	//newslinks += '<a href="press-1.htm"><span class="date">June 2009</span>AVM passes Polycom test</a>';
	//newslinks += '<a href="press-2.htm"><span class="date">October 2008</span>AVM joins Sunday Times Tech 100 list</a>';
	//newslinks += '<a href="press-3.htm"><span class="date">August 2008</span>Taking Integration To The Next Level</a>';
	//newslinks += '<a href="press-4.htm"><span class="date">August 2008</span>AVM Doubles In Size With Matrix deal</a>';
	
	newslinks += '<p>News </p>';
	
	newslinks += '<a href="news-latest.htm"><span class="date">Aug 2010</span>AVM connects Davies Arnold Cooper LLP’s offices via videoconferencing</a>';
	newslinks += '<a href="news-47.htm"><span class="date">July 2010</span>AVM now holds ISO 9001, ISO14001, ISO18001</a>';
	newslinks += '<a href="news-46.htm"><span class="date">June 2010</span>Matrix helps Hampshire Constabulary with fund raising efforts</a>';
	newslinks += '<a href="news-45.htm"><span class="date">June 2010</span>AVM Helps TalkTalk Communicate</a>';
	newslinks += '<a href="news-44.htm"><span class="date">June 2010</span>AVM adds Microsoft OCS to its portfolio</a>';
	
	
	
	newslinks += '<a href="news-43.htm"><span class="date">Jan 2010</span>AV Global Alliance Reaches $3bn</a>';
	newslinks += '<a href="news-42.htm"><span class="date">November 2009</span>Matrix merges regional operations</a>';
	newslinks += '<a href="news-41.htm"><span class="date">October 2009</span>AVM Ranked 29th in Deloitte Technology Fast 50 </a>';
	newslinks += '<a href="news-40.htm"><span class="date">September 2009</span>AVM in Sunday Times Microsoft Tech Track 100 Second Year Running</a>';
	newslinks += '<a href="news-39.htm"><span class="date">August 2009</span>AVM Achieves Polycom&rsquo;s Gold Certified Partner Status</a>';
	newslinks += '<a href="news-38.htm"><span class="date">August 2009</span>Audio Visual Machines helps ICE Futures reduce costs and improve productivity </a>';
	newslinks += '<a href="news-37.htm"><span class="date">July 2009</span>Three New Companies Extend AV Global Alliance to 24 Members</a>';
	newslinks += '<a href="news-36.htm"><span class="date">July 2009</span>AVM Certified as Platinum Partner and Accredited Service Provider for Tandberg</a>';
	newslinks += '<a href="news-35.htm"><span class="date">June 2009</span>AVM partners with Polycom to Promote Immersive Telepresence</a>';
	newslinks += '<a href="news-archive.htm" class="news-link">AVM News Archive ></a>';
	
	document.write(newslinks);
}

function newsNavHome(){ 
var newslinks  = '<p style="margin:10px 0px 5px 0px;">News</p>';
	
	
	newslinks += '<a href="news-latest.htm"><span class="date">Aug 2010</span>AVM connects Davies Arnold Cooper LLP’s offices via videoconferencing</a>';
	newslinks += '<a href="news-47.htm"><span class="date">July 2010</span>AVM now holds ISO 9001, ISO14001, ISO18001</a>';
	newslinks += '<a href="news-46.htm"><span class="date">June 2010</span>Matrix helps Hampshire Constabulary with fund raising efforts</a>';
	newslinks += '<a href="news-45.htm"><span class="date">June 2010</span>AVM Helps TalkTalk Communicate</a>';
	newslinks += '<a href="news-44.htm"><span class="date">June 2010</span>AVM adds Microsoft OCS to its portfolio</a>';
	//newslinks += '<a href="news-43.htm"><span class="date">Jan 2010</span>AV Global Alliance Reaches $3bn</a>';
	document.write(newslinks);
}




function newsArchiveNav(){ 
var newlinks  = '<p>News Archive  </p>';

	newlinks += '<a href="news-34.htm"><span class="date">June 2009</span>New partners extend AV Global Alliance reach to 130 cities in 26 Countries</a>';
	newlinks += '<a href="news-33.htm"><span class="date">June 2009</span>Matrix Trials First Nationwide Visualiser Pilot Project</a>';
	newlinks += '<a href="news-32.htm"><span class="date">February 2009 </span>Viju joins the AV Global Alliance</a>';
	newlinks += '<a href="news-31.htm"><span class="date">January 2009 </span>AV Global Alliance Grows to 16 Members</a>';
	newlinks += '<a href="news-30.htm"><span class="date">October 2008</span>Barkai Benny   Brookstein joins AV Global Alliance</a>';
	newlinks += '<a href="news-29.htm"><span class="date">September 28th 2008</span>AVM joins Sunday Times Microsoft Tech Track 100</a>';
	newlinks += '<a href="news-28.htm"><span class="date">August 2008 </span>Actis Joins the AV Global Alliance</a>';
	newlinks += '<a href="news-27.htm"><span class="date">July 2008 </span>AVM Acquires Matrix Display Systems</a>';
	newlinks += '<a href="news-26.htm"><span class="date">June 2008 </span>Audio Visual Machines Retains Gold CAVSP Status </a>';
	newlinks += '<a href="news-25.htm"><span class="date">June 2008 </span>AVM Gains Safe contractor Award</a>';
	newlinks += '<a href="news-24.htm"><span class="date">June 2008</span>AVM Global Alliance Members Combined Turnover Now Exceeds One Billion Dollars</a>';
	newlinks += '<a href="news-23.htm"><span class="date">May 2008</span>AVM Hosts Annual Golf Day</a>';
	newlinks += '<a href="news-22.htm"><span class="date">April 2008</span>Annual Forward Thinking Technology Briefing</a>';
	newlinks += '<a href="news-21.htm"><span class="date">March 2008</span>Four further partnership agreements</a>';
	newlinks += '<a href="news20.htm"><span class="date">December 2007</span>Audio Visual Machines Develops Global Network</a>';
	newlinks += '<a href="news-19.htm"><span class="date">November 2007</span> Acquisition of AVE by Audio Visual Machines Ltd</a>';
	newlinks += '<a href="news-18.htm"><span class="date">June 2007</span> Simon Porter Joins Audio Visual Machines Ltd as Finance Director</a>';
	newlinks += '<a href="news-17.htm"><span class="date">May 2007</span> AVM Cannon Street Demo Suite upgraded to High Definition</a>';
	newlinks += '<a href="news-16.htm"><span class="date">May 2007</span>AVM moves its Operations Centre to St Margarets, Twickenham</a>';
	newlinks += '<a href="news-15.htm"><span class="date">March 2007</span> AVM acquires the AV business of Metro Broadcast Ltd</a>';
	newlinks += '<a href="news-14.htm"><span class="date">February 2007</span> AVM achieves Gold CAVSP</a>';
	newlinks += '<a href="news-13.htm"><span class="date">December 2006</span> Alan Watkins joins the board of Audio Visual Machines (AVM)</a>';
	newlinks += '<a href="news12.htm"><span class="date">November 2006</span> PRINCE2&trade; Qualifications</a>';
	newlinks += '<a href="news12-awards.htm"><span class="date">November 2006</span> AV Awards - Finalist </a>';
	newlinks += '<a href="news-11.htm"><span class="date">October 2006</span> Management buyout of Audio Visual Machines Ltd</a>';
	newlinks += '<a href="news-10.htm"><span class="date">March 2006</span> AVM wins major tender at BP&rsquo;s new Stockley Park buildings </a>';
	newlinks += '<a href="news-9.htm"><span class="date">February 2006</span> AVM expands support contract with BP</a>';
	newlinks += '<a href="news-8.htm"><span class="date">February 2006</span> AVM achieve Silver Status</a>';
	newlinks += '<a href="news-7.htm"><span class="date">February 2006</span> AVM announced the purchase of the assets of DDI- Lizard Ltd</a>';
	newlinks += '<a href="news-6.htm"><span class="date">September 2005</span> AVM wins BP on-site support contract</a>';
	newlinks += '<a href="news5.htm"><span class="date">September 2005</span> AVM merges with VMC</a>';
	newlinks += '<a href="news4.htm"><span class="date">August 2005</span> AVM provide total AV solution to BMS</a>';
	newlinks += '<a href="news3.htm"><span class="date">May 2005</span> Exterity signs AVM to deliver true convergence</a>';
	newlinks += '<a href="news2.htm"><span class="date">May 2005</span> Purchase of the ITM Assets</a>';
	newlinks += '<a href="news.htm"><span class="date">October 2004</span> Induction Loops and the law</a>';
	newlinks += '<a href="news-latest.htm" class="news-link">News &amp; Press Home</a>'; 	
	
	document.write(newlinks);
}
