var lastWidth  = 0;var lastHeight = 0;var callbackFunction = '';function URLEncode( plaintext ){	// The Javascript escape and unescape functions do not correspond	// with what browsers actually do...	var SAFECHARS = "0123456789" +					// Numeric					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic					"abcdefghijklmnopqrstuvwxyz" +					"-_.!~*'()";					// RFC2396 Mark characters	var HEX = "0123456789ABCDEF";	var encoded = "";	for (var i = 0; i < plaintext.length; i++ ) {		var ch = plaintext.charAt(i);	    if (ch == " ") {		    encoded += "+";				// x-www-urlencoded, rather than %20		} else if (SAFECHARS.indexOf(ch) != -1) {		    encoded += ch;		} else {		    var charCode = ch.charCodeAt(0);			if (charCode > 255) {			    alert( "Unicode Character '"                         + ch                         + "' cannot be encoded using standard URL encoding.\n" +				          "(URL encoding only supports 8-bit characters.)\n" +						  "A space (+) will be substituted." );				encoded += "+";			} else {				encoded += "%";				encoded += HEX.charAt((charCode >> 4) & 0xF);				encoded += HEX.charAt(charCode & 0xF);			}		}	} // for	return encoded;};function URLDecode( encoded ){   // Replace + with ' '   // Replace %xx with equivalent character   // Put [ERROR] in output if %xx is invalid.   var HEXCHARS = "0123456789ABCDEFabcdef";   var plaintext = "";   var i = 0;   while (i < encoded.length) {       var ch = encoded.charAt(i);	   if (ch == "+") {	       plaintext += " ";		   i++;	   } else if (ch == "%") {			if (i < (encoded.length-2) 					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {				plaintext += unescape( encoded.substr(i,3) );				i += 3;			} else {				alert( 'Bad escape combination near ...' + encoded.substr(i) );				plaintext += "%[ERROR]";				i++;			}		} else {		   plaintext += ch;		   i++;		}	} // while   return plaintext;};/** * Tanca el diàleg */function closeDialog() {	if( typeof(window.customCloseDialog) == 'function' ) customCloseDialog();	fadeOutScreen();	el = window.top.document.getElementById( 'jsWindow' );	js = window.top.document.getElementById( 'jsDialog' );        //Si es internet explorer eliminem el contingut del dialeg, ja que els audios continuen sonant.    var ua = navigator.userAgent.toLowerCase();    var msie = ua.indexOf("msie ");    if ( msie > 0 ) $('#jsWindow').html('');    	if( el ) el.parentNode.removeChild(el);	if( js ) js.parentNode.removeChild(js);	window.customCloseDialog = '';		if ((typeof(callbackFunction) != 'undefined') && (callbackFunction != '')) {		eval(callbackFunction);		callbackFunction = '';	}}/** * Tanca el diï¿½leg */function closeDialogAlert() {	fadeOutScreen({alerta:'Alerta'});	try{		el = window.top.document.getElementById( 'jsWindowAlert' );		js = window.top.document.getElementById( 'jsDialogAlert' );	}catch(err){		el = window.self.document.getElementById( 'jsWindowAlert' );		js = window.self.document.getElementById( 'jsDialogAlert' );	}		if( el ) el.parentNode.removeChild(el);	if( js ) js.parentNode.removeChild(js);}/* Demana una confirmació i, de ser certa, crida una URL */function ecms_confirm(question,url_true) {	if(confirm(question)) {		window.location.href=url_true;	}	}/** *  */function dialogAjaxLoadURL(url) {	var callback = {		success: function(o) {			el = window.top.document.getElementById('divJSDialogContent');						var scriptStartText = "<script id=\"initDlgScript\" type=\"text/javascript\">";			var scriptEndText   = "</script>";			var js   = "";			var html = "";						startScript = o.responseText.search(/<script [^>]*>/i);// indexOf(scriptStartText);			endScript = o.responseText.search(/<\/script>/i); //indexOf(scriptEndText);						if (startScript > -1) {				html = o.responseText.substring(0, startScript - 1);				js   = o.responseText.substring(startScript, endScript - 1);				js   = js.substring(js.search(/>/i)+1);					var head   = window.top.document.getElementsByTagName("head")[0];				var script = window.top.document.getElementById('jsDialog');				if (script) {					script.parentNode.removeChild(script);				}				script = window.top.document.createElement('script');				script.type = "text/javascript";				script.id = "jsDialog";				script.text = js;				head.appendChild(script);				el.innerHTML = html;			} else {				el.innerHTML = o.responseText;			}						//If we have "tabbertabs" to enable			if (o.responseText.indexOf("tabber") > -1) {				var tabberArgs = ({});				el = window.top.document.getElementById('dialog_tabber_object');				tabber = new tabberObj(tabberArgs);				tabber.init(el);			}			if (o.responseText.indexOf("InputTextMandatory") > -1) {				checkMandatoryStartup();			}			//Execute an "Startup" function				if (o.responseText.indexOf("jsInitDialog()") > -1) {				jsInitDialog();			}		},		upload: function(o) {			this.success(o);		}	}	var cObj = YAHOO.util.Connect.asyncRequest('GET',url, callback );}/** * Obté la mida de la pàgina */function getPageSizeWithScroll(){	try{		if (window.top.innerHeight && window.top.scrollMaxY) {// Firefox			yWithScroll = window.top.innerHeight + window.top.scrollMaxY;			xWithScroll = window.top.innerWidth + window.top.scrollMaxX;		} else if (window.top.document.body.scrollHeight > window.top.document.body.offsetHeight){ // all but Explorer Mac			yWithScroll = window.top.document.body.scrollHeight;			xWithScroll = window.top.document.body.scrollWidth;		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari			yWithScroll = window.top.document.body.offsetHeight;			xWithScroll = window.top.document.body.offsetWidth;	  	}		}catch(err){		if (window.self.innerHeight && window.self.scrollMaxY) {// Firefox			yWithScroll = window.self.innerHeight + window.self.scrollMaxY;			xWithScroll = window.self.innerWidth + window.self.scrollMaxX;		} else if (window.self.document.body.scrollHeight > window.self.document.body.offsetHeight){ // all but Explorer Mac			yWithScroll = window.self.document.body.scrollHeight;			xWithScroll = window.self.document.body.scrollWidth;		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari			yWithScroll = window.self.document.body.offsetHeight;			xWithScroll = window.self.document.body.offsetWidth;	  	}	}		arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );	return arrayPageSizeWithScroll;}/** * Enfosqueix la finestra */function fadeInScreen(params) {	alerta = '';		if(params!=null && params.alerta=='Alerta'){			alerta = 'Alerta';	}		ps = getPageSizeWithScroll();	div = "<div class=\"fade_screen\" style=\"width:"+ps[0]+"px;height:"+ps[1]+"px;position:absolute;top:0;left:0;z-index:999;\" id=\"_fade_div"+alerta+"\">&nbsp;</div>";	try{		var newcontent = window.top.document.createElement('div'); 		newcontent.innerHTML = div; 		window.top.document.getElementsByTagName("body")[0].appendChild(newcontent);		newcontent.style.top = '0px';		newcontent.style.left = '0px';		}catch(err){		var newcontent = window.self.document.createElement('div'); 		newcontent.innerHTML = div; 		window.self.document.getElementsByTagName("body")[0].appendChild(newcontent);		newcontent.style.top = '0px';		newcontent.style.left = '0px';	}}/** * Aclareix la finestra */function fadeOutScreen(params) {	alerta = '';	if(params!=null && params.alerta=='Alerta'){						alerta = 'Alerta';	}		try{		el = window.top.document.getElementById( '_fade_div'+alerta );		}catch(err){		el = window.self.document.getElementById( '_fade_div'+alerta );	}		if( el ) {		el.parentNode.removeChild(el);	}}/** * Obre un cuadre de diàleg mostrant un contingut obtingut via AJAX *       { *       	width: amplada *       	height: alçada *       	showclose: mostra el botó de tancar o no *          title: títol del diàleg *          url: Adreça a consultar *          color: Color del diàleg *       } */function openAjaxDialog(param) {		var dw = 460;	var dh = 370;		if((typeof(param.width)!='undefined')&&(param.width!='')){		dw = parseInt(param.width);			}		if( (typeof(param.height)!='undefined')&&(param.height!='') ){		dh = parseInt(param.height);			}		openDialog( param.title, '<div style="left:'+(dw-20)+'px;top:'+(((dh-50)/2)-15)+'px;"><img src="/templates/todojunto/img/loading3.gif" width="31" height="31" /></div>', dw, dh, param.color, '', param.showclose );		if ((typeof(param.callback) != 'undefined') && (param.callback != '')) {		callbackFunction = param.callback;	}			dialogAjaxLoadURL(param.url);}/** * Obre un cuadre de diàleg mostrant una alerta */function openAlert(msg) {	dw = 350;	dh = 150;		cntnt = '<table style="width:100%;height:100%"><tr><td style="text-align:center"><img src="/templates/todojunto/img/ico/ico_alerta.gif"></td></tr><tr><td style="text-align:center">'+msg+'</td></tr><tr><td style="text-align:center"><button id="buttonOk" type="submit" style="background-color:transparent;margin:0;border:0;cursor:pointer;width:auto;" onclick="closeDialogAlert();return false;" onmouseover="rolloverBoto(this.id);" onmouseout="rolloutBoto(this.id);"><table cellpadding="0" cellspacing="0"><tr><td id="buttonOk_e" class="button_e_down"></td><td id="buttonOk_c" class="button_c_down">'+strOk+'</td><td id="buttonOk_d" class="button_d_down"></td></tr></table></button></td></tr></table>';	openDialog( 'Alerta', cntnt, dw, dh, 'blue' );}/** * Obre una finestra modal * @param (Object) path Ruta base per la plantilla (template) * @param {Object} title * @param {Object} content * @param {Object} width * @param {Object} height */function openDialog( title, content, jsWidth, jsHeight, color, dv, showclose, tipus ) {	//Obtenim la posiciï¿½ per a centrar el diï¿½leg a la pantalla    var ua = navigator.userAgent.toLowerCase();    var msie = ua.indexOf("msie ")    if ( msie > 0 ) {      // If Internet Explorer, return version number       var msieVersion = parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));    } else {                 // If another browser, return 0       var msieVersion = 0;    }       	try{		if (msie > 0) {	 		winW = window.top.document.body.offsetWidth;	  		winH = window.top.document.documentElement.clientHeight;  //IE6+ Strict	  		if(winH==0) winH = document.body.offsetHeight; //IE5-7 no strict	 	} else {				winW = window.top.innerWidth;		  		winH = window.top.innerHeight;	 	}	}catch(err){			if (msie > 0) {	 		winW = window.self.document.body.offsetWidth;	  		winH = window.self.document.documentElement.clientHeight;  //IE6+ Strict	  		if(winH==0) winH = document.body.offsetHeight; //IE5-7 no strict	 	} else {				winW = window.self.innerWidth;		  		winH = window.self.innerHeight;	 	}	} 	jsLeft = (winW - parseInt(jsWidth)) / 2;		try {		if( (msieVersion==0) || (msieVersion >= 7) ) {		jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + window.top.document.documentElement.scrollTop;		} else {			jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + window.top.document.documentElement.scrollTop;		}	} 	catch (err) {		if( (msieVersion==0) || (msieVersion >= 7) ) {		jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + window.self.document.documentElement.scrollTop;		} else {			jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + window.self.document.documentElement.scrollTop;		}	}		//Dibuixem el diàleg		if(color==null) color='black';	if(typeof(showclose)=='undefined') showclose = true;    if(typeof(tipus)=='undefined') tipus = '';		win = _dialog_header( {title:title, jsTop:jsTop, jsLeft:jsLeft, jsWidth:jsWidth, jsHeight:jsHeight, color:color, dv:dv, showClose:showclose, tipus:tipus} );	win += unescape(content);	win += _dialog_footer(color,jsWidth);		if (title == 'Alerta') {		fadeInScreen({alerta: 'Alerta'});	}else{		fadeInScreen();		}		try{		dialogWindow = window.top.document.createElement('div');		dialogWindow.innerHTML = win; 		dialogWindow.style.top = jsTop + 'px';		dialogWindow.style.left = jsLeft + 'px';		window.top.document.body.appendChild(dialogWindow);	}catch(err){		dialogWindow = window.self.document.createElement('div');		dialogWindow.innerHTML = win; 		dialogWindow.style.top = jsTop + 'px';		dialogWindow.style.left = jsLeft + 'px';		window.self.document.body.appendChild(dialogWindow);	}    	if(title=='Alerta'){		dd = new YAHOO.util.DD("jsWindowAlerta");		dd.useShim = true;		dd.setHandleElId("jsWindowHandleAlerta");	}else{				dd = new YAHOO.util.DD("jsWindow");		dd.useShim = true;		dd.setHandleElId("jsWindowHandle");	}}/** * Obre un vídeo * @param {Object} title * @param {Object} width * @param {Object} height * @param {Object} embed * @param {Object} codrecurs */function openExtVideoDialog(title,width,height,embed,codrecurs){	incStats(codrecurs);		if( (width==0) || (width=='') ) width=800;	if( (height==0)|| (height=='')) height=600;		openDialog( title, URLDecode(embed), parseInt(width)+36, parseInt(height) , 'black', 'divJSDialogResources' );}/** * Obre un cuadre de diàleg per a mostrar el reproductor de Vï¿½deo *       { *          title: títol del diàleg *          file:  *          codrecurs: *          mirror: *       } */function openFLVDialog(params,title, file, codrecurs) {    if(typeof(params.codrecurs)!="undefined"){        incStats(params.codrecurs,params.mirror);    }        if(typeof(params.mirror)=='undefined'){                params.mirror = "";    }                                              var content = '';    //Sino la tpl d'Amèria amb IE no funciona        content+= '<a href="'+params.mirror +'/'+params.file+'" style="display:block;width:425px;height:350px" id="player"></a>';        openDialog( params.title, content, 460, 364 , 'black', 'divJSDialogResources','undefined','f4v' );    flowplayer("player", "/flash/flowplayer327/flowplayer.commercial-3.2.7.swf",{        key: key_flowplayer    });}/** * Obre un cuadre de diàleg per a mostrar el reproductor de Vï¿½deo *       { *          title: títol del diàleg *          file:  *          codrecurs: *          mirror: *       } */function openFLVDialog2(params,title, file, codrecurs) {	if(typeof(params.codrecurs)!="undefined"){		incStats(params.codrecurs,params.mirror);	}			if(typeof(params.mirror)=='undefined'){				params.mirror = "";	}		var content = '';	//Sino la tpl d'Amèria amb IE no funciona		content = '<object type="application/x-shockwave-flash" data="'+params.mirror+'/flash/flowplayer/FlowPlayer.swf" width="425" height="350" id="FlowPlayer">';	content+= '	<param name="allowScriptAccess" value="always" />';	content+= '	<param name="movie" value="'+params.mirror+'/flash/flowplayer/FlowPlayer.swf" />';	content+= '	<param name="quality" value="high" />';	content+= '	<param name="scaleMode" value="showAll" />';	content+= '	<param name="allowfullscreen" value="false" />';	content+= '	<param name="wmode" value="transparent" />';	content+= '	<param name="allowNetworking" value="all" />';	content+= '	<param name="flashvars" value="config={ ';	content+= '		autoPlay: false, ';	content+= '		loop: false, ';	content+= '		initialScale: \'scale\',';	content+= '		showLoopButton: false,';	content+= '		showPlayListButtons: false,';	content+= '     showMenu: false,';	content+= '     fullScreenScriptURL: \'\',';	content+= '		playList: [';	content+= '			{ url: \''+ params.mirror +'/'+params.file+'\', type: \'flv\' }';	content+= '		]';	content+= '		}" />';	content+= '</object>';		openDialog( params.title, content, 460, 370 , 'black', 'divJSDialogResources' );}/** * Obre un cuadre de diàleg per a mostrar una imatge * @param {Object} params * 					{ * 						title: títol del arxiu *	 					file: ruta del arxiu * 						codrecurs: identificador del recurs * 						mirror: mirror on s'executara l'mp3 * 					}  */function openIMGDialog(params) {	if(typeof(params.codrecurs)!="undefined"){		incStats(params.codrecurs, params.mirror);	}		if(typeof(params.mirror)=='undefined'){		params.mirror = "";	}	margin_top =72;	margin_left=36;		//mides	width=800;	height=600;		if (navigator.appName.indexOf("Microsoft")!=-1) {	  maxH = document.body.offsetHeight - 20 /*- (margin_top*2)*/;	} else {	  maxH = window.innerHeight - 16 /*- (margin_top*2)*/;	}			if (height > maxH) {		ratio  = maxH/height;		height = maxH;		width  = Math.round(width*ratio);	}	var content = '';	//Sino la tpl d'Amèria amb IE no funciona	content = '<div height="'+height+'"><img src="'+params.mirror+'/'+params.imatge+'" alt="'+params.title+'" style="max-width:'+width+'px;width:expression(this.width>'+width+' ? \''+width+'px\' : true);max-height:'+height+'px;height:expression(this.height>'+height+'?\''+height+'px\':true);" /></div>';	openDialog( params.title, content, parseInt(width)+margin_left, parseInt(height)+margin_top , 'black', 'divJSDialogResources' );}/** * Funció genèrica per obrir qualsevol tipus de recurs, només es necessari el seu identificador * @param {Object} id Identificador del recurs a obrir    */function openResource(params){		$.get("index.php", { di: 1, p: "resources",op:"openResource",idRecurs: params.id}, 	function(data){		eval(data);	} );}/** * Obre un cuadre de diàleg per a mostrar el reproductor MP3 * @param {Object} params * 				{ * 					title: títol del arxiu * 					file: ruta del arxiu * 					codrecurs: identificador del recurs * 					mirror: mirror on s'executara l'mp3 * 				} */function openMP3Dialog(params) {	if(typeof(params.codrecurs)!="undefined"){		incStats(params.codrecurs,params.mirror);	}			if(typeof(params.mirror)=='undefined'){				params.mirror = "";	}		var content = '';	//Sino la tpl d'Amèria amb IE no funciona	    content = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="70">';    content = '<param name="movie" value="'+params.mirror+'/flash/reproductor.swf">';    content = '<param name="quality" value="high">';    content = '<embed src="'+params.mirror+'/flash/reproductor.swf?titol='+URLEncode(params.title)+'&reduccio=0&ruta='+params.mirror+params.file+'&descarrega=false&sgae=false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="70"></embed></object>';		/*content = '<object data="'+params.mirror+'/flash/webplayer/webplayer.swf" type="application/x-shockwave-flash" width="240" height="64">';	content+= '<param name="movie" value="'+params.mirror+'/flash/webplayer/webplayer.swf">';	content+= '<param name="menu" value="false">';	content+= '<param name="scale" value="noscale">';	content+= '<param name="bgcolor" value="#C0C0C0">';	content+= '<param name="flashvars" value="src='+ params.mirror +'/'+params.file+'&amp;autostart=yes&amp;loop=no&amp;debug=no">';	content+= '</object>';*/	openDialog( params.title, content, 276, 70 , 'black', 'divJSDialogResources' );}/** * Obre un diàleg per a mostrar un SWF * @param {Object} params * 						{ *				 			title: * 							file: * 							width: * 							height: * 							base_path: * 							codrecurs: * 							parametre: * 							valor:  * 						} */function openSWFDialog(params) {	if(typeof(params.mirror)=='undefined'){		params.mirror = "";	}		if(typeof(params.codrecurs)!="undefined"){		incStats(params.codrecurs,params.mirror);	}		var nova_finestra = false;		if(typeof(params.nova_finestra)!="undefined" && params.nova_finestra==1){		nova_finestra = true;	}	base_path=params.base_path;		//Sense mirror per els CD's (Temporal, eliminar 2 linies)	params.mirror = "";	base_path=params.file.substring(0, params.file.lastIndexOf('/')+1);	//Fi temporal		margin_top =72;	margin_left=36;		//mides	if( (params.width==0) || (params.width=='') ) params.width=800;	if( (params.height==0)|| (params.height=='')) params.height=600;		if (navigator.appName.indexOf("Microsoft")!=-1) {	  maxH = document.body.offsetHeight - 20 - (margin_top*2);	} else {	  maxH = window.innerHeight - 16 - (margin_top*2);	}			if (params.height > maxH) {		ratio  = maxH/params.height;		params.height = maxH;		params.width  = Math.round(params.width*ratio);	}		if(nova_finestra){		window.open('/openSwf.php?&codrecurs='+params.codrecurs+'&mirror='+params.mirror);	}else{		var content = '';	//Sino la tpl d'Amèria amb IE no funciona			content = '<div>';		content += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="'+params.width+'" height="'+params.height+'" allowFullScreen="true">';	    content += '<param name="movie" value="'+params.mirror+params.file+'" />';	    content += '<param name="quality" value="high" />';	    content += '<param name="base" value="'+base_path+'" />';	    content += '<param name="allowFullScreen" value="true" />';	    if(params.parametre!='' && params.valor!=''){    				content += '<param name="'+params.parametre+'" value="'+params.valor+'"/>';		}	    content += '<embed src="'+params.mirror+params.file+'" quality="high" base="'+base_path+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+params.width+'" height="'+params.height+'" allowFullScreen="true"></embed>';		content += '</object>';		content += '</div>';				if(params.mirror.search('mirror')!=-1){			params.mirror = params.mirror.replace('http://','');		}else{			params.mirror = '';		}				content += '<div style="text-align:center;margin-top:10px;"><a href="javascript:void(0);" onclick="window.open(\'/openSwf.php?&codrecurs='+params.codrecurs+'&mirror='+params.mirror+'\');">'+strNovaFinestra+'</a></div>';				openDialog( params.title, '', parseInt(params.width)+margin_left, parseInt(params.height)+margin_top, 'black', 'divJSDialogResources' );	    YAHOO.util.Dom.get("divJSDialogResources").innerHTML = content;	}}/** * Obre l'enllaç indicat en una nova finestra * @param {Object} url * @param {Object} codrecurs */function openLink( url, codrecurs ) {	incStats(codrecurs);	window.open(url,"_blank");}/** * Canvia la mida del diàleg * @param {Object} newWidth * @param {Object} newHeight */function resizeDialog(newWidth,newHeight) {	el = document.getElementById('jsWindowArea');	if (el) {		window.lastWidth = el.style.width;		window.lastHeight = el.style.height;		el.style.width = newWidth + 'px';		el.style.height = newHeight + 'px';	}}/** * Torna a la mida que tenia el diàleg abans de cridar a resizeDialog */function restoreDialogSize() {	resizeDialog( parseInt(window.lastWidth),parseInt(window.lastHeight));}function carregarMp3FlowPlayer(){    //wmode=opaque para que no ponga automaticamente el z-index + alto    $('.fpAudio').each(function(){            flowplayer(this.id, {wmode: "opaque",src:"/flash/flowplayer327/flowplayer.commercial-3.2.7.swf"},{                key: key_flowplayer,                plugins: {                    controls: {                            fullscreen: false,                            height: 30,                            autoHide: false                        }                    },                    clip: {                        autoPlay: false                    }            });        });}function carregarVideosActivitats(){    //wmode=opaque para que no ponga automaticamente el z-index + alto    $('.fpVideo').each(function(){        flowplayer(this.id, {wmode: "opaque",src: "/flash/flowplayer327/flowplayer.commercial-3.2.7.swf"},{            key: key_flowplayer,            clip:   {                        autoPlay: false                    }        });    });}$(document).ready(function(){    $(document).keyup(function(e) {      if (e.keyCode == 27) {  // esc          closeDialog();          closeDialogAlert();      }    });});
