function show_video_file(filename) {
	var msgw, msgh;
	msgw = 620;//Width
	msgh = 500;//Height

	var sWidth,sHeight;
	sWidth = (screen.width > document.body.offsetWidth?screen.width + 50:document.body.offsetWidth + 50);
	sHeight = (screen.height > document.body.offsetHeight?screen.height + 50:document.body.offsetHeight + 50);

	document.body.appendChild(
		new Element('div', {id: 'backgroundDiv'})
		.setStyle({
			position: 'absolute',
			background: "#5A5A5A",
			filter: "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=75,finishOpacity=75)",
			opacity: "0.8",
			top: '0px',
			left: '0px',
			width: '100%',
			height: '100%',
			zIndex: '100'
		})
		.observe('click', function(){
			document.body.removeChild($('backgroundDiv'));
			document.body.removeChild($('videoContainer'));
		})
	);
	
	document.body.appendChild(
		new Element('div', {id: 'videoContainer'})
		.setStyle({
			position: 'absolute',
			left: "50%",
			top: "50%",
			marginLeft: "-" + (msgw / 2) + "px",
			marginTop: document.documentElement.scrollTop * 1 - 300 + "px",
			width: msgw + "px",
			height: msgh + "px",
			border: '1px solid #A70000',
			backgroundColor: '#EFEFEF',
			zIndex: '101'
		})
	);
	
	$('videoContainer').appendChild(
		new Element('div')
		.setStyle({
			backgroundColor: '#A70000',
			padding: '0px',
			textAlign: 'right',
			borderBottom: '1px solid #A70000'
		})
		.update(
			new Element('img', {src: '/ui/img/close_with_text.png'})
			.setStyle({
				cursor: 'pointer'
			})
			.observe('click', function() {
				document.body.removeChild($('backgroundDiv'));
				document.body.removeChild($('videoContainer'));
			})
		)
	);
	
	//<object type="application/x-shockwave-flash" data="/ui/img/video/botez.swf" width="400" height="300"><param name="movie" value="/ui/img/video/botez.swf"></object>
	
	$('videoContainer').appendChild(
		new Element('div', {id: 'flash_div'})
		.setStyle({
			padding: '10px'
		})
	);
	
	$('flash_div').innerHTML = '<object type="application/x-shockwave-flash" data="/ui/img/video/' + filename + '" width="600" height="450"><param name="movie" value="/ui/img/video/' + filename + '"></object>';	
}

//function show_submenu(objSender, menu) {
//	hide_submenu();
//	var objPos = objSender.cumulativeOffset();
//	
//	document.body.appendChild(new Element('div', {id: 'mnuBgDiv'})
//		.setStyle({
//			position: 'absolute',
//			top: objPos['top'] * 1 + objSender.getHeight() - 4 + 'px', 
//			left: objPos['left'] * 1 + 'px',
//			zIndex: '1001'
//		})
//		.observe('mouseout', function(event) {
//			var e = event || window.event;
//			if (
//				(
//					(e.clientX < $('mnuBgDiv').cumulativeOffset()['left']) || 
//					(e.clientX > $('mnuBgDiv').cumulativeOffset()['left'] + $('mnuBgDiv').getWidth())
//				) ||
//				(
//					(e.clientY < $('mnuBgDiv').cumulativeOffset()['top']) || 
//					(e.clientY > $('mnuBgDiv').cumulativeOffset()['top'] + $('mnuBgDiv').getHeight())
//				)
//			) if ($('mnuBgDiv')) document.body.removeChild($('mnuBgDiv'));
//		})
//	);
//	
//	
//	$('mnuBgDiv').appendChild(
//		new Element('div')
//		.setStyle({paddingLeft: '39px'})
//		.update(new Element('img', {src: '/ui/img/menu/icons/arrow.png'}))
//	);
//	$('mnuBgDiv').appendChild(
//		new Element('div', {id: 'submenu_container'})
//		.setStyle({
//			border: '1px solid #A70000',
//			backgroundColor: '#E5E5E5'
//		})
//	);
//	var m_table, m_row, m_cell;
//	m_table = new Element('table', {cellSpacing: 0});
//	m_row = m_table.insertRow(-1);
//	m_cell = m_row.insertCell(-1);
//	m_cell.setStyle({
//		backgroundImage: 'url(/ui/img/menu/icons/back.png)',
//		backgroundRepeat: 'repeat-y',
//		width: '46px'
//	});
//	if (menu == 'home') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'locatie-proprie-in-brasov') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'despre-noi') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'servicii') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'portofoliu') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'galerie') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	if (menu == 'contact') m_cell.setStyle({textAlign: 'center', verticalAlign: 'top'}).update(new Element('img', {src: '/ui/img/menu/icons/mnu_icon.png'}).setStyle({margin: '6px auto'}));
//	
//	m_cell = m_row.insertCell(-1);
//	m_cell.noWrap = 'nowrap';
//	m_cell.setStyle({
//		padding: '6px'/*,
//		lineHeight: '20px'*/
//	});
//	if (menu == 'home') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/home'}).setStyle({display: 'block'}).update('Home'));
//	}
//	if (menu == 'locatie-proprie-in-brasov') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/locatie-proprie-in-brasov#prezentare'}).setStyle({display: 'block'}).update('Locatie proprie in Brasov'));
//	}
//	if (menu == 'despre-noi') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/despre-noi'}).setStyle({display: 'block'}).update('Despre noi'));
//	}
//	if (menu == 'servicii') {
//		m_cell.appendChild(new Element('div', {'class': 'normal-text'}).setStyle({color: '#A70000'}).update('Servicii'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#muzica-si-divertisment'}).setStyle({display: 'block'}).update('&#0187; Muzica si Divertisment'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#sonorizare-lumini-si-efecte-speciale'}).setStyle({display: 'block'}).update('&#0187; Sonorizare, Lumini si Efecte Speciale'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#fotografii'}).setStyle({display: 'block'}).update('&#0187; Fotografii'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#filmari-video'}).setStyle({display: 'block'}).update('&#0187; Filmari Video'));
//		m_cell.appendChild(new Element('div', {'class': 'normal-text'}).setStyle({color: '#A70000'}).update('Oferte promotionale'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#dj-cu-sonorizare-si-lumini'}).setStyle({display: 'block'}).update('&#0187; DJ cu Sonorizare si Lumini'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#karaoke'}).setStyle({display: 'block'}).update('&#0187; Karaoke'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-platinum'}).setStyle({display: 'block'}).update('&#0187; Fotografii - Pachet Platinum'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-gold'}).setStyle({display: 'block'}).update('&#0187; Fotografii - Pachet Gold'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-baza'}).setStyle({display: 'block'}).update('&#0187; Fotografii - Pachet Baza'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#filmari-video-pachet-platinum'}).setStyle({display: 'block'}).update('&#0187; Filmari video - Pachet Platinum'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#filmari-video-pachet-gold'}).setStyle({display: 'block'}).update('&#0187; Filmari video - Pachet Gold'));
//	}
//	if (menu == 'portofoliu') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/portofoliu-clienti'}).setStyle({display: 'block'}).update('Portofoliu clienti'));
//	}
//	if (menu == 'galerie') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie#foto'}).setStyle({display: 'block'}).update('Galerie foto'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie#video'}).setStyle({display: 'block'}).update('Galerie video'));
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie#audio'}).setStyle({display: 'block'}).update('Galerie audio'));
//	}
//	if (menu == 'contact') {
//		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/contact'}).setStyle({display: 'block'}).update('Contact'));
//	}
//	$('submenu_container').appendChild(m_table);
//}

function findPosX(obj) {
	var curleft = 0;
	if(obj.offsetParent)
	while(1) {
		curleft += obj.offsetLeft;
		if(!obj.offsetParent) break;
		obj = obj.offsetParent;
	}
	else if(obj.x) curleft += obj.x;
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	if(obj.offsetParent)
	while(1) {
		curtop += obj.offsetTop;
		if(!obj.offsetParent) break;
		obj = obj.offsetParent;
	}
	else if(obj.y) curtop += obj.y;
	return curtop;
}


function show_submenu(objSender, menu) {
	hide_submenu();
	
	var objPos = {'left': findPosX(objSender), 'top': findPosY(objSender)}; //objSender.cumulativeOffset();
	
	document.body.appendChild(new Element('div', {id: 'mnuBgDiv'})
		.setStyle({
			position: 'absolute',
			top: objPos['top'] * 1 + 137 + 'px', 
			left: objPos['left'] * 1 + 10 + 'px',
			zIndex: '1001'
		})
		.observe('mouseout', function(event) {
			var e = event || window.event;
			if (
				(
					(e.clientX < $('mnuBgDiv').cumulativeOffset()['left']) || 
					(e.clientX > $('mnuBgDiv').cumulativeOffset()['left'] + $('mnuBgDiv').getWidth())
				) ||
				(
					(e.clientY < $('mnuBgDiv').cumulativeOffset()['top']) || 
					(e.clientY > $('mnuBgDiv').cumulativeOffset()['top'] + $('mnuBgDiv').getHeight())
				)
			) if ($('mnuBgDiv')) document.body.removeChild($('mnuBgDiv'));
		})
	);
	
	
	$('mnuBgDiv').appendChild(
		new Element('div')
		.setStyle({paddingLeft: '29px'})
		.update(new Element('img', {src: '/ui/img/menu/icons/arrow.png'}))
	);
	$('mnuBgDiv').appendChild(
		new Element('div', {id: 'submenu_container'})
		.setStyle({
			border: '1px solid #A70000',
			backgroundColor: '#E5E5E5'
		})
	);
	var m_table, m_row, m_cell;
	m_table = new Element('table', {cellSpacing: 0});
	m_row = m_table.insertRow(-1);
	
	m_cell = m_row.insertCell(-1);
	m_cell.className = 'submenu-cell';
	m_cell.noWrap = 'nowrap';
	if (menu == 'home') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/home'}).update('&#0187; Home'));
	}
	if (menu == 'locatie-proprie-in-brasov') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/locatie-proprie-in-brasov#prezentare'}).update('&#0187; Locatie proprie in Brasov'));
	}
	if (menu == 'despre-noi') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/despre-noi'}).update('&#0187; Despre noi'));
	}
	if (menu == 'servicii') {
		m_cell.appendChild(new Element('div', {'class': 'normal-text'}).setStyle({color: '#A70000'}).update('Servicii'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#muzica-si-divertisment'}).update('&#0187; Muzica si Divertisment'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#sonorizare-lumini-si-efecte-speciale'}).update('&#0187; Sonorizare, Lumini si Efecte Speciale'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#fotografii'}).update('&#0187; Fotografii'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/servicii#filmari-video'}).update('&#0187; Filmari Video'));
		m_cell.appendChild(new Element('div', {'class': 'normal-text'}).setStyle({color: '#A70000'}).update('Oferte promotionale'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#dj-cu-sonorizare-si-lumini'}).update('&#0187; DJ cu Sonorizare si Lumini'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#karaoke'}).update('&#0187; Karaoke'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-platinum'}).update('&#0187; Fotografii - Pachet Platinum'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-gold'}).update('&#0187; Fotografii - Pachet Gold'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#fotografii-pachet-baza'}).update('&#0187; Fotografii - Pachet Baza'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#filmari-video-pachet-platinum'}).update('&#0187; Filmari video - Pachet Platinum'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/oferte-promotionale#filmari-video-pachet-gold'}).update('&#0187; Filmari video - Pachet Gold'));
	}
	if (menu == 'portofoliu') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/portofoliu-clienti'}).update('&#0187; Portofoliu clienti'));
	}
	if (menu == 'galerie') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie/foto'}).update('&#0187; Galerie foto'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie/video'}).update('&#0187; Galerie video'));
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/galerie/audio'}).update('&#0187; Galerie audio'));
	}
	if (menu == 'contact') {
		m_cell.appendChild(new Element('a', {'class': 'submenu-label', href: '/index/contact'}).update('&#0187; Contact'));
	}
	$('submenu_container').appendChild(m_table);
}

function hide_submenu() {
	if ($('mnuBackgroundDiv')) document.body.removeChild($('mnuBackgroundDiv'));
	if ($('mnuBgDiv')) document.body.removeChild($('mnuBgDiv'));
}

function zoomInPhoto(objSender) {
	if ($('galleryZoomDiv')) document.body.removeChild($('galleryZoomDiv'));
	
	var objPos = {'left': findPosX(objSender), 'top': findPosY(objSender)};
	
	var thumbImg = new Image();
	thumbImg.src = objSender.src;
	var thumbHeight = thumbImg.height / 2;
	var thumbWidth = thumbImg.width / 2;
	var mediumHeight = thumbImg.height;
	var mediumWidth = thumbImg.width;

	document.body.appendChild(new Element('div', {id: 'galleryZoomDiv'})
		.setStyle({
			position: 'absolute',
			top: objPos['top'] - (mediumHeight - thumbHeight) / 2 + 'px',
			left: objPos['left'] - (mediumWidth - thumbWidth) / 2 + 'px',
			zIndex: '101'
		})
		.update(
			new Element('img', {src: objSender.src})
			.setStyle({
				border: '2px solid #FFFFFF',
				cursor: 'pointer'
			})
		)
		.observe('mouseout', function() {
			document.body.removeChild($('galleryZoomDiv'));
		})
		.observe('click', function() {
			document.body.appendChild(new Element("div", {id: "backgroundDiv"})
				.setStyle({
					position: "absolute",
					top: "0px",
					left: "0px",
					width: ((screen.width > document.body.clientWidth)?screen.width:document.body.clientWidth) - 15 + "px",
					height: ((screen.height > document.body.clientHeight)?screen.height:document.body.clientHeight) + "px",
					background: "#DFDFDF",
					filter: "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=75,finishOpacity=75)",
					opacity: "0.8",
					zIndex: "100"
				})
				.observe('click', function() {
					if ($('backgroundDiv')) document.body.removeChild($('backgroundDiv'));
					if ($('galleryZoomDiv')) document.body.removeChild($('galleryZoomDiv'));
				})
			);
			
			document.body.removeChild($('galleryZoomDiv'));
			
			var bigImg = new Image();
			bigImg.onload = function() {
				document.body.appendChild(new Element('div', {id: 'galleryZoomDiv'})
					.setStyle({
						position: 'absolute',
						top: '50%',
						left: '50%',
						marginTop: document.documentElement.scrollTop * 1 - bigImg.height / 2 + 'px',
						marginLeft: - bigImg.width / 2 + 'px',
						zIndex: '1000',
						width: bigImg.width + 'px',
						textAlign: 'center',
						border: '4px solid #A70000'
					})
					.observe('click', function() {
						if ($('backgroundDiv')) document.body.removeChild($('backgroundDiv'));
						if ($('galleryZoomDiv')) document.body.removeChild($('galleryZoomDiv'));
					})
				);
				$('galleryZoomDiv').appendChild(new Element('div')
					.setStyle({
						backgroundColor: '#A70000',
						fontFamily: 'trebuchet ms',
						fontSize: '14px',
						color: '#FFFFFF',
						textAlign: 'center',
						padding: '6px'
					})
					.update('PartyHelp - Galerie Foto')
				);
				$('galleryZoomDiv').appendChild(new Element('img', {src: objSender.src.replace('thumb', 'big'), title: 'click pentru a inchide poza'}));
				$('galleryZoomDiv').appendChild(new Element('div')
					.setStyle({
						backgroundColor: '#A70000',
						fontFamily: 'trebuchet ms',
						fontSize: '12px',
						color: '#FFFFFF',
						textAlign: 'right',
						padding: '3px 10px 3px 10px'
					})
					.update(new Element('span').update('inchide'))
				);
			};
			bigImg.src = objSender.src.replace('thumb', 'big');
		})
	);
}

function showBig(objSender) {			
	var bigImg = new Image();
	bigImg.onload = function() {
		document.body.appendChild(new Element("div", {id: "backgroundDiv"})
			.setStyle({
				position: "absolute",
				top: "0px",
				left: "0px",
				width: ((screen.width > document.body.clientWidth)?screen.width:document.body.clientWidth) - 15 + "px",
				height: ((screen.height > document.body.clientHeight)?screen.height:document.body.clientHeight) + "px",
				background: "#DFDFDF",
				filter: "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=75,finishOpacity=75)",
				opacity: "0.8",
				zIndex: "100"
			})
			.observe('click', function() {
				if ($('backgroundDiv')) document.body.removeChild($('backgroundDiv'));
				if ($('galleryZoomDiv')) document.body.removeChild($('galleryZoomDiv'));
			})
		);
		document.body.appendChild(new Element('div', {id: 'galleryZoomDiv'})
			.setStyle({
				position: 'absolute',
				top: '50%',
				left: '50%',
				marginTop: document.documentElement.scrollTop * 1 - bigImg.height / 2 + 'px',
				marginLeft: - bigImg.width / 2 + 'px',
				zIndex: '1000',
				width: bigImg.width + 'px',
				textAlign: 'center',
				border: '4px solid #A70000'
			})
			.observe('click', function() {
				if ($('backgroundDiv')) document.body.removeChild($('backgroundDiv'));
				if ($('galleryZoomDiv')) document.body.removeChild($('galleryZoomDiv'));
			})
		);
		$('galleryZoomDiv').appendChild(new Element('div')
			.setStyle({
				backgroundColor: '#A70000',
				fontFamily: 'trebuchet ms',
				fontSize: '14px',
				color: '#FFFFFF',
				textAlign: 'center',
				padding: '6px'
			})
			.update('PartyHelp - Galerie Foto')
		);
		$('galleryZoomDiv').appendChild(new Element('img', {src: objSender.src.replace('thumb', 'big'), title: 'click pentru a inchide poza'}));
		$('galleryZoomDiv').appendChild(new Element('div')
			.setStyle({
				backgroundColor: '#A70000',
				fontFamily: 'trebuchet ms',
				fontSize: '12px',
				color: '#FFFFFF',
				textAlign: 'right',
				padding: '3px 10px 3px 10px'
			})
			.update(new Element('span').update('inchide'))
		);
	};
	bigImg.src = objSender.src.replace('thumb', 'big');
}
