﻿function parseLinks() {
	var as = document.getElementsByTagName('a');
	var as_no = as.length;
	if (as_no == 0) return false;
	
	for (var i = 0; i < as_no; i++) {
		if (as[i].rel == 'external') as[i].target = "_blank";
	}
	
}

function displayApp() {
	document.getElementById("app").style.display = "block";
}

var embedSWF = function(options)
{
	var defaults = {
		url: '',
		container: 'elementID',
		width: 450,
		//height: 350,
		flashVars: {},
		parameters: {
			quality: 'high',
			menu: false,
			wmode: 'transparent'
		},
		attributes: {}
	};

	if(options == undefined || options == null)
	{
		options = defaults;
	}
	else
	{
		// Allow skipping certain options to be set to the default values
		// You can pass in only the options you want to override
		for(var x in defaults)
		{
			eval('if(!options.' + x + ') options.' + x + ' = defaults.' + x + ';');
		}
	}

	swfobject.embedSWF(options.url, options.container, options.width, options.height, '9.0.0', '', options.flashVars, options.parameters, options.attributes);
}

var playMovie = function(movie)
{
	$('videoPlayer').style.display = 'block';
	embedSWF({url: "&resources/swf/player.swf", container: "videoPlayer", height: 350, flashVars: { file: "http://www.voteaza-andrei.ro/" + movie, autostart: true}});
}

var loadMovies = function()
{
embedSWF({url: "&resources/swf/player.swf", container: "videoPlayer1", height: 350, flashVars: { file: "http://www.voteaza-andrei.ro/@uploads/flv/" + "antena3.flv" , autostart: false}});
embedSWF({url: "&resources/swf/player.swf", container: "videoPlayer2", height: 350, flashVars: { file: "http://www.voteaza-andrei.ro/@uploads/flv/" + "vineri.flv", autostart: false}});
}

