function $(id) {
	return document.getElementById(id);
}

function getEventOffsetXY(evt) {
	if ( evt.offsetX != null )
		return [evt.offsetX , evt.offsetY];

	var obj = evt.target || evt.srcElement;
	setPageTopLeft( obj );
	return [(evt.clientX - obj.pageLeft) , (evt.clientY - obj.pageTop)];
}

function showTip(event, num) {
	if (document.all){
		xPos = window.event.clientX + document.body.scrollLeft;
		yPos = window.event.clientY + document.body.scrollTop;
	} else {
		xPos = event.clientX + window.scrollX;
		yPos = event.clientY + window.scrollY;
	}
	
	var arr = new Array(7);
	arr[0] = "Edge of network security appliances such as firewalls, proxys, and caches.";
	arr[1] = "Network security applications such as IDS/IPS or VoiP management, or content filtering security applications such as IM or Leak Prevention.";
	arr[2] = "Hosted service providers such as ISPs, or MSSPs.";
	arr[3] = "Personal firewall, anti-virus, or spyware application vendors targeting the desktop or mobile users.";
	arr[4] = "For our existing OEM partners.";
	arr[5] = "Hosted or standalone email filtering or SPAM services or applications.";
	arr[6] = "Wireless service providers that enable internet access for smartphones or mobile endpoints.";
	
	var tooltip = $("tooltip");
	tooltip.innerHTML=arr[num];
	tooltip.style.display="block";
	tooltip.style.position="absolute";
	tooltip.style.left=xPos+14+"px";
	tooltip.style.top=yPos-3+"px";
}

function hideTip() {
	var tooltip = $("tooltip");
	tooltip.style.display="none";
}

function switchTab(new_id) {
	var current = $('selected');
	current.id = "";
	
	$(new_id).parentNode.id = "selected";
	
	$('2009_content').style.display = "none";
	$('2008_content').style.display = "none";
	$('2007_content').style.display = "none";
	$('2006_content').style.display = "none";
	
	$(new_id+'_content').style.display = "block";
}

function switchTab2(new_id) {
	var current = $('selected');
	current.id = "";
	
	$(new_id).parentNode.id = "selected";
	
	$('app_content').style.display = "none";
	$('plugin_content').style.display = "none";
	$('report_content').style.display = "none";
	
	$(new_id+'_content').style.display = "block";
}

function printFlash() {
	if (document.all) {
		flashVersion = 0;
		
		try {
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='574' height='185' id='brightcloud' align='middle'>");
			document.write("<param name='menu' value='false' />");
			document.write("<param name='allowScriptAccess' value='sameDomain' />");
			document.write("<param name='movie' value='brightcloud.swf' />");
			document.write("<param name='wmode' value='transparent' />");
			document.write("<param name='quality' value='high' />");
			document.write("<param name='bgcolor' value='#000033' />");
			document.write("<embed src='brightcloud.swf' wmode='transparent' menu='false' quality='high' bgcolor='#000033' width='574' height='185' name='brightcloud' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
			document.write("</object>");
		}
		catch(e) {
			document.write("<img src='images/home.jpg'>");
		}
	} else {
		if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='574' height='185' id='brightcloud' align='middle'>");
			document.write("<param name='menu' value='false' />");
			document.write("<param name='allowScriptAccess' value='sameDomain' />");
			document.write("<param name='movie' value='brightcloud.swf' />");
			document.write("<param name='wmode' value='transparent' />");
			document.write("<param name='quality' value='high' />");
			document.write("<param name='bgcolor' value='#000033' />");
			document.write("<embed src='brightcloud.swf' wmode='transparent' menu='false' quality='high' bgcolor='#000033' width='574' height='185' name='brightcloud' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
			document.write("</object>");
		} else {
			document.write("<img src='images/home.jpg'>");
		}
	}
}
