// JavaScript Document
 
//	TopUp.addPresets(AddPresets("venezuela_imgs") )
//	AddPresets(idString[,a_css])
// idString -> id del contenedor de las imagenes ( las multiples <a> )
// a_css -> css de las <a> que tienes las imagenes
$.globalIsYouTube = false;
$.globalYouTubeElem = false;
function AddPresets(idString,a_css){
	var css_a = "";
	if (typeof(a_css) != "undefined" && a_css.length > 0 ) css_a = "." + a_css
	var temp = jQuery.parseJSON( '{ "#' + idString + ' a' + css_a + '": { "title": "{alt} ({current} de {total})","readAltText": 1,"shaded": 1,"group": "' + idString + '","overlayClose":1,"layout": "quicklook"}}' )
	return temp 
}

function AddPresetsAuto(idString,a_css){
	var css_a = "";
	if (typeof(a_css) != "undefined" && a_css.length > 0 ) css_a = "." + a_css

	var temp = jQuery.parseJSON( '{ "#' + idString + ' a' + css_a + '": { "title": "{alt} ({current} de {total})","readAltText": 1,"shaded": 1,"group": "' + idString + '","overlayClose":1,"ondisplay":"startVisor()","onclose":"stopVisor()","layout": "quicklook"}}' )
	return temp 
}

function startVisor(){
	window.clearInterval($.visorTopupId)
	$.visorTopupId = window.setInterval(next,5000);
}
function stopVisor(){
	window.clearInterval($.visorTopupId)
	if($.globalIsYouTube){
		$.globalYouTubeElem.show();
	}	
}
function next(){
	TopUp.next();
}

