﻿

function video(link){
	playF( false );
	link = "http://www.youtube.com/v/" + link;
	GetE('fotoHC').innerHTML = '<embed style="margin:0px;" src="' + link + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + w + '" height="' + h + '"></embed>';
}
function MwinLoad(Lon, Lat, Alt, Tip){ 
	playF( false );
	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 = "";
	playF( false );
	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 FotoZoom(){
	var obj1 = GetE('fotoZ');
	var obj2 = GetE('fotoZimg');
	obj2.src= GetE('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 foto_qua(ind){
	GetE('fotoHC').innerHTML = '<div id="play" onclick="playF()"></div><img id="fotoH" src="" alt="" width="320" height="240" onclick="FotoZoom()" style="cursor:pointer; clear:both;FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00);"/>';
	var srcT ="";
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ GetE('fotoH').filters[0].apply();};
	if (ind==0){ srcT = "../public/info" + Pre + "/m/nd" + playV[0] + ".jpg";}
	else { srcT = "../public/info" + Pre + "/g/na" + ind + ".jpg";};
	GetE('fotoH').src = srcT ;
	if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ GetE('fotoH').filters[0].play();};
	playF( false );
}
function playF( plSt ){
	if ( typeof plSt == "undefined"){ plSt = !playSt } ;
	if( plSt ){
		GetE('play').style.background="url('style/Tstop.png') no-repeat center center";
		playSt = true;
		playT(0);
	} else{
		GetE('play').style.background="url('style/Tplay.png') no-repeat center center";
		playSt = false;
	}
}
function playT(ind2){
	if(playSt){
		var srcT = "";
		if ( ind2 >= (playV.length) ){ ind2 = 0 };
		if (ind2==0){ srcT = "../public/info" + Pre + "/m/nd" + playV[ 0 ] + ".jpg";}
		else { 	srcT="../public/info" + Pre + "/m/na" + playV[ ind2 ]+ ".jpg";};
		if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ GetE('fotoH').filters[0].apply();};
		if (GetE('fotoZ').style.visibility == "visible"){GetE('fotoZimg').src = srcT.replace("/m/","/g/");}
		else { GetE('fotoH').src  = srcT }
		if(navigator.appName.indexOf("Microsoft Internet Explorer")>=0){ GetE('fotoH').filters[0].play();};
		ind2+=1 ;
		setTimeout("playT("+ ind2  +")",5000);
	} 
}

function GetE(id){return document.getElementById(id)};