﻿function MwinLoad(Lon, Lat, Alt, Tip){ 
	if ( typeof Alt == "undefined"){ Alt = 14 };
	if ( typeof Tip == "undefined"){ Tip = 'h' };
	GetE('fotoHC').innerHTML ='<div id="MapWin" style="position:relative;height:480px; width:640px;margin:40px;"></div>'
	var map = new VEMap('MapWin');
	map.LoadMap(new VELatLong(Lon, Lat), Alt ,Tip, false);
}
function scribd(link){
	var strT = ""
	strT += '<div style="margin:40px;">'
	strT += '<object id="scribd" width="' + w + '" height="' + h + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">'
	strT += '<param name="movie" value="http://d.scribd.com/ScribdViewer.swf?' + link + '&amp;page=1&amp;version=1&amp;viewMode="/>'
	strT += '<param name="allowScriptAccess" value="always"/>'
	strT += '<param name="scale" value="showall"/>'
	strT += '<param name="devicefont" value="false"/>'
	strT += '<param name="menu" value="true"/>'
	strT += '<param name="allowFullScreen" value="true"/>'
	strT += '<param name="quality" value="high"/>'
	strT += '<embed name="scribd" width="' + w + '" height="' + h + '" align="middle" allowfullscreen="true" allowscriptaccess="always" devicefont="false" loop="true" menu="fasle" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" salign="" scale="showall" src="http://d.scribd.com/ScribdViewer.swf?' + link + '&amp;page=1&amp;version=1&amp;viewMode=" type="application/x-shockwave-flash"  wmode="opaque"></embed>'
	strT += '</object></div>'
	GetE('fotoHC').innerHTML = strT
}

function foto_qua(ind){
	GetE('fotoHC').innerHTML = '<div id="play" onclick="playF()"></div><img id="fotoH" src="" alt="" width="' + w + '" height="' + h + '" onclick="FotoZoom()" style="cursor:pointer; clear:both;FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00);"/>'
	var obj1 = GetE('fotoH');
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj1.filters[0].apply();};
	if (ind==0){ obj1.src="../public/info" + Pre + "/g/nd" + playV[0] + ".jpg";}
	else { 	obj1.src="../public/info" + Pre + "/g/na" + ind + ".jpg";};
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj1.filters[0].play();};
	playF( false )
}
function video(link){
	link = "http://www.youtube.com/v/" + link
	document.getElementById('fotoHC').innerHTML = '<object width="' + w + '" height="' + h + '"><param name="movie" value="' + link + '"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="' + link + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + w + '" height="' + h + '"></embed></object>'
}
function FotoZoom(){
	var obj1 = document.getElementById('fotoZ');
	var obj2 = document.getElementById('fotoZimg');
	obj2.src = document.getElementById('fotoH').src.replace("/m/","/g/");
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj2.filters[0].apply();};
	if (obj1.style.visibility == "visible"){ obj1.style.visibility="hidden";}
	else{ obj1.style.visibility="visible";};
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj2.filters[0].play();}
}

function playF( plSt ){
	if ( typeof plSt == "undefined"){ plSt = !playSt } 
	if( plSt ){
		GetE('play').style.background="url('nvision/Tstop.png') no-repeat center center"
		playSt = true
		playT(0)
	} else{
		GetE('play').style.background="url('nvision/Tplay.png') no-repeat center center"
		playSt = false
	}
}
function playT(ind2){
	if(playSt){
		if ( ind2 >= (playV.length) ){ ind2 = 0 };
		if (GetE('fotoZ').style.visibility == "visible"){
			var obj2 = GetE('fotoZimg')}
		else {var obj2 = GetE('fotoH')}
		if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj2.filters[0].apply();};
		if (ind2==0){ obj2.src="../public/info" + Pre + "/g/nd" + playV[0] + ".jpg";}
		else { 	obj2.src="../public/info" + Pre + "/g/na" + playV[ind2]+ ".jpg";};
		if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ obj2.filters[0].play();};
		ind2+=1
		setTimeout("playT("+ ind2  +")",5000);
	} 
}

function preView(idFoto,e){
	var pre = GetE("PreFoto");
	if ( idFoto != "" ){
		//if( navigator.appName.indexOf("Microsoft Internet Explorer") >= 0 ){pre.filters[0].apply();};
		pre.src = "../public/info" + Pre + "/m/"+ idFoto + ".jpg";
		pre.style.display = "block";
		//if( navigator.appName.indexOf("Microsoft Internet Explorer") >= 0 ){pre.filters[0].play();};
	}
	else {pre.style.display = "none"};
}

function GetE(id){return document.getElementById(id)}


