/*-------------------------------GLOBAL VARIABLES------------------------------------*/ var detect = navigator.userAgent.toLowerCase(); var OS,browser,version,total,thestring; /*-----------------------------------------------------------------------------------------------*/ //Browser detect script origionally created by Peter Paul Koch at http://www.quirksmode.org/ function getBrowserInfo() { if (checkIt('konqueror')) { browser = "Konqueror"; OS = "Linux"; } else if (checkIt('safari')) browser = "Safari" else if (checkIt('omniweb')) browser = "OmniWeb" else if (checkIt('opera')) browser = "Opera" else if (checkIt('webtv')) browser = "WebTV"; else if (checkIt('icab')) browser = "iCab" else if (checkIt('msie')) browser = "Internet Explorer" else if (!checkIt('compatible')) { browser = "Netscape Navigator" version = detect.charAt(8); } else browser = "An unknown browser"; if (!version) version = detect.charAt(place + thestring.length); if (!OS) { if (checkIt('linux')) OS = "Linux"; else if (checkIt('x11')) OS = "Unix"; else if (checkIt('mac')) OS = "Mac" else if (checkIt('win')) OS = "Windows" else OS = "an unknown operating system"; } } function checkIt(string) { place = detect.indexOf(string) + 1; thestring = string; return place; } /*-----------------------------------------------------------------------------------------------*/ function initialize(){ getBrowserInfo(); } function Pos(el, left){ var val=0; while(el != null) { val += el["offset"+(left?"Left":"Top")]; el = el.offsetParent; } return val; } function Muestra(id,tipo,op,mediaId,anchoFoto, altoFoto,titulo){ var alto=document.body.offsetHeight; $('#overlay').show(); $('#overlay').css({height:alto+'px'}); $('#'+id).show(); var altoObj=anchoObj=x=y=dd=0; var obj = document.getElementById(id); altoObj=parseInt(obj.clientHeight,10); anchoObj=parseInt(obj.clientWidth,10); // var dd=(window.pageYOffset+(alto/2)); if(window.pageYOffset){ dd=(window.pageYOffset+(altoObj/2)); } else { dd=(Math.max(document.body.scrollTop,document.documentElement.scrollTop)+(altoObj/2)); } obj.style.top=dd+"px"; x=Pos(obj, true); y=Pos(obj, false); if(anchoFoto>=anchoObj){ x=x-(Math.round((anchoFoto-anchoObj)/2)); } else { x=x-(Math.round((anchoObj-anchoFoto)/2)); } if(altoFoto>=altoObj){ y=y-(Math.round((altoFoto-altoObj)/2)); } else { y=y-(Math.round((altoObj-altoFoto)/2)); } if(y<0) {y=0;} if(x<0) {x=0;} var url="/backend/get_media.php?op="+op; $.get(url,{"tipo":tipo,"x":x,"y":y,"anchoFoto":anchoFoto,"altoFoto":altoFoto,"id":id,"op":op,"mediaId":mediaId,"titulo":titulo}, function(htm){ $('#'+id).html(htm); // $('#'+id).css({width:anchoFoto, height:altoFoto, left:x}); } ); } function Quita(id){ $('#overlay').hide(); $('#'+id).html(' '); $('#'+id).hide(); $('#'+id).css({width:"20%", height:"20%", top:"40%", left:"40%"}); } initialize();