addLoadEvent(externalLinks);
addLoadEvent(prepareGallery);
function prepareGallery(){if(document.getElementById && document.getElementsByTagName){if(document.getElementById('photo_thumbs')){var thumbs=document.getElementById('photo_thumbs');var links=thumbs.getElementsByTagName('a');var bigphoto=document.getElementById('photo_img');for(var i=0;i<links.length;i++){links[i].onclick=function(){bigphoto.style.filter="blendTrans(duration=2)";return showPic(this);};}}}};
function showPic(pic){if(document.getElementById){var p=document.getElementById('photo_img');p.style.visibility="hidden";iP=new Image();iP.onload=function(){p.src=pic.href;p.style.visibility="visible";fadeIn('photo_img',0);return false;};iP.src=pic.href;return false;}else{return true;}};
function fadeIn(id,o){if(document.getElementById){obj=document.getElementById(id);if(o<=100){setOpacity(obj,o);o+=10;window.setTimeout("fadeIn('"+id+"',"+o+")", 50);}}};
function setOpacity(obj,o){o=(o==100)?100.00:o;obj.style.filter="alpha(opacity:"+o+")";obj.style.KHTMLOpacity=o/100;obj.style.MozOpacity=o/100;obj.style.opacity=o/100;};
function externalLinks(){if(!document.getElementsByTagName){return;}var anchors=document.getElementsByTagName("a");for(var i=0;i<anchors.length;i++){var anchor = anchors[i];if (anchor.getAttribute("href")&&anchor.getAttribute("rel")=="external"){anchor.target="_blank";anchor.className="external";anchor.title="opens in a new window";}}};
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if (oldonload){oldonload();}func();}}};
