function init() {
	setHeightOpacity();
	initMediaPlayer();
}

function setHeightOpacity() {
	var height;
	height = document.getElementById("aboutus").offsetHeight;
	document.getElementById("aboutus").style.height = height + "px";	
	height = document.getElementById("tagcloud").offsetHeight;
	document.getElementById("tagcloud").style.height = height + "px";
	height = document.getElementById("contactus").offsetHeight;
	document.getElementById("contactus").style.height = height + "px";
}

function initMediaPlayer() {
	var so = new SWFObject('jwmediaplayer/player.swf','mpl','560','420','9');
	so.addParam('allowscriptaccess','always');
	so.addParam('allowfullscreen','true');
	so.addParam('flashvars','&file=jwmediaplayer/playlist_custom.xml&backcolor=000000&frontcolor=ffffff&playlistsize=280&playlist=over&autostart=true&streamer=xmoov-streamer.php');
	so.write('player');
}

var flickrContent;
function FlickrContent(url, timer, loaderPath) {
	this.url = url;
	this.timer = timer;
	this.loaderPath = loaderPath;
	jQuery("<img>").attr("src", this.loaderPath);
	this.initTimer = function() {
		if (flickrContent.timer > 0) {
			setTimeout(flickrContent.reloadFlickrContent, flickrContent.timer);
		}
	};
	this.cacheFlickrContent = function() {
		var elts = $("#flickr_badge_wrapper > div.flickr_badge_image");
		if (elts.length > 0) {
			var data = "";
			$("#flickr_badge_wrapper").find("div.flickr_badge_image").each(function(i) {data += '<div id="flickr_badge_image'+(parseInt(i)+1)+'" class="flickr_badge_image">'+ this.innerHTML +'</div>';});
			$.ajax({
		    	type: "POST",
				url: flickrContent.url,
				data: "action=save&content=" + encodeURIComponent(data)
			});
			if ($("#flickrcontent_refresh").length > 0) {$("#flickrcontent_refresh").show();}		
		}
	};
	this.reloadFlickrContent = function () {
		var object = flickrContent;
		if ($("#flickrcontent_refresh").length > 0) {
			$("#flickrcontent_refresh").hide();
		}
		$("#flickr_badge_wrapper").html("<img src='"+ flickrContent.loaderPath +"' class='flickr_loader'>")
		$.get(object.url, {"action" : "reload"}, function(res) {document.write = function(text) {var tmp = $("#flickr_badge_wrapper").html(); $("#flickr_badge_wrapper").html(text + tmp);}; $("#flickr_badge_wrapper").html(res); flickrContent.cacheFlickrContent(); flickrContent.initTimer();}, 'script');
	};
}