var title_scroller;
var move_iterator = 0;
var ul_pos = -259;
var trenutni_el;
var c_titles_elem;
var c_titles_a_elems;
var c_li_elems;
var global_myexit = document.domain;
var exitmusicplayerwindow;
var tab_slide = null;
var scroll_slide = null;
var tabs = new Array('gigs', 'whos', 'interview', 'move', 'cinema');
var processed_widget = '';

var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);


var mf;
var playobject = {'active' : false, 'minimized' : false};
var myMooFlowPage = {
		start: function(){
			mf = new MooFlow($('MooFlow'), {
				startIndex: 0,
				useCaption: true,
				useMouseWheel: true,
				useKeyInput: true,
				useSlider: true,
				heightRatio: 270,
				offsetY: -90,
				'onClickView': function(mixedObject){
					if(mixedObject.rel=='loadpics') {
						mf.stop();
						var href = unescape(mixedObject.href).split('|||');
						if(IE) { // IE fix
							var tmp = 'http//'+document.domain+'/';href[0] = href[0].substring(tmp.length+1);
						}
						mf.loadHTML('flowitems.php?key='+href[1]+'&page='+href[0], '.'+href[0]);
						}
					else if(mixedObject.rel=='download') {
						var href = unescape(mixedObject.href).split('|');
						content_counter(href[4].replace("l", ""), 1);
						setTimeout(function(){window.location = href[3];}, 1500);
					}
					else if(mixedObject.rel=='play') {
						var href = unescape(mixedObject.href).split('|');
						playobject.nid = href[3];
						playobject.title = href[4];
						playobject.link = href[5];
						playobject.type = mediasource();
						if(playobject.type=='audio') {
							playobject.imebenda = href[6];
							playobject.username = href[7];
							playobject.slika = href[8];
							}

						var ids = (playobject.nid != '') ? playobject.nid.split('-') : new Array(playobject.link, 0);
						content_counter(ids[0], ids[1]);
						showPlayer();
						obj=null;
					}}
			});
			
			var abilities = $$('a.ability', 'div#kmeni_video div ul li a');
			abilities.addEvent('click', function(event){
				if (this.id != '' && this.id.indexOf('ulabsub_') == -1) {
					var ability_state = $$('div#kmenisub_'+this.id).getStyle('display');
					if (ability_state == 'block') {
						$$('div#kmenisub_'+this.id).setStyle('display','none');
					} else {
						if (this.id == 'ability_exit') {
							$$('div#kmenisub_ability_int').setStyle('display','none');
							$$('div#kmenisub_ability_scene').setStyle('display','none');
						} else if (this.id == 'ability_int') {
							$$('div#kmenisub_ability_exit').setStyle('display','none');
							$$('div#kmenisub_ability_scene').setStyle('display','none');
						} else if (this.id == 'ability_scene') {
							$$('div#kmenisub_ability_exit').setStyle('display','none');
							$$('div#kmenisub_ability_int').setStyle('display','none');
						}
						$$('div#kmenisub_'+this.id).setStyle('display','');
					}
				} else {
					mf.loadHTML('flowitems.php?key='+this.innerHTML+'&param='+this.id, '.page1');						
				}
				i=0;
				while (abilities[i]) {
					abilities[i].className="";
					i++;
				}
				this.className="on";
				return false;
				});
			//mf.play();
		}
	};

function mediasource(){
	var a = playobject.link;
	if (a.indexOf('.mp3')!=-1) a = 'audio';
	else if (a.indexOf('exitmusic')!=-1 || a.indexOf('music.myexit')!=-1 || a.indexOf('exitfest')!=-1) a = 'local';
	else if (a.indexOf('youtube')!=-1) a = 'youtube';
	else if (a.indexOf('myspace')!=-1) a = 'myspace';
	return a;
}
	
/* /////////////////////////////////////////////////////////////////////// swfree ///////////////////////////////////////////////////////////////////*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('f 1H(4){3.Z="1L";3.18={"1u":0,"1w":2O};3.H={"X":{"J":0,"t":0},"1r":{"J":0,"t":0}};3.1S=0;3.1x=17;3.15={"h":2J,"1s":-1};3.v={"1l":21(l.2B.G),"13":(1A.1D.1I("1C 5.5")!=-1||1A.1D.1I("1C 5.0")!=-1),"1b":(1A.1D.1I("1C 6.0")!=-1)};9(!3.v.1l){3.v.13=17;3.v.1b=17}3.1E=f(){9(!l.n(3.4)){k 25("1H.1E() 26. I \'"+3.4+"\' 2D 2E 2F.")}9(3.Z!="1L"&&3.Z!="2k"){k 25("1H.1E() 26. 2G Q Z: \'"+3.Z+"\'")}9(3.v.1l&&3.v.13){28()}2a();1g(l.n(3.4).10,3.w,3.4)};f 2a(){8 1m=l.n(7.4).2c("p");8 j=x 1o();8 1n=x 1o();q(8 i=0;i<1m.e;i++){9(1m[i].m=="K"){j.u(1m[i])}}q(8 i=0;i<j.e;i++){1n.u(29(j[i].10))}q(8 i=0;i<j.e;i++){j[i].g.1k=(1n[i])+"F"}9(7.v.1l){q(8 i=0;i<j.e;i++){2f(j[i].10,1n[i])}}}f 28(){8 1c=l.n(7.4).2c("a");q(8 i=0;i<1c.e;i++){9(/2g/.C(1c[i].m)){1c[i].1e=\'<p 2e="2e">\'+1c[i].1e+\'</p>\'}}}f 29(c){8 W=0;q(8 i=0;i<c.e;i++){9(c[i].1G!=1||/K/.C(c[i].m)){2i}9(c[i].11>W){W=c[i].11}}k W}f 2f(c,W){q(8 i=0;i<c.e;i++){9(c[i].1G==1&&/2g/.C(c[i].m)&&c[i].G){9(7.v.13||7.v.1b){c[i].g.1k=(W)+"F"}B{c[i].g.1k=(W-N(c[i].G.2H)-N(c[i].G.2I))+"F"}}}}f 1g(c,w,4){q(8 i=0;i<c.e;i++){9(1!=c[i].1G){2i}2K(1Z){1y/\\2L\\b/.C(c[i].m):c[i].4=4+"-"+w.e;w.u(x 1o());c[i].1J=1t;c[i].1K=1v;19;1y/\\2M\\b/.C(c[i].m):c[i].4=4+"-"+w.e;w.u(x 1o());c[i].1J=1t;c[i].1K=1v;19;1y/\\1W\\b/.C(c[i].m):c[i].4=4+"-"+(w.e-1)+"-K";c[i].1J=1X;c[i].1K=1Y;8 z=l.n(4+"-"+(w.e-1));8 L=l.n(c[i].4);8 o=x I(z.4);9(1==o.2h){9("1L"==7.Z){L.g.J=z.1O+z.23+7.H.X.J+"F";9(7.v.13){L.g.t=7.H.X.t+"F"}B{L.g.t=z.1P+7.H.X.t+"F"}}B 9("2k"==7.Z){L.g.J=z.1O+7.H.X.J+"F";9(7.v.13){L.g.t=z.11+7.H.X.t+"F"}B{L.g.t=z.1P+z.11+7.H.X.t+"F"}}}B{L.g.J=z.1O+7.H.1r.J+"F";L.g.t=z.1P+z.11+7.H.1r.t+"F"}7.j.u(c[i].4);7.U.u(0);7.O.u(0);9(7.1x&&7.v.1b){c[i].1e=c[i].1e+\'<D 4="\'+c[i].4+\'-D" 2n="\'+7.1S+\'2o" 2p="2q:17" 2r="2s" 2t="0" g="H: 2u; J: 1V; t: 1V; 1f: 1U; "></D>\'}19}9(c[i].10){9(/\\1W\\b/.C(c[i].m)){1g(c[i].10,w[w.e-1],4+"-"+(w.e-1))}B{1g(c[i].10,w,4)}}}}f 1t(){7.14++;8 E=3.4+"-K";9(7.h.e){8 o=x I(1d(7.h));o=l.n(o.16().4);9(/S\\d-T/.C(o.m)){o.m=o.m.1p(/(S\\d)-T/,"$1")}}9(Y(7.j,E)){1M();7.O[A(7.j,E)]++;8 r=7.U[A(7.j,E)];8 R=1i(f(a,b){k f(){7.20(a,b)}}(E,r),7.18.1u);7.P.u(R)}B{9(7.h.e){1M();8 R=1i(f(a,b){k f(){7.2d(a,b)}}(3.4,7.14),7.18.1u);7.P.u(R)}}};f 1v(){7.14++;8 E=3.4+"-K";9(Y(7.j,E)){7.U[A(7.j,E)]++;9(Y(7.h,E)){8 r=7.O[A(7.j,E)];8 R=1i(f(a,b){k f(){7.12(a,b)}}(E,r),7.18.1w);7.P.u(R)}}};f 1X(){7.O[A(7.j,3.4)]++;8 o=x I(3.4);8 y=l.n(o.16().4);9(!/S\\d-T/.C(y.m)){y.m=y.m.1p(/(S\\d)/,"$1-T")}};f 1Y(){7.U[A(7.j,3.4)]++;8 r=7.O[A(7.j,3.4)];8 R=1i(f(a,b){k f(){7.12(a,b)}}(3.4,r),7.18.1w);7.P.u(R)};3.20=f(4,r){9(1Q r!="1F"){9(r!=3.U[A(3.j,4)]){k}}3.U[A(3.j,4)]++;9(3.h.e){9(4==1d(3.h)){k}8 o=x I(4);8 V=o.1z();q(8 i=3.h.e-1;i>=0;i--){9(Y(V,3.h[i])){19}B{3.12(3.h[i])}}}8 o=x I(4);8 y=l.n(o.16().4);9(!/S\\d-T/.C(y.m)){y.m=y.m.1p(/(S\\d)/,"$1-T")}9(l.1T){l.n(4).g.1f="2b"}l.n(4).g.1R="h";l.n(4).g.15=3.15.h;9(3.1x&&3.v.1b){8 p=l.n(4);9(p.G.2y==2z){p.g.1N=0;p.g.22=0;p.g.1B=0;p.g.2m=0}8 D=l.n(4+"-D");D.g.1k=p.11+N(p.G.1N)+N(p.G.22);D.g.2A=p.23+N(p.G.1B)+N(p.G.2m);D.g.J=-N(p.G.1B);D.g.t=-N(p.G.1N);D.g.15=-1;D.g.1f="2b"}3.h.u(4)};3.2d=f(4,r){9(1Q r!="1F"){9(r!=3.14){k}}3.14++;9(3.h.e){8 o=x I(4+"-K");8 V=o.1z();q(8 i=3.h.e-1;i>=0;i--){9(Y(V,3.h[i])){19}B{3.12(3.h[i])}}}};3.12=f(4,r){9(1Q r!="1F"){9(r!=3.O[A(3.j,4)]){k}9(4==1d(3.h)){q(8 i=3.h.e-1;i>=0;i--){3.12(3.h[i])}k}}8 o=x I(4);8 y=l.n(o.16().4);9(/S\\d-T/.C(y.m)){y.m=y.m.1p(/(S\\d)-T/,"$1")}l.n(4).g.15=3.15.1s;l.n(4).g.1R="1s";9(l.1T){l.n(4).g.1f="1U"}9(Y(3.h,4)){9(4==1d(3.h)){3.h.1q()}B{}}B{}3.O[A(3.j,4)]++};f I(4){3.Q=7;3.4=4;3.2j=f(){8 s=3.4.1a(3.Q.4.e);k 24(s,"-")};3.16=f(){8 s=3.4.1a(3.Q.4.e);8 a=s.1j("-");a.1q();k x I(3.Q.4+a.2v("-"))};3.2w=f(){8 s=3.4.1a(3.Q.4.e);8 a=s.1j("-");k a.e>2};3.2x=f(){k 21(l.n(3.4+"-K"))};3.1z=f(){8 s=3.4.1a(3.Q.4.e);s=s.1a(0,s.e-"-K".e);8 a=s.1j("-");a.2C();a.1q();8 s=3.Q.4;8 V=[];q(8 i=0;i<a.e;i++){s+=("-"+a[i]);V.u(s+"-K")}k V};3.2h=3.2j()};f 1M(){q(8 i=7.P.e-1;i>=0;i--){2N(7.P[i]);7.P.1q()}};8 7=3;3.4=4;3.w=[];3.j=[];3.U=[];3.O=[];3.14=0;3.P=[];3.h=[]};f A(M,1h){q(8 i=0;i<M.e;i++){9(M[i]===1h){k i}}k-1};f Y(M,1h){q(8 i=0;i<M.e;i++){9(M[i]===1h){k 1Z}}k 17};f 24(27,2l){k 27.1j(2l).e-1};f 1d(M){k M[M.e-1]};',62,175,'|||this|id|||self|var|if|||nodes||length|function|style|visible||sections|return|document|className|getElementById|el|div|for|cnt||left|push|browser|tree|new|parent|box1|itemInArray|else|test|iframe|id_section|px|currentStyle|position|Element|top|section|box2|inArray|parseInt|sectionsHideCnt|timers|menu|timerId|item|active|sectionsShowCnt|parents|maxWidth|level1|stringInArray|type|childNodes|offsetWidth|hideSection|ie5|itemShowCnt|zIndex|getParent|false|delay|break|substr|ie6|elements|lastItemOfArray|innerHTML|display|parse|srchItem|setTimeout|split|width|ie|arr|widths|Array|replace|pop|levelX|hidden|itemOver|show|itemOut|hide|fixIeSelectBoxBug|case|getParentSections|navigator|borderTopWidth|MSIE|appVersion|init|undefined|nodeType|DropDownMenuX|indexOf|onmouseover|onmouseout|horizontal|clearTimers|borderLeftWidth|offsetTop|offsetLeft|typeof|visibility|iframename|all|none|0px|bsection|sectionOver|sectionOut|true|showSection|Boolean|borderRightWidth|offsetHeight|countSubStr|alert|failed|srcStr|fixWrap|getMaxWidth|fixSections|block|getElementsByTagName|showItem|nowrap|setMaxWidth|item2|level|continue|getLevel|vertical|subStr|borderBottomWidth|class|frame|src|javascript|scrolling|no|frameborder|absolute|join|hasParent|hasChilds|border|null|height|body|shift|does|not|exist|Unknown|paddingLeft|paddingRight|500|switch|bitem1|bitem2|clearTimeout|400'.split('|'),0,{}))
/* /////////////////////////////////////////////////////////////////////// ajax /////////////////////////////////////////////////////////////////////*/

function update(method, url, c_par, s_par) {
	var parameters = getParams(s_par);
	var ext = (method=="POST") ? '' : ((parameters!='')?"?" + parameters : '');
	http.open(method, url + ext, true);

	if(method=="POST")
		{
		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http.setRequestHeader("Content-length", parameters.length);
		http.setRequestHeader("Connection", "close");
		}
	else
		parameters=null; delete parameters;

	http.onreadystatechange = function()
								{
								handleHttpResponse(method, c_par);
								}
	try {
		http.send(parameters);
	} catch(e){}
	if (http.readyState == 4) {c_par = null; delete c_par;}
	}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if(@_jscript_version>=5)try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=newActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}@else xmlhttp=false;@end @*/
  if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}return xmlhttp;}

function getParams(par) {
	var poststr = "par="+par;
	if(par=="register")
		var fields=Array("email","femail1", "username","fusername2");
	else if(par=="lost")
		var fields=Array("email","femail2");
	else if(par=="login")
		var fields=Array("username","fusername1","password","fpassword");
	else
		return par;

//	fields[fields.length]="submit";
//	fields[fields.length]="lgn_submit_input";

	for(var i=0; i<fields.length; i=i+2)
		poststr+="&"+fields[i]+"=" + encodeURI( document.getElementById(fields[i+1]).value );
	return poststr;
	}

function handleHttpResponse(method, c_par) {
	if (http.readyState == 4) {
		result = http.responseText;
		if (typeof(c_par) == 'object'){
			var temp = c_par["c_handler_name"];
			c_par["c_handler_name"] = null; delete c_par["c_handler_name"];
			eval(temp+'(method, c_par, result);');
			c_par = null; delete c_par;
			}
		else
			eval(c_par+'(method, "", result);');
		}
	}

var http=getHTTPObject();
/* /////////////////////////////////////////////////////////////////////// filter ////////////////////////////////////////////////////////////////////*/
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function blend(id, millisec, inout) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
	if(inout=='in')
		{
		//fade in
		for(i = 0; i <= 100; i++) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
			}
		}
	else
		{
		//fade out
		for(i = 100; i >= 0; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
			}
		}
}

	
	function docHeight() {
			if (self.innerHeight) // all except Explorer
				return self.innerHeight;
			else if (document.documentElement && document.documentElement.clientHeight)
				// Explorer 6 Strict Mode
				return document.documentElement.clientHeight;
			else if (document.body) // other Explorers
				return document.body.clientHeight;
	}
	function docWidth() {
			if (self.innerWidth) // all except Explorer
				return self.innerWidth;
			else if (document.documentElement && document.documentElement.clientWidth)
				// Explorer 6 Strict Mode
				return document.documentElement.clientWidth;
			else if (document.body) // other Explorers
				return document.body.clientWidth;
	}

	function clear_login_fields(from, to, c_fusername1, c_fusername2, c_fpassword, c_femail1, c_femail2){
		form_switcher(from, to);
		c_fusername1.value="";
		c_fusername2.value="";
		c_fpassword.value="";
		c_femail1.value="";
		c_femail2.value="";
		reset_login_fields();
	}
	function getCookie(c_name) {
		if (document.cookie.length>0)
			{
			c_start=document.cookie.indexOf(c_name + "=");
			if (c_start!=-1)
				{
				c_start=c_start + c_name.length+1;
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
				}
			}
		return null;
	}
	function getElementsByA(s1,s2,node,tag) {
		var classElements = new Array();
		if ( node == null )
			node = document;
		if ( tag == null )
			tag = 'a';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( els[i].href.indexOf(s1)!=-1 || els[i].href.indexOf(s2)!=-1 ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}
	
	function is_logged_in() {
		var myCookie = getCookie("PHPSESSID");
		var el = document.getElementById("logout_frm").className;
		if(myCookie && el=='visible') logged_in();
	}
	function is_logged_in1() {
		var myCookie = getCookie("PHPSESSID");
		var el = document.getElementById("logout_frm").className;
		return (myCookie && el=="visible") ? true : false;
	}
	function logged_in() {
		var els = getElementsByA("myexit.org","exitfest.org");
		var i=0;
		var v;
		while(els[i]) {
			v = els[i].href;
			if(v.indexOf("PHPSESSID")!=-1)continue;
			v += (v.indexOf("?")!=-1) ? "&" : "?";
			els[i].href = v+"PHPSESSID="+getCookie("PHPSESSID");
			i++;
		}
	}
	function logged_out() {
		var els = getElementsByA("myexit.org","exitfest.org");
		var i=0;
		var v;
		while(els[i]) {
			v = els[i].href;
			els[i].href = v.substring(0, v.indexOf("PHPSESSID")-1);
			i++;
		}
	}
	function reset_login_fields() {
		var c_username1 = document.getElementById("fusername1");
		var c_username2 = document.getElementById("fusername2");
		var c_email1 = document.getElementById("femail1");
		var c_email2 = document.getElementById("femail2");
		var c_password = document.getElementById("fpassword");
				
		//add login fields mouse events
		c_username1.onfocus = function(){c_username1.style.backgroundPosition = '-230px -87px'};
		c_username1.onblur = function(){if(c_username1.value=='')c_username1.style.backgroundPosition = '-230px -66px'};
		c_username2.onfocus = function(){c_username2.style.backgroundPosition = '-230px -87px'};
		c_username2.onblur = function(){if(c_username2.value=='')c_username2.style.backgroundPosition = '-230px -66px'};
		c_password.onfocus = function(){c_password.style.backgroundPosition = '-305px -87px'};
		c_password.onblur = function(){if(c_password.value=='')c_password.style.backgroundPosition = '-305px -66px'};
		c_email1.onfocus = function(){c_email1.style.backgroundPosition = '-305px -87px'};
		c_email1.onblur = function(){if(c_email1.value=='')c_email1.style.backgroundPosition = '-380px -66px'};
		c_email2.onfocus = function(){c_email2.style.backgroundPosition = '-305px -87px'};
		c_email2.onblur = function(){if(c_email2.value=='')c_email2.style.backgroundPosition = '-380px -66px'};
		c_username1.style.backgroundPosition = (c_username1.value=='') ? '-230px -66px' : '-230px -87px';
		c_username2.style.backgroundPosition = (c_username2.value=='') ? '-230px -66px' : '-230px -87px';
		c_password.style.backgroundPosition  = (c_password.value=='')  ? '-305px -66px' : '-305px -87px';
		c_email1.style.backgroundPosition = (c_email1.value=='') ? '-380px -66px' : '-605px -87px';
		c_email2.style.backgroundPosition = (c_email2.value=='') ? '-380px -66px' : '-605px -87px';
	}
	function teach_login_fields() {
		var tmp_login  = document.getElementById("login_frm").getElementsByTagName("a");
		var tmp_lost   = document.getElementById("lost_frm").getElementsByTagName("a");
		var tmp_reg    = document.getElementById("register_frm").getElementsByTagName("a");
		
	    var c_slogin = tmp_login[2];
	    var c_sregister = tmp_reg[2];
	    var c_slost = tmp_lost[2];
	    var c_slogout = document.getElementById("logout_frm").getElementsByTagName("a")[1];
	    var c_llogin1 = tmp_reg[0];
	    var c_llogin2 = tmp_lost[0];
	    var c_lregister1 = tmp_login[0];
	    var c_lregister2 = tmp_lost[1];
	    var c_llost1 = tmp_login[1];
	    var c_llost2 = tmp_reg[1];

		//add login fields mouse events
		c_slogin.onclick = function(){update('POST','/themes/myexit/a.php','funct_login','login');document.getElementById("mypage").href = "/"+document.getElementById("fusername1").value;};
		c_slogout.onclick = function(){update('POST','/themes/myexit/a.php','funct_login','par=logout')};
		//c_sregister.onclick = function(){update('POST','themes/myexit/a.php','funct_login','register')};
		c_slost.onclick = function(){update('POST','/themes/myexit/a.php','funct_login','lost')};
		c_llogin1.onclick = function(){form_switcher('register_frm', 'login_frm')};
		c_llogin2.onclick = function(){form_switcher('lost_frm', 'login_frm')};
		//c_lregister1.onclick = function(){form_switcher('login_frm', 'register_frm')};
		//c_lregister2.onclick = function(){form_switcher('lost_frm', 'register_frm')};
		c_llost1.onclick = function(){form_switcher('login_frm', 'lost_frm')};
		c_llost2.onclick = function(){form_switcher('register_frm', 'lost_frm')};
	    
	}
	function funct_login(method, c_par, result) {
		var tmp_login  = document.getElementById("login_frm").getElementsByTagName("input");
		var tmp_lost   = document.getElementById("lost_frm").getElementsByTagName("input");
		var tmp_reg    = document.getElementById("register_frm").getElementsByTagName("input");
		
	    var c_fusername1 = tmp_login[0];
	    var c_fusername2 = tmp_reg[0];
	    var c_fpassword = tmp_login[1];
	    var c_femail1 = tmp_reg[1];
	    var c_femail2 = tmp_lost[0];

		var kod = result.split(':');
		if (kod[0]=='registerok')
			clear_login_fields('register_frm', 'login_frm', c_fusername1, c_fusername2, c_fpassword, c_femail1, c_femail2);
		if (kod[0]=='lostok')
			clear_login_fields('lost_frm', 'login_frm', c_fusername1, c_fusername2, c_fpassword, c_femail1, c_femail2);
		if (kod[0]=='loginok') {
			form_switcher('login_frm', 'logout_frm');
			logged_in();
			}
		else if (kod[0]=='logoutok') {
			clear_login_fields('logout_frm', 'login_frm', c_fusername1, c_fusername2, c_fpassword, c_femail1, c_femail2);
			logged_out();
			}
		else {
			blend("login",300,"out");
			setTimeout(function(){
				document.getElementById("login_msgs").innerHTML = kod[1];
				if (kod[0]=='eusername1' || kod[0]=='eusernpass')
					c_fusername1.style.backgroundPosition = (c_fusername1.value=="") ? '-455px -66px' : '-455px -87px';
				else
					c_fusername1.style.backgroundPosition = (c_fusername1.value=="") ? '-230px -66px' : '-230px -87px';
				if (kod[0]=='epassword' || kod[0]=='eusernpass')
					c_fpassword.style.backgroundPosition = (c_fpassword.value=="") ? '-530px -66px' : '-530px -87px';
				else
					c_fpassword.style.backgroundPosition = (c_fpassword.value=="") ? '-305px -66px' : '-305px -87px';
				if (kod[0]=='eusername2')
					c_fusername2.style.backgroundPosition = (c_fusername2.value=="") ? '-455px -66px' : '-455px -87px';
				else
					c_fusername2.style.backgroundPosition = (c_fusername2.value=="") ? '-230px -66px' : '-230px -87px';
				if (kod[0]=='eemail1')
					c_femail1.style.backgroundPosition = (c_femail1.value=="") ? '-605px -66px' : '-605px -87px';
				else
					c_femail1.style.backgroundPosition = (c_femail1.value=="") ? '-380px -66px' : '-380px -87px';
				if (kod[0]=='eemail2')
					c_femail2.style.backgroundPosition = (c_femail2.value=="") ? '-605px -66px' : '-605px -87px';
				else
					c_femail2.style.backgroundPosition = (c_femail2.value=="") ? '-380px -66px' : '-380px -87px';
				blend("login",300,"in");
				}, 300);
			}
			
		}
	function form_switcher(from, to) {
		blend(from,300,"out");
		setTimeout(function(){
			document.getElementById(from).className='';
			document.getElementById(from).style.display='none';
			object = document.getElementById(to).style;
			object.opacity=0;
			object.MozOpacity=0;
			object.KhtmlOpacity=0;
			object.filter = "alpha(opacity=0)";
			object.display='block';
			object = null;
			document.getElementById(to).className='visible';
			blend(to, 300, "in");
			document.getElementById("login_msgs").innerHTML = "";
			},300);
		}
	function setCookie(c_name,value,expiredays)
		{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}

	function generate_player_page(song_url_or_nid, ime_benda, songname, picture, username) {
		try{
			this.removeAttributeNode(this.getAttributeNode('href'));
		}catch(e){}
		
		if(typeof playobject.disabled == 'undefined' || !playobject.disabled) {
			var ids = (typeof playobject.nid == 'undefined') ? (song_url_or_nid+"").split('-') : playobject.nid.split('-');
			content_counter(ids[0], ids[1]);
		}else
			playobject.disabled = false;
		exitmusicplayerwindow = window.open('/modules/bendovi/player.php?'+((typeof ime_benda == 'undefined')?'nid='+song_url_or_nid:'song_url='+song_url_or_nid+'&ime_benda='+ime_benda+'&songname='+songname+'&picture='+picture+'&username='+username), 'exitmusicplayer', 'resizable=0,status=0,toolbar=0,location=0,menubar=0,directories=0,width=371,height=295');
		if (exitmusicplayerwindow.opener == null) exitmusicplayerwindow.opener = self;
		return false;
	}
	
function getElementsByClassName(classname, node) {
	if(!node) node = document.getElementsByTagName("body")[0];
	var a = [];
	var re = new RegExp('\\b' + classname + '\\b');
	var els = node.getElementsByTagName("*");
	for(var i=0,j=els.length; i<j; i++)
		if(re.test(els[i].className))a.push(els[i]);
	return a;
}

//Get DOM elements based on the given CSS Selector - V 1.00.A Beta
//http://www.openjs.com/scripts/dom/css_selector/
function getElementsBySelector(all_selectors) {
	var selected = new Array();
	if(!document.getElementsByTagName) return selected;
	all_selectors = all_selectors.replace(/\s*([^\w])\s*/g,"$1");//Remove the 'beutification' spaces
	var selectors = all_selectors.split(",");
	// Grab all of the tagName elements within current context	
	var getElements = function(context,tag) {
		if (!tag) tag = '*';
		// Get elements matching tag, filter them for class selector
		var found = new Array;
		for (var a=0,len=context.length; con=context[a],a<len; a++) {
			var eles;
			if (tag == '*') eles = con.all ? con.all : con.getElementsByTagName("*");
			else eles = con.getElementsByTagName(tag);

			for(var b=0,leng=eles.length;b<leng; b++) found.push(eles[b]);
		}
		return found;
	}

	COMMA:
	for(var i=0,len1=selectors.length; selector=selectors[i],i<len1; i++) {
		var context = new Array(document);
		var inheriters = selector.split(" ");

		SPACE:
		for(var j=0,len2=inheriters.length; element=inheriters[j],j<len2;j++) {
			//This part is to make sure that it is not part of a CSS3 Selector
			var left_bracket = element.indexOf("[");
			var right_bracket = element.indexOf("]");
			var pos = element.indexOf("#");//ID
			if(pos+1 && !(pos>left_bracket&&pos<right_bracket)) {
				var parts = element.split("#");
				var tag = parts[0];
				var id = parts[1];
				var ele = document.getElementById(id);
				if(!ele || (tag && ele.nodeName.toLowerCase() != tag)) { //Specified element not found
					continue COMMA;
				}
				context = new Array(ele);
				continue SPACE;
			}

			pos = element.indexOf(".");//Class
			if(pos+1 && !(pos>left_bracket&&pos<right_bracket)) {
				var parts = element.split('.');
				var tag = parts[0];
				var class_name = parts[1];

				var found = getElements(context,tag);
				context = new Array;
 				for (var l=0,len=found.length; fnd=found[l],l<len; l++) {
 					if(fnd.className && fnd.className.match(new RegExp('(^|\s)'+class_name+'(\s|$)'))) context.push(fnd);
 				}
				continue SPACE;
			}

			if(element.indexOf('[')+1) {//If the char '[' appears, that means it needs CSS 3 parsing
				// Code to deal with attribute selectors
				if (element.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?['"]?([^\]'"]*)['"]?\]$/)) {
					var tag = RegExp.$1;
					var attr = RegExp.$2;
					var operator = RegExp.$3;
					var value = RegExp.$4;
				}
				var found = getElements(context,tag);
				context = new Array;
				for (var l=0,len=found.length; fnd=found[l],l<len; l++) {
 					if(operator=='=' && fnd.getAttribute(attr) != value) continue;
					if(operator=='~' && !fnd.getAttribute(attr).match(new RegExp('(^|\\s)'+value+'(\\s|$)'))) continue;
					if(operator=='|' && !fnd.getAttribute(attr).match(new RegExp('^'+value+'-?'))) continue;
					if(operator=='^' && fnd.getAttribute(attr).indexOf(value)!=0) continue;
					if(operator=='$' && fnd.getAttribute(attr).lastIndexOf(value)!=(fnd.getAttribute(attr).length-value.length)) continue;
					if(operator=='*' && !(fnd.getAttribute(attr).indexOf(value)+1)) continue;
					else if(!fnd.getAttribute(attr)) continue;
					context.push(fnd);
 				}

				continue SPACE;
			}

			//Tag selectors - no class or id specified.
			var found = getElements(context,element);
			context = found;
		}
		for (var o=0,len=context.length;o<len; o++) selected.push(context[o]);
	}
	return selected;
}
	
	function MenuRevert() {
		var menu_revert_var;
		var bridge;
		
		this.start = function() {
			bridge=this;
			this.menu_revert_var=1;
			document.getElementById("mzero").onmouseout = function(){bridge.revert()};
			document.getElementById("mzero").onmouseover = function(){bridge.menu_revert_var=null;};
			document.getElementById("mmain").onmouseout = function(){bridge.revert()};
			document.getElementById("mmain").onmouseover = function(){bridge.menu_revert_var=null;};
		}
		this.revert = function(){
			this.menu_revert_var=1;
			setTimeout(function() {
				if(bridge.menu_revert_var) {
					document.getElementById("meniexitfest").style.display = 'none';
					document.getElementById("menimusic").style.display = 'block';
					document.getElementById("menimyexit").style.display = 'none';
				}
			}, 4000);		
		}
	}

	

function arg(pin){
	var tmp1 = new Array();
	var tmp2 = new Array();
	tmp1 = (window.location.href).split("/");
	if (tmp1[pin+3]) tmp2 = tmp1[pin+3].split("?");
	else return false;
	return tmp2[0];
}

//blinka crveno - reklama za chat /////////////////////////////
function reklamazachat(){
     setInterval("colorFade1()", 2500);
}
function colorFade1(){
                colorFade("f6", '000000', 'ff0000');
                setTimeout(function(){colorFade("f6", 'ff0000', '000000')}, 1000);
}
function colorFade(id,start,end,steps,speed) {
  var er,step,rint,step;
  var target = document.getElementById(id).childNodes[0];
  steps = steps || 20;
  speed = speed || 20;
  clearInterval(target.timer);
  er = colorConv(end);
  if(!target.r)
    target.r = colorConv(start);
  rint = Math.round(Math.abs(target.r-er)/steps);
  if(rint == 0) rint = 1;
  target.step = 1;
  target.timer = setInterval( function() { animateColor(id,steps,er,rint) }, speed);
}

function animateColor(id,steps,er,rint) {
  var target = document.getElementById(id).childNodes[0];
  var color;
  if(target.step <= steps) {
    var r = target.r;
    if(r >= er)
      r = r - rint;
    else
      r = parseInt(r) + parseInt(rint);

    color = 'rgb(' + r + ',0,0)';
    target.style.color = color;

    target.r = r;
    target.step = target.step + 1;
  } else {
    clearInterval(target.timer);
    color = 'rgb(' + er + ',0,0)';
    target.style.color = color;
  }
}

function colorConv(color) {
  return parseInt(color.substring(0,2),16);
}
//end - blinka crveno - reklama za chat /////////////////////////////

function has(n,h) {
	var i=0;
	while(h[i]) {
		if (h[i]==n) return true;
		i++;
	}
	return false;
}

function shrinkImages(){
	var i=0, maxWidth;
	//if (/^(?:artistnews|albums|news|exitnews|reviews)$/.test(arg(0))) maxWidth=236;
	if(typeof homepage != 'undefined') maxWidth=530;
	else maxWidth=236;
	var first = getElementsByClassName('first');
	if(first.length>1)
		first = first[0].getElementsByTagName('img');
	var imgs = document.getElementsByTagName('img');
	while(imgs[i]) {
		if(imgs[i].width > maxWidth && imgs[i].name!="shadow") {
			if (has(imgs[i], first) && maxWidth==236) {
				imgs[i].height = Math.round(521 * imgs[i].height / imgs[i].width);
				imgs[i].width = 521;
				i++;
				continue;
			}
			imgs[i].height = Math.round(maxWidth * imgs[i].height / imgs[i].width);
			imgs[i].width = maxWidth;
		}
		i++;
	}
	imgs = null;
}	
	function chat() {
		if(is_logged_in1())
			window.open('http://'+global_myexit+'/mychat/index.php?userName=1&PHPSESSID='+getCookie("PHPSESSID"), 'chat', 'location=false,menubar=0,resizable=1,width=800,height=600');
		else {
			document.getElementById("login_msgs").innerHTML = 'You must log in to use chat.';
			document.getElementById("fusername1").style.backgroundPosition="-455px -87px";
			document.getElementById("fpassword").style.backgroundPosition="-530px -87px";
		}
	}

	
/*********************************************************************
 * No onMouseOut event if the mouse pointer hovers a child element 
 * *** Please do not remove this header. ***
 * This code is working on my IE7, IE6, FireFox, Opera and Safari
 * 
 * Usage: 
 * <div onMouseOut="fixOnMouseOut(this, event, 'JavaScript Code');"> 
 *		So many childs 
 *	</div>
 *
 * @Author Hamid Alipour Codehead @ webmaster-forums.code-head.com		
**/
function is_child_of(parent, child) {
	if( child != null )	
		while( child.parentNode )
			if( (child = child.parentNode) == parent )
				return true;
	return false;
}
function fixOnMouseOut(element, event, JavaScript_code) {
	var current_mouse_target = null;
	if( event.toElement )
		current_mouse_target = event.toElement;
	else if( event.relatedTarget )
		current_mouse_target = event.relatedTarget;
	if( !is_child_of(element, current_mouse_target) && element != current_mouse_target )
		eval(JavaScript_code);
}
/*********************************************************************/

function slider(){
    slider.id = 'slider';
	if(typeof document.getElementById(slider.id+'-outer') == 'undefined')return;
    slider.position = 0;
    slider.offset = document.getElementById(slider.id+'-outer').offsetLeft
	+ document.getElementById('widget2').offsetLeft;
    slider.size = document.getElementById(slider.id+'-outer').offsetWidth;
    slider.innersize = document.getElementById(slider.id+'-inner').offsetWidth;

    slider.speed = 0;
    slider.maxspeed = 10;
    slider.scroll = null;
    document.getElementById(slider.id+'-outer').onmousemove = sliderGetMouse;
}
function sliderstop(){
    if(slider.scroll){
	clearInterval(slider.scroll);
	slider.scroll = null;
    }
}

function slidermove(){
    pos = parseInt(document.getElementById(slider.id+'-inner').style.marginLeft);
    pos -= slider.speed;
    if(pos > 0) pos = 0;
    if(pos < slider.size-slider.innersize) pos = slider.size-slider.innersize;
    document.getElementById(slider.id+'-inner').style.marginLeft = pos + 'px';
}

function sliderGetMouse(e) {
    if (IE) {
	tempX = event.clientX + document.body.scrollLeft;
    } else {
	tempX = e.pageX;
    }
    tempX -= slider.offset;
    if (tempX < 0){tempX = 0}
    if (tempX > slider.size){tempX = slider.size}
    slider.position = tempX;
    slider.speed = Math.round(2 * slider.maxspeed * (slider.position / slider.size - 0.5));
    if(slider.speed > -2 && slider.speed < 2) slider.speed = 0;
    if(slider.scroll == null && slider.speed){
	slider.scroll = setInterval("slidermove()", 10);
    }
    return true;
}

function lightup(){
	document.getElementById("kmeni_video").onmouseover = function(){
		document.getElementById("kmeni_video").className="on";
		document.getElementById("kmeni_music").className="off";
	}
	document.getElementById("kmeni_music").onmouseover = function(){
		document.getElementById("kmeni_video").className="off";
		document.getElementById("kmeni_music").className="on";
	}
}

function makeObject(obj){
	var tmp;
	if(playobject.type=='local')
		tmp = '<object height="250" width="375" data="http://'+document.domain+'/modules/bendovi/player_flv_maxi.swf?'+Date()+'" type="application/x-shockwave-flash">'+
				'<param value="http://'+document.domain+'/modules/bendovi/player_flv_maxi.swf" name="movie" />'+
				'<param value="transparent" name="wmode" />'+
				'<param value="true" name="allowFullScreen" />'+
				'<param value="always" name="allowScriptAccess"/>'+
				'<param value="flv='+playobject.link+'&amp;title='+playobject.title+'&amp;showfullscreen=1&amp;showvolume=1&amp;margin=0" name="FlashVars" />'+
			'</object>';
	else if (playobject.type=='audio')
		tmp = '<a href="/'+playobject.username+'"><img src="/'+((playobject.slika!='')?playobject.slika:'files/bands_default.gif')+'" height="218" alt="'+playobject.imebenda+'" /></a>'+
				'<object style="border:1px solid #b3b3b3" type="application/x-shockwave-flash" data="http://'+document.domain+'/modules/bendovi/player_mp3_maxi.swf" width="200" height="20">'+
					'<param name="movie" value="http://'+document.domain+'/modules/bendovi/player_mp3_maxi.swf" />'+
					'<param name="bgcolor" value="#000000" />'+
					'<param value="transparent" name="wmode" />'+
					'<param name="FlashVars" value="mp3='+playobject.link+'&amp;title='+playobject.title+'&amp;width=200&amp;height=20&amp;bgcolor=000000&amp;bgcolor1=404040&amp;bgcolor2=000000&amp;showvolume=1&amp;volumewidth=30&amp;autoplay=1&amp;buttoncolor=B3B3B3&amp;buttonovercolor=E4E4E4&amp;sliderovercolor=E4E4E4&amp;slidercolor1=ffffff" />'+
				'</object>';
	else
		tmp = '<object height="250" width="375" data="'+playobject.link+'" type="application/x-shockwave-flash">'+
				'<param value="'+playobject.link+'" name="movie"/>'+
				'<param value="high" name="quality"/>'+
				'<param value="true" name="allowFullScreen"/>'+
				'<param value="always" name="allowScriptAccess"/>'+
				'<param value="transparent" name="wmode"/>'+
			'</object>';
	return tmp;
}
function showPlayer(){
	if(typeof exitmusicplayerwindow!='undefined' && !exitmusicplayerwindow.closed) {
		if(playobject.current != playobject.title) {
			if(playobject.nid=='')
				generate_player_page(playobject.link, playobject.imebenda, playobject.title, playobject.slika);
			else
				generate_player_page(playobject.nid);
			}
		exitmusicplayerwindow.focus();
		playobject.active=false;
		playobject.current = playobject.title;
	}else {
		var player = $$('#kmeni_player');
		var shader = $$('#kmeni_shader');
		shader[0].style.display = 'block';
		player[0].style.display = "block";
		player[0].style.visibility = "visible";
		$$('#kmeni_container').setStyle('display', 'block');
		if(!playobject.active || playobject.current != playobject.title)
			$('media').innerHTML = makeObject();
		playobject.current = playobject.title;
		var myFx = new Fx.Elements([player, shader],
				{duration : 500});
		myFx.start({
			'0' : { 'height' : 250,
					'width'  : 375
				},
			'1' : { 'opacity' : [0, 1] }
			});
		mf.stop();
		playobject.active=true;
		document.getElementById("blocker").style.display="block";
		$$('#content_container span')[0].innerHTML = 
			((playobject.type=='audio') ? unescape(playobject.imebenda)+' - ' : '')+
			playobject.title;
		pleya('content_container');
		if(document.getElementById("ccontent_container") != null)
			{
			pleya('ccontent_container');
			pleya('title_container');
			}
	}
}

function playerInterface(){
	var tmp1 = $$('#kmeni_container');
	var tmp2 = $$('#kmeni_container .int');
	var tmp3 = $$('#kmeni_player');
	var tmp4 = $$('#kmeni_shader');
	var blocker = document.getElementById("blocker");

	//minimize
	tmp2[1].addEvent('click', function(event){
		event.preventDefault();
		var myFx = new Fx.Elements([tmp3[0], tmp4[0]], {duration : 500});
		if (playobject.minimized) {
			myFx.start({
				'0' : {	'height' : 250,
						'width'  : 375
					},
				'1' : { 'opacity' : [0, 1] }
				});
			//mf.stop();
			tmp2[1].className = "int min";
			blocker.style.display="block";
			playobject.minimized=false;
		} else {
			myFx.start({
				'0' : {	'height' : 0,
						'width'  : 0
					},
				'1' : { 'opacity' : [1, 0] }
				});
			//mf.play();
			tmp2[1].className = "int max";
			blocker.style.display="none";
			playobject.minimized=true;
		}
		playobject.active=true;
		});
	//close
	tmp2[2].addEvent('click', function(event){
		event.preventDefault();
		closePlayer();
		tmp1.setStyle('display', 'none');
		tmp4.setStyle('display', 'none');
		tmp4.setStyle('opacity', '0');
		blocker.style.display="none";
		playobject.minimized=false;
		});
	//popout
	tmp2[0].addEvent('click', function(event){
		event.preventDefault();
		playobject.disabled=true;
		if(playobject.nid=='')
			generate_player_page(playobject.link, playobject.imebenda, playobject.title, playobject.slika);
		else
			generate_player_page(playobject.nid);
		closePlayer();
		tmp1.setStyle('display', 'none');
		tmp4.setStyle('display', 'none');
		tmp4.setStyle('opacity', '0');
		blocker.style.display="none";
		playobject.minimized=false;
		});
}
function closePlayer(){
		var el = document.getElementById("kmeni_player").style;
		el.display="none";
		$('media').innerHTML = "";
		el.width="0";
		el.height="0";
		el.visibility="visible";
		$$("#kmeni_container").setStyle('display', 'none');
		//mf.play();
		playobject.active=false;
}

function pleya(id) {
		var t = document.getElementById(id);
		childNode = (!t.childNodes[2]) ? 0 : 1;
		t.childNodes[childNode].style.left = 30+'px';
		var start = t.childNodes[childNode].offsetLeft;
		var end = t.childNodes[childNode].offsetWidth - t.offsetWidth;
		clearTimeout(playobject.nsTimeout);
		if (end>0) pleya_move(start, start, -end, t);
	}
function pleya_move(x, start, end, t, left) {
		childNode = (!t.childNodes[2]) ? 0 : 1;
		if(left==1) {
			x = (x > end) ? x - 2 : end;
			left = (x > end) ? 1 : 2;
		}
		else {
			x = (x < start) ? x + 2 : start;
			left = (x < start) ? 2 : 1;
		}
		t.childNodes[childNode].style.left = x+'px';
		playobject.nsTimeout = setTimeout(function(){pleya_move(x, start, end, t, left);}, 60);
		}

function move(tab, pixel){
    var style = document.getElementById(tab).style;
    var margin = parseInt(style.marginTop) + pixel;
    var outer = document.getElementById(tab + '-container').offsetHeight;
    var inner = document.getElementById(tab).offsetHeight;
    if(margin < outer - inner + 2) margin = outer - inner + 2;
    if(margin > 0) margin = 0;
    style.marginTop = margin + 'px';
}
function slidevids(tab, pixel, stoptabs){
    if(typeof(stoptabs) == 'undefined') stoptabs = true;
    if(typeof(tab_slide) != 'undefined' && stoptabs) clearInterval(tab_slide);
    stop();
    scroll_slide = setInterval("move('"+tab+"-list',"+(pixel * 5)+")", 1);
}

function stop(){
    if(scroll_slide) clearInterval(scroll_slide);
}
		
function paint_titles(){
	var bcn = (IE) ? 0 : 1;
	var col1 = getElementsByClassName('col1', document.getElementById("content"));
	var blocks = getElementsByClassName('block', col1[0]);
	if(blocks[0])blocks[0].childNodes[bcn].style.backgroundPosition = "-117px -325px";
	if(blocks[1]) {
		if (blocks[1].childNodes[bcn])
			blocks[1].childNodes[bcn].style.backgroundPosition = "-117px -346px";
	}
	if(blocks[2])blocks[2].childNodes[bcn].style.backgroundPosition = "-117px -304px";
}
function tabControl(id){
	var els = getElementsByClassName('tab', document.getElementById("widget"+id));
	var i = 0;
	while(els[i]) {
		els[i].onclick = function(e) {
			try{
				this.removeAttributeNode(this.getAttributeNode('href'));
			}catch(e){}
			var j = 0;
			var el = getElementsByClassName('tab', document.getElementById("widget"+id));
			while(el[j]) {el[j].className = "tab"; j++;}
			this.className = "tab active";
			$("widget_pages"+id).set({html: '<div style="margin:100px;text-align:center"><img style="float: none;" src="/themes/myexit/images/loading.gif" /></div>'});
			update("GET", 'http://'+document.domain+'/widget_pages/'+id+'/'+this.id.split('-')[2], 'tabSwitchAftermath', '');
			processed_widget = id;
			this.blur();
			return false;
			};
		i++;
		}
	}
function tabSwitchAftermath(method, c_par, result) {
		document.getElementById("widget_pages"+processed_widget).innerHTML = result;
		if (processed_widget == 2) w2controls();
		if (processed_widget == 3) w3controls();
		if (processed_widget == 1) {
				$$(".sliderblock .list li a").addEvent('click', function(e){e.preventDefault();});
		}
}
function w2SubmenuSwitchAftermath(method, c_par, result) {
	document.getElementById("w2p2content").innerHTML = result;
	slider();
	w2controls2();
}
function w2SubcontentSwitchAftermath(method, c_par, result) {
	document.getElementById("w2p2content2").innerHTML = result;
}
function w2controls(){
	var els = $$('#widget_pages2 .w2p2menu1 a');
	els.addEvent('click', function(e){e.preventDefault();});
	for(var i = 0; i< 3; i++)
		eval('els['+i+'].onclick = function(e) {$("w2p2content").set({html: \'<div style="margin:100px;text-align:center"><img style="float: none;" src="/themes/myexit/images/loading.gif" /></div>\'});update("GET", "http://"+document.domain+"/widget_content_menus/'+(i+1)+'", "w2SubmenuSwitchAftermath", "");this.blur();}');
}
function w2controls2(){
	var tip;
	if (document.getElementById("slider-outer").className=='w2p2content2sub2') tip = 'az';
	else if (document.getElementById("slider-outer").className=='w2p2content2sub3') tip = 'zanrovi';
	else return;
	var els = $$('#widget_pages2 #slider-inner a');
	els.addEvent('click', function(e){e.preventDefault();});
	if(tip=='az') {
		var slova = Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','1');
		for(var i = 0; i< 27; i++)
			eval('els['+i+'].onclick = function(e) {$("w2p2content2").set({html: \'<div style="margin:100px;text-align:center"><img style="float: none;" src="/themes/myexit/images/loading.gif" /></div>\'});update("GET", "http://"+document.domain+"/widget_content/'+slova[i]+'", "w2SubcontentSwitchAftermath", "");w2off();this.className="on";this.blur();}');
	}else{
		for(var i = 0; i< 29; i++)
			eval('els['+i+'].onclick = function(e) {$("w2p2content2").set({html: \'<div style="margin:100px;text-align:center"><img style="float: none;" src="/themes/myexit/images/loading.gif" /></div>\'});update("GET", "http://"+document.domain+"/widget_genres/'+(i+1)+'", "w2SubcontentSwitchAftermath", "");w2off();this.className="on";this.blur();}');
	}
}
function w2off() {
	var el = $$('#widget_pages2 #slider-inner a');
	var i = 0;
	while(el[i]){el[i].className="";i++;}
}
function w3controls() {
	for(var i = 0; i< 8; i++)
		eval("document.getElementById('w3t"+i+"').onmouseover = function() {var lit = $$('#widget3 .titles li');lit.removeClass('active');document.getElementById('w3t"+i+"').className='active';var lid = $$('#widget3 .data li');lid.removeClass('active');document.getElementById('w3d"+i+"').className='active';}");
}

function popup_video(nid) {
	generate_player_page(nid);
}

function change_teaser(tab, nid){
    $$(".musicvideo").load('/musicvideo/teaser/'+nid);
    return false;
}

function change_album(id){
	var i=0;
	var tmp;
    while (tmp = document.getElementById('album-'+i)) {
		tmp.style.display = 'none';
		if(document.getElementById('albumlist-'+i))
			document.getElementById('albumlist-'+i).style.backgroundColor = '#FFFFFF';
		i++;
    }
    document.getElementById('album-'+id).style.display = 'block';
    document.getElementById('albumlist-'+id).style.backgroundColor = '#DDDDDD';
    return false;
}

function nothanks(method, c_par, result){}
function content_counter(nid, part){
    update("GET", 'http://'+document.domain+'/count', 'nothanks', 'nid='+nid+'&part='+part);
}



var oldOnload = window.onload;
window.onload = function(e) {

		if(typeof oldOnload == 'function')
	       oldOnload();
		var c_mzero_a_elems = document.getElementById("mzero").getElementsByTagName("a");
		var menuRevert = new MenuRevert();
		menuRevert.start();

		reset_login_fields();
		teach_login_fields();
		is_logged_in();
		reklamazachat(); // izbaciti kad se chat ispromovise

		try{
			//initialise mooflow
			$$('.MooFlowieze').each(function(mooflow){
				new MooFlow(mooflow);
			});
			myMooFlowPage.start();
		}catch(e){}

		if(arg(0)=='comment' && arg(1)=='edit')document.getElementById("box").style.display="block";
		/*switch */
		c_mzero_a_elems[0].onmouseover = function(){
			document.getElementById("meniexitfest").style.display = 'block';
			document.getElementById("menimusic").style.display = 'none';
			document.getElementById("menimyexit").style.display = 'none';
		    };
		c_mzero_a_elems[1].onmouseover = function(){
			document.getElementById("meniexitfest").style.display = 'none';
			document.getElementById("menimusic").style.display = 'block';
			document.getElementById("menimyexit").style.display = 'none';
		    };
		c_mzero_a_elems[2].onmouseover = function(){
			document.getElementById("meniexitfest").style.display = 'none';
			document.getElementById("menimusic").style.display = 'none';
			document.getElementById("menimyexit").style.display = 'block';
		    };
		shrinkImages();

		//try{
		if(typeof homepage != 'undefined') {
			lightup();
			playerInterface();
			tabControl(1);
			tabControl(2);
			tabControl(3);
			tabControl(4);
			w3controls();
			/*var hoppingNews = new HoppingNews('');
			hoppingNews.start();

			setInterval(function(){
				if (hoppingNews.title_scroller_var) {
					if (hoppingNews.title_scroller_var % 150 == 0) hoppingNews.move_highlight();
					hoppingNews.title_scroller_var++;
				}
				},10);
				*/
			$$("#widget1 .sliderblock .list li a").addEvent('click', function(e){e.preventDefault();});
			$$("#widget1 .left a").addEvent('click', function(e){e.preventDefault();});
			$$(".musicvideo").set('load', {
                'onComplete': function(){
					$$("#widget1 .left a").addEvent('click', function(e){
  						e.preventDefault();
					});
                }
        });

			} else {
			paint_titles();
		}
		//}catch(e){}
		
		//comment x
		try{
			document.getElementById("iks").onclick = function(){
				blend("box", 300, "out");
				setTimeout(function(){document.getElementById("box").style.display='none'},300);
				};
		}catch(e){}
		var elemss = getElementsByClassName('cmnt');
	    for ( var i = 0; i < elemss.length; i++ )
	    	elemss[i].onclick = function(){
				object = document.getElementById("box").style;
				object.opacity=0;
				object.MozOpacity=0;
				object.KhtmlOpacity=0;
				object.filter = "alpha(opacity=0)";
				object.display='block';
				object = null;
				blend("box", 300, "in");
				};
	    elemss = null;

		scroll_init();
	};
