// Funciones

// Cogemos el foco para traer la ventana cargada al frente
window.focus();

function MM_openPopUp(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function popImage(imagesrc,width,height) {
	var text_height = parseInt(height);
	var more_height = parseInt("0");
	height = more_height + text_height;
	var look='width='+width+',height='+height+',scrollbars=no,resizable=no'
	popwin=window.open("","",look)
	popwin.document.open()
	popwin.document.write('<html><head><title>Dr. Pérez-Escariz. Cirugía Plástica y Estética</title></head><body oncontextmenu="return false" onselectstart="return false" topmargin=0 rightmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#ecf0ef><table cellpadding=0 cellspacing=0 border=0 width=100% height=100%><tr><td align=center><a href=javascript:window.close()><img src="'+imagesrc+'" border=0 alt=\"Hacer click para cerrar\"></a></td></tr></table></body></html>')
	popwin.document.close()
}

function expandContent(cid) {
	document.getElementById(cid).style.display=(document.getElementById(cid).style.display!='block')?'block':'none'
}

function expandAllContent(num,name) {
	var counter = 1
	var total = num + 1
	while(counter < total) {
		document.getElementById(name+counter).style.display='block'
		counter++
	}
}

function contractAllContent(num,name) {
	var counter = 1
	var total = num + 1
	while(counter < total) {
		document.getElementById(name+counter).style.display='none'
		counter++
	}
}
