// TJPzoom 3 * János Pál Tóth // 2007.07.12 // Docs @ http://valid.tjp.hu/tjpzoom/ // News @ http://tjpzoom.blogspot.com/ function TJPzoomswitch(obj) { TJPon[obj]=((TJPon[obj])?(0):(1)); return TJPon[obj]; } function TJPzoomif(obj,highres) { if(TJPon[obj]) {TJPzoom(obj,highres);} } function TJPzoom(obj,highres) { TJPzoomratio=TJPzoomheight/TJPzoomwidth; if(TJPzoomoffsetx > 1) { TJPzoomoffset='dumb'; TJPzoomoffsetx=TJPzoomoffsetx/TJPzoomwidth; TJPzoomoffsety=TJPzoomoffsety/TJPzoomheight; } if(!obj.style.width) { if(obj.width > 0) { //educated guess obj.style.width=obj.width+'px'; obj.style.height=obj.height+'px'; } } if(typeof(highres) != typeof('')) {highres=obj.src} var TJPstage=document.createElement("div"); TJPstage.style.width=obj.style.width; TJPstage.style.height=obj.style.height; TJPstage.style.overflow='hidden'; TJPstage.style.position='absolute'; if(typeof(TJPstage.style.filter) != typeof(nosuchthing)) { //hi IE if(navigator.appVersion.indexOf('Mac') == -1) { //hi Mac IE TJPstage.style.filter='alpha(opacity=0)'; TJPstage.style.backgroundColor='#ffffff'; } } else { //hi decent gentlemen TJPstage.style.backgroundImage='transparent'; } TJPstage.setAttribute('onmousemove','TJPhandlemouse(event,this);'); TJPstage.setAttribute('onmousedown','TJPhandlemouse(event,this);'); TJPstage.setAttribute('onmouseup','TJPhandlemouse(event,this);'); TJPstage.setAttribute('onmouseout','TJPhandlemouse(event,this);'); if(navigator.userAgent.indexOf('MSIE')>-1) { TJPstage.onmousemove = function() {TJPhandlemouse(event,this);} TJPstage.onmousedown = function() {TJPhandlemouse(event,this);} TJPstage.onmouseup = function() {TJPhandlemouse(event,this);} TJPstage.onmouseout = function() {TJPhandlemouse(event,this);} } obj.parentNode.insertBefore(TJPstage,obj); TJPwin=document.createElement("div"); TJPwin.style.width='0px'; TJPwin.style.height='0px'; TJPwin.style.overflow='hidden'; TJPwin.style.position='absolute'; TJPwin.style.display='none'; tw1='
' + tw1+(TJPshadowthick+TJPborderthick)+'px 0 0 '+(TJPshadowthick+TJPborderthick)+'px; width:'+(TJPzoomwidth-TJPshadowthick*2-TJPborderthick*2)+'px;height:'+(TJPzoomheight-TJPshadowthick*2-TJPborderthick*2)+'px;">'+((obj.src!=highres)?(''):(''))+''; if(highres != obj.src) { TJPwin.innerHTML+='
'+TJPloading+'
'; } if(TJPshadowthick>0) { st1=''; TJPwin.innerHTML+= st1+'0 0 0 0 ; width:'+TJPshadowthick*2+'px; height:'+TJPshadowthick*2+'px;'+st2+'\''+TJPshadow+'nw.png\')">