// JavaScript Document

$(document).ready(function(){
	$('a.showModal').click(function(e) {
		e.preventDefault();
	
		if( $(this).attr("alto") == undefined || $(this).attr("ancho") == undefined) {
			alto = 650; ancho = 840;
		} else {
			var alto = parseInt($(this).attr("alto"));
			var ancho = parseInt($(this).attr("ancho"));
		}
		
		var $this = $(this);
		var horizontalPadding = 15;
		var verticalPadding = 15;
		tmp=$('<iframe style="background: white;" id="site" src="' + this.href + '" />').dialog({
			title: ($this.attr('title')) ? $this.attr('title')+" " : 'Site',
			autoOpen: true,
			width: ancho,
			height: alto,
			modal: true,
			resizable: false,
			autoResize: false
		}).width(ancho - horizontalPadding).height(alto - verticalPadding);
	});
})
function cerrarDialog(){
	$(tmp).dialog('close');
}

function foco(obj,inicial){
	if(obj.value==inicial){
		obj.value='';
	}
}
function desenfoque(obj,inicial){
	if(obj.value==''){
		obj.value=inicial;
	}
}
