﻿// swfobject flash object replace

swfobject.embedSWF("http://www.perceptionadvertising.com/flash/header.swf", "Flash_Head", "345px", "122px", "7.0.0", "http://s224328871.websitehome.co.uk/flash/header.swf", {global_url: "http://www.per-ad.com/new/"}, {wmode:"transparent"});
swfobject.embedSWF("http://www.perceptionadvertising.com/flash/thehub.swf", "Flash_thehub", "158px", "89px", "7.0.0", "http://s224328871.websitehome.co.uk/flash/thehub.swf", {}, {wmode:"transparent"});


// Changes the main background images on timer

var image;
var collection;

function startRotate(image, collection) {
	setTimeout('imgRotate("' + image + '", ' + collection + ');', 8000);
}

function imgRotate(image, collection) { //Change Homepage background at random intervals
	var photoNumber = Math.floor(Math.random() * 3) + 1;
	document.getElementsByTagName('body')[0].className = image + collection + "_" + photoNumber;
	setTimeout("imgRotate('" + image + "', " + collection + ");", 8000);
}


// Obfuscate email links

function email(alias,domain) {
	var link = alias + "@" + domain;
	document.write("<a href=\"mailto:" + link + "\">" + link + "</a>");
}

//Temporary Newsletter pop-up
function popup() {
	document.getElementById('popbox').style.display = "block";
	setTimeout("removePopup();", 1800);
	}
function removePopup() {
	document.getElementById('popbox').style.display = "none";
	}

//prevent errors by declaring menu functions where <!--[IF IE]> not used 

	function showUL(id) { }
	function showULul(id) { }
	function hide(id) { }