function loadPNGs() {
	if (document.all && document.styleSheets && document.styleSheets[0] &&
	document.styleSheets[0].addRule)
	{
		document.styleSheets[0].addRule('*', 'behavior: url(img/png/png.htc)');
	}
}

function printpage()
{
window.print();
}

var num = 0;
function showFeatures() {
	var featureDiv = document.getElementById('features');
	
	
	if (num == 0) {
		featureDiv.style.display = 'block';
		num = num + 1;
	}
	
	else if (num == 1) {
		featureDiv.style.display = 'none';
		num = num - 1;
	}
}

var div;
var source;
var sections = Array(3);
sections[0] = "progOverview";
sections[1] = "director";
sections[2] = "featuredProd";


function programmeInfo(id, button) { 
	var tabsDiv = document.getElementById('programmeTabs');
	var tabs = tabsDiv.getElementsByTagName('img');

	for (var i=0; i < tabs.length; i++) {
		div = document.getElementById(sections[i]);
		div.style.display = "none";
		source = "img/programmes/" + sections[i] + "ButOFF.gif";
		tabs[i].setAttribute("src", source);
	}
	
	div = document.getElementById(id);
	div.style.display = 'block';
	source = "img/programmes/" + id + "ButON.gif";
	button.setAttribute("src", source);
	
}

function productGallery() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;	
	if (!document.getElementById("productThumbs")) return false;
	
	var gallery = document.getElementById("productThumbs");
	var links = gallery.getElementsByTagName("a");
	
	for (var i=0; i < links.length; i++){
		links[i].onclick = function(){
			return showPic(this);
		}
	}
}

function showPic (whichpic){
	if (!document.getElementById("center")) return true;
	var source = whichpic.getAttribute("href");
	var placeholder = document.getElementById("center");
	if (placeholder.nodeName != "IMG") return true;
	placeholder.setAttribute("src", source);
	return false;
}


function copyToClipboard(theSel) { 
theSel = '<img src="'+ theSel + '"/>'
window.clipboardData.setData('text',theSel);
alert('The Image HTML has been copied to the clipboard.\r You may now paste the image into your html.')
} 

function copyToClipboardFull(theSel) { 
window.clipboardData.setData('text',theSel);
alert('The Report HTML has been copied to the clipboard.\r You may now paste the report onto your chosen media.')
} 
