
// Flash and CSS init (c) Agents.se - v3.2

var flashver = swfobject.getFlashPlayerVersion();
/*
CSS Browser Selector v0.2.7 *Modified by The Agents
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
var css_browser_selector = function() {
	var
		ua=navigator.userAgent.toLowerCase();
		is=function(t){return ua.indexOf(t) != -1;},
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1)
			:is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('nt 5')?' xp':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

// Open window
var newWin = null;
function popMeUp(strURL,strType,strWidth,strHeight) {
	if (newWin != null){
		if(!newWin.closed) newWin.close();
	}
	var left=((window.screen.width/2)-(strWidth/2))-12;
	var top=((window.screen.height/2)-(strHeight/2));
	var strOptions="";
	if (strType=="console") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	newWin = window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}

// No spam e-mail address v2
function noSpam(a,b,c,d) {
	if (d==null) {
		d = c+'@'+b+'.'+a;
	}
	document.write('<a href="mai'+'lto:'+c+'@'+b+'.'+a+'">'+d+'</a>');
}

// Ajax Capable Browser?
var xmlHttp=null;
function GetXmlHttpObject() {
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

// Image/video flash player
function goPlayer(a) {
	if (flashver.major >= 8) {
		repositionPlayer();
		b=document.getElementById("flashplayer").style;
		b.display="block";
		xmlHttp=GetXmlHttpObject();
		xmlHttp.onreadystatechange=stateChangedPlayer;
		xmlHttp.open("GET","data_player.asp?file="+a+"&rnd="+Math.random(),true);
		xmlHttp.send(null);
		return false;
	}
}
function stateChangedPlayer() {
	if (xmlHttp.readyState==4) {
		document.getElementById("flashplayer").innerHTML=xmlHttp.responseText;
	}
}
function repositionPlayer() {
	if (flashver.major >= 8) {
		if (typeof window.innerWidth != 'undefined') {
			viewportheight = window.innerHeight;
		} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
			viewportheight = document.documentElement.clientHeight;
		}
		b=document.getElementById("flashplayer").style;
		b.top=getScrollHeight()+"px";
		b.height=viewportheight+"px";
	}
}
function getScrollHeight() {
   var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
   return h ? h : 0;
}
function closePlayer() {
	b=document.getElementById("flashplayer").style;
	b.display="none";
	return false;
}