/* think simple by torsten naujoks @ <http://www.websmith.de> */

function Is(){
var agent		= navigator.userAgent.toLowerCase();
this.major		= parseInt(navigator.appVersion);
this.minor		= parseFloat(navigator.appVersion);
this.dom		= document.getElementById?1:0;
this.k			= (agent.indexOf('konqueror') != -1);
this.ko			= (this.k && Number(agent.substring(agent.indexOf('konqueror') + 10,agent.indexOf('konqueror') + 13)) < 4);
this.ns			= ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
this.ns0		= (this.ns && this.major < 5);
this.ns			= (this.dom && this.ns && this.major == 5);
this.ff2		= ((agent.indexOf('firefox/2') != -1) || (agent.indexOf('seamonkey/1') != -1));
this.ff3		= (agent.indexOf('firefox/3') != -1);
this.webkit		= (agent.indexOf('webkit') != -1);
this.o			= (agent.indexOf('opera') != -1);
this.op			= (this.o && Number(agent.substring(agent.indexOf('opera') + 6,agent.indexOf('opera') + 9)) > 8);
this.ie			= (agent.indexOf('msie') != -1 && agent.indexOf('firefox') == -1 && agent.indexOf('opera') == -1 && agent.indexOf('safari') == -1);
this.ie7		= ((agent.indexOf('msie7') != -1 || agent.indexOf('msie 7') != -1) && agent.indexOf('msie 8') == -1);
this.ie8		= ((agent.indexOf('msie8') != -1 || agent.indexOf('msie 8') != -1) && agent.indexOf('msie 7') == -1);
};

var is = new Is();

if((is.ns && !is.ns0) || is.op){
	document.write('<style type="text/css">#dimmer{opacity: 0.8} #theatre{-moz-border-radius: 0.25em}</style>');
	}
if(is.webkit){
	document.write('<style type="text/css">#dimmer{opacity: 0.8} #theatre{-khtml-border-radius: 0.25em}</style>');
	}
if(is.ie){
	document.write('<style type="text/css">#dimmer{filter: alpha(opacity=80)}</style>');
	}

function obj(){
if(arguments.length == 1){
	return document.getElementById(arguments[0]);
	}
else{
	if(arguments.length == 3){
		return obj(arguments[0]).getElementsByTagName(arguments[2]);
		}
	else{
		return obj(arguments[0]).getElementsByTagName(arguments[2])[arguments[3]];
		}
	}
}

function spot(arg){
if(obj('jump') != null){
	if(arg == 'init'){
		if(obj('media') != null){
			obj('media').style.height = 34 + (Math.ceil(obj('media','elm','b').length / 3) * 142) + 'px';
			}
		swSpy = 0;
		for(i = 0 ; i < obj('swatch','elm','a').length ; i++){
			with(obj('swatch','elm','a',i)){
				removeAttribute('href');
				if(firstChild.getAttribute('id')) swSpy = i;
				}
			}
		spot(((swSpy != 0) ? swSpy + 1 : 1));
		obj('jump').style.marginLeft = '0px';
		}
	else{
		obj('jump').style.top = 300 - (300 * arg) + 'px';
		}
	}
}

function video(arg1,arg2,arg3,arg4){
if(arg1 == 1){
	vpl = '<object width="' + arg3 + '" height="' + arg4 + '">';
	vpl += '<param name="movie" value="' + arg2 + '&autoplay=1" />';
	vpl += '<param name="allowFullScreen" value="true" />';
	vpl += '<param name="allowscriptaccess" value="always" />';
	vpl += '<embed src="' + arg2 + '&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + arg3 + '" height="' + arg4 + '"></embed>';
	vpl += '</object>';
	obj('playertube').innerHTML	= vpl;
	obj('dimmer').style.display = 'block';
	with(obj('theatre').style){
		width = arg3 + 20 + 'px';
		height = arg4 + 33 + 'px';
		display = 'block';
		marginTop = 0 - parseInt(arg4 / 2) - 17 + 'px';
		marginLeft = 0 - parseInt(arg3 / 2) - 10 + 'px';
		}
	}
else{
	obj('playertube').innerHTML	= '';
	obj('dimmer').style.display = 'none';
	obj('theatre').style.display = 'none';
	}
}

window.onload = function(){spot('init');};
