window.onload = init;

var what_out = new Image();
what_out.src = '/img/misc/whats-mumate-video.gif';
var what_over = new Image();
what_over.src = '/img/misc/whats-mumate.gif';

function init() {
	var e = document.getElementById('email');
	if (e != undefined) {
		e.focus();
	}

/*
	var e = document.getElementById('lookin');
	if (e != undefined) {
		document.getElementById('lookin').style.backgroundColor='#F0F0CF';
		e.style.display='block';
		
	}
*/

	var menu_main = new Array("home","music","lyric-blog","art-gallery","contacts","messages","mumatefinder","account","edit-profile","groups","specials","logout");
	var pre = new Array();
	for(i=0;i<menu_main.length;i++) {
		pre[i] = new Image();
		pre[i].src = '/img/menu/'+menu_main[i]+'.gif';
	}
	var ladekreis = new Image();
	ladekreis.src = '/img/misc/ladekreis.gif';

	ag_init();
}

function register_formcheck() {
	var e = document.getElementById('terms');
	if (e.checked == false) {
		alert("Bitte akzeptiere die AGB!");
		e.focus();
		return false;
	}
	return true;
}

function win(u,n,f) {
	n=window.open(u,n,f);
	n.focus();
}
function tranq(f,u) {
	m = new Array("&#105;","&#116;","&#111;","&#109;","&#97;","&#108;");
	document.write("<a href="+m[3]+m[4]+m[0]+m[5]+m[1]+m[2]+"&#58;"+u+"&#64;"+f+">");
	document.write(u+"&#64;"+f+"</a>");
}
function mo(e,s) {
	if (document.getElementById) {
		document.getElementById(e).src = eval(e+'_'+s+'.src');
	}
}

function login_first() {
	var e = document.getElementById('you_have_to_login_first');
	if (e.style.display=='none') {
		e.style.display='block';
		e.style.zIndex = 100;
	}
	else {
		e.style.display='none';
		var e2 = document.getElementById('email');
		if (e2 != undefined) {
			e2.focus();
		}
	}
}
var music_sel_id = false;
function music_play(s,w,h,r) {
	if (music_sel_id != s) {
		if (music_sel_id != false) {
			var e = document.getElementById('fp'+music_sel_id);
			e.style.display = 'none';
			e.innerHTML = '';
			document.getElementById('ap'+music_sel_id).style.backgroundColor = '#DAD4CE';
		}
		var e = document.getElementById('fp'+s);
		var q = 'song='+s;
		e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'" id="player"><param name="movie" value="/img/music/player.swf?'+q+'"><param name="FlashVars" value="'+q+'"><param name="wmode" value="opaque"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="/img/music/player.swf?'+q+'" quality="high" bgcolor="#ffffff" wmode="opaque" width="'+w+'" height="'+h+'" name="player" flashvars="'+q+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
		if (r!=0) {
			e.innerHTML += '<div id="ratings" style="float:right"></div>';
			ajx('/public/ajax.php?c1=specials&c2=rate&c3='+r+'&c5=mu','ratings');
		}
		e.style.display = 'block';
		music_sel_id = s;
		document.getElementById('ap'+s).style.backgroundColor = '#A4927A';
	}
	return false;
}

function ag_init() {
	var div_ag_pop = document.createElement("div");
	div_ag_pop.setAttribute("id","ag_pop");
	document.getElementsByTagName('body')[0].appendChild(div_ag_pop);
}
var ag_width = 0;
function art_gallery(user,md5,ext,w,h,title,more,rate,comments) {
	var e = document.getElementById('ag_pop');
	e.style.left = '250px';
	e.style.top = '70px';
	e.style.width = w+'px';
	e.innerHTML = '<a onclick="return art_gallery_close()" href="/art-gallery" onfocus="this.blur()"><img src="/img/art-gallery/'+md5+'.'+ext+'" width="'+w+'" height="'+h+'" /></a>';
	if (title != '') {
		e.innerHTML += '<div style="text-align:center"><small><strong>'+title+'</strong></small></div>';
	}
	e.style.display = 'block';
	changeOpac(5,'main');
	z_index_up(e);
	var ag_width = w;
	return false;
}
function art_gallery_close() {
	var e = document.getElementById('ag_pop');
	e.style.display = 'none';
	changeOpac(100,'main');
	return false;
}

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 + ")";
}
var z_index = 10;
function z_index_up(e) {
	z_index++;
	e.style.zIndex = z_index;
}

Cufon.replace('#footer', { fontFamily: 'gunplay' });
