// JavaScript Document: MJI
	var file_played = '';
	var mjiVideo = '';
	var cTimer = 0;
function obj(id) {return document.getElementById(id)}
var isShown = '';
function show(id) {
	if (isShown != '') { // it's shown
		obj(isShown).style.display = 'none';
		if (isShown != id) {
			obj(id).style.display = 'block';
			isShown = id;
		}
		else {
			isShown = '';
		}
	}
	else { // nothing is shown
		if (obj(id)) {
			obj(id).style.display = 'block';
			isShown = id;
		}
	}
}

function show2(id, location) { // location: product_bubble
	obj(location).innerHTML = obj(id).innerHTML;
	// clear rotateContent timer!
	cTimer = 0;
}

function showPic(imgHref, newImgId) {
//	alert(obj(newImgId).src);
	obj(newImgId).src = imgHref;
}
function mainBorder() {
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	else // Explorer Mac;
		 //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	obj('main_col').style.height = eval(y-360)+'px';
}
function player() {
		mjiVideo = new SWFObject("/uploads/tx_articole/MJIPlayer.swf", "MJIPlayer", "330", "280", "8", "");
		// this line is optional, but this example uses the variable and displays this text inside the flash movie
		mjiVideo.addVariable("sContentPath", file_played);  // file_played este scris in index
		mjiVideo.write("FLVPlayer");
}

var prContents = new Array();
var prContentIndex = 0;
function rotateProjectDescription() {
	var content = obj('productContent'); 
	var divs = content.getElementsByTagName('div'); 
	for (var i=0; i<divs.length; i++) {
		if (divs[i].id != '') {
			prContents[prContents.length] = divs[i];
		}
	}
	setTimeout('rotateContent()', 1000);
}

function rotateContent() {
	cTimer++;
	if (cTimer > 6) {
		cTimer = 0;
		prContentIndex++;
		if (prContentIndex == prContents.length) {
			prContentIndex = 0;
		}
		show2(prContents[prContentIndex].id, 'product_bubble');
	}
	setTimeout('rotateContent()', 1000);
}

function dePornit() {
	slideContent();
	mainBorder();
	rotateProjectDescription();
	if (obj('FLVPlayer')) {player();}
	if (obj('motioncontainer')) fillup();
}
window.onload = dePornit;


