window.addEvent('domready', function(){
		if (!document.getElementsByTagName){ return; }
		
		var anchors = document.getElementsByTagName('a');
		
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			if (relAttribute=='slide-img'){
				anchor.onclick = function() {startChangeImg(this);return false;};
			}
			else if (relAttribute=='slide-med'){
				anchor.onclick = function() {startChangeMed(this);return false;};
			}
		}
		});
		var slides = new Array();
		var startChangeImg;
		var startChangeMed;
		var carica;
		var caricaMed;
		carica = function (what, where) {
			varia = where.split("-");
			iddo = varia[1];
			container = "sect-"+iddo+"-container";
			if (document.getElementById(container).innerHTML.indexOf("img id") == -1) {
				document.getElementById(container).innerHTML = "<img id='sect-"+iddo+"-img' name='sect-"+iddo+"-img'/>";
				
			}
			document.getElementById(where).onload = function () {
				slides[iddo].slideIn();
			};
			document.getElementById(where).src = what;
			
		};
		caricaMed = function (what, where) {
			varia = where.split("-");
			iddo = varia[1];
			container = "sect-"+iddo+"-container";
			content = what.getAttribute('content');
			contentdir = what.getAttribute('vidir');
			document.getElementById(container).innerHTML = AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','802','height','450','src',contentdir+'videoplayer','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie',contentdir+'videoplayer?url='+content);
			slides[iddo].slideIn();
		};
		startChangeImg = function (what,where){
			thisid=what.getAttribute('parent');
			slides[thisid].slideOut().chain(function() {carica(what, 'sect-'+thisid+'-img')});
			
			
		};
		startChangeMed = function (what,where){
			thisid=what.getAttribute('parent');
			slides[thisid].slideOut().chain(function() {caricaMed(what, 'sect-'+thisid+'-img')});
		};
