var ua="msie";
var W=navigator.userAgent.toLowerCase();
if(W.indexOf("opera")!=-1){
ua="opera";
}else{
if(W.indexOf("msie")!=-1){
ua="msie";
}else{
if(W.indexOf("mozilla")!=-1){
ua="gecko";
}
}
}
function _el(id){
return document.getElementById(id);
}
function concat(){
var _2=[];
for(var i=0;i<arguments.length;i++){
for(var j=0;j<arguments[i].length;j++){
_2.push(arguments[i][j]);
}
}
return _2;
}
function withoutFirst(_5){
result=[];
for(var i=1;i<_5.length;i++){
result.push(_5[i]);
}
return result;
}
function cons(_7,_8){
return concat([_7],_8);
}
Function.prototype.bind=function(_9){
var _a=this;
var _b=withoutFirst(arguments);
return function(){
_a.apply(_9,concat(_b,arguments));
};
};
Function.prototype.bindEventListener=function(_c){
var _d=this;
var _e=withoutFirst(arguments);
return function(_f){
_d.apply(_c,cons(_f||window.event,_e));
};
};
function Screenshot_vis(e){
var o=e.currentTarget||e.srcElement;
o.style.visibility="visible";
}
function Screenshot_ia(){
return false;
}
function Screenshot_addEventListener(obj,_13,_14){
if(ua=="gecko"||ua=="opera"){
obj.addEventListener(_13,_14,false);
}else{
if(ua=="msie"){
obj.attachEvent("on"+_13,_14);
}
}
}
function Screenshot_removeEventListener(obj,_16,_17){
if(ua=="gecko"||ua=="opera"){
obj.removeEventListener(_16,_17,false);
}else{
if(ua=="msie"){
obj.detachEvent("on"+_16,_17);
}
}
}
function Screenshot_createMethodReference(_18,_19){
var _1a=arguments;
return function(){
_18[_19].apply(_18,arguments,"sssss");
};
}
function Screenshot(_1b,_1c,_1d,_1e){
this.sx=0;
this.sy=0;
this.z=_1c;
this.baseuri=_1e;
this.images=_1b;
this.scaleImagePlus=0;
this.scaleImageStart=0;
this.scaleImageMinus=0;
this.map=0;
this.mapCont=_el(_1d);
this.mapImage=0;
this.help=0;
this.lvisim=Screenshot_createMethodReference(this,"visim");
this.lunzoom=Screenshot_createMethodReference(this,"unzoom");
this.lnext=Screenshot_createMethodReference(this,"next");
this.lstart=Screenshot_createMethodReference(this,"start");
this.lmap_move=Screenshot_createMethodReference(this,"map_move");
}
Screenshot.prototype.map_mouse_down=function(e){
if(ua=="gecko"){
e.cancelBubble=true;
e.preventDefault();
e.stopPropagation();
}else{
if(ua=="msie"||ua=="opera"){
window.event.cancelBubble=true;
}
}
this.map.style.cursor="move";
Screenshot_addEventListener(this.map,"mousemove",this.lmap_move);
this.sx=e.clientX;
this.sy=e.clientY;
};
Screenshot.prototype.stop_map_move=function(){
this.map.style.cursor="default";
Screenshot_removeEventListener(this.map,"mousemove",this.lmap_move);
};
Screenshot.prototype.map_mouse_up=function(e){
if(ua=="gecko"){
e.cancelBubble=true;
e.preventDefault();
e.stopPropagation();
}else{
if(ua=="msie"||ua=="opera"){
window.event.cancelBubble=true;
}
}
this.stop_map_move();
};
Screenshot.prototype.visim=function(e){
var o=e.currentTarget||e.srcElement||e;
Screenshot_removeEventListener(o,"load",this.lvisim);
o.style.left=-(o.width/2-parseInt(this.mapCont.style.width)/2)+"px";
o.style.top=-(o.height/2-parseInt(this.mapCont.style.height)/2)+"px";
this.map.style.top=0+"px";
this.map.style.left=0+"px";
o.style.visibility="visible";
};
Screenshot.prototype.map_move=function(e){
if(ua=="gecko"){
e.cancelBubble=true;
e.preventDefault();
e.stopPropagation();
}else{
if(ua=="msie"){
window.event.cancelBubble=true;
}
}
if(e){
this.map_move_to(parseInt(this.map.style.left)+e.clientX-this.sx,parseInt(this.map.style.top)+e.clientY-this.sy);
this.sx=e.clientX;
this.sy=e.clientY;
}
};
Screenshot.prototype.check_mouse_coords=function(e){
if(e.clientX>parseInt(this.mapCont.offsetLeft+parseInt(this.mapCont.style.width))){
this.stop_map_move();
}
if(e.clientX<parseInt(this.mapCont.offsetLeft)){
this.stop_map_move();
}
if(e.clientY>parseInt(this.mapCont.offsetTop+(parseInt(this.mapCont.style.height)-this.map.offsetTop))){
this.stop_map_move();
}
if(e.clientY<parseInt(this.mapCont.offsetTop)){
this.stop_map_move();
}
};
Screenshot.prototype.next=function(){
if(this.z>=(this.images.length-1)){
return;
}
this.z+=1;
this.addImage();
};
Screenshot.prototype.unzoom=function(e){
if(this.z<=0){
return;
}
this.z-=1;
this.addImage();
};
Screenshot.prototype.start=function(e){
if(this.z<=0){
return;
}
this.z=0;
this.addImage();
};
Screenshot.prototype.addScaleImages=function(){
this.scaleImagePlus=document.createElement("IMG");
this.scaleImagePlus.style.position="absolute";
this.scaleImagePlus.style.cursor="pointer";
this.scaleImagePlus.style.left="50px";
this.scaleImagePlus.style.top="10px";
this.scaleImagePlus.style.zIndex=2;
this.scaleImagePlus.alt="";
this.scaleImagePlus.title="";
this.scaleImagePlus.unselectable="on";
this.scaleImagePlus.onselectstart=Screenshot_ia;
this.scaleImagePlus.oncontextmenu=Screenshot_ia;
this.scaleImagePlus.style.MozUserSelect="none";
this.scaleImagePlus.style.border="0";
if(ua=="gecko"){
this.scaleImagePlus.style.visibility="hidden";
Screenshot_addEventListener(this.scaleImagePlus,"load",Screenshot_vis);
}
Screenshot_addEventListener(this.scaleImagePlus,"click",this.lnext);
this.mapCont.appendChild(this.scaleImagePlus);
this.scaleImagePlus.src="pc/img/control_fastforward.png";
this.scaleImageStart=document.createElement("IMG");
this.scaleImageStart.style.position="absolute";
this.scaleImageStart.style.cursor="pointer";
this.scaleImageStart.style.left="30px";
this.scaleImageStart.style.top="10px";
this.scaleImageStart.style.zIndex=2;
this.scaleImageStart.alt="";
this.scaleImageStart.title="";
this.scaleImageStart.unselectable="on";
this.scaleImageStart.onselectstart=Screenshot_ia;
this.scaleImageStart.oncontextmenu=Screenshot_ia;
this.scaleImageStart.style.MozUserSelect="none";
this.scaleImageStart.style.border="0px";
Screenshot_addEventListener(this.scaleImageStart,"click",this.lstart);
this.mapCont.appendChild(this.scaleImageStart);
this.scaleImageStart.src="pc/img/control_eject.png";
this.scaleImageMinus=document.createElement("IMG");
this.scaleImageMinus.style.position="absolute";
this.scaleImageMinus.style.cursor="pointer";
this.scaleImageMinus.style.left="10px";
this.scaleImageMinus.style.top="10px";
this.scaleImageMinus.style.zIndex=2;
this.scaleImageMinus.alt="";
this.scaleImageMinus.title="";
this.scaleImageMinus.unselectable="on";
this.scaleImageMinus.onselectstart=Screenshot_ia;
this.scaleImageMinus.oncontextmenu=Screenshot_ia;
this.scaleImageMinus.style.MozUserSelect="none";
this.scaleImageMinus.style.border="0px";
if(ua=="gecko"){
this.scaleImageMinus.style.visibility="hidden";
Screenshot_addEventListener(this.scaleImageMinus,"load",Screenshot_vis);
}
Screenshot_addEventListener(this.scaleImageMinus,"click",this.lunzoom);
this.mapCont.appendChild(this.scaleImageMinus);
this.scaleImageMinus.src="pc/img/control_rewind.png";
};
Screenshot.prototype.addImage=function(){
var f=document.createElement("IMG");
f.src=this.images[this.z];
f.style.position="absolute";
f.style.zIndex=0;
f.unselectable="on";
f.alt=this.title;
f.title=this.title;
f.onselectstart=Screenshot_ia;
f.oncontextmenu=Screenshot_ia;
f.style.MozUserSelect="none";
f.style.border="0px";
if(ua=="gecko"){
f.style.visibility="hidden";
Screenshot_addEventListener(f,"load",this.lvisim);
}else{
if(f.width!=0){
this.visim(f);
}else{
Screenshot_addEventListener(f,"load",this.lvisim);
}
}
if(!this.mapImage){
this.map.appendChild(f);
}else{
this.map.replaceChild(f,this.mapImage);
}
this.mapImage=f;
};
Screenshot.prototype.map_move_to=function(x,y){
var dx=(this.mapImage.width/2-parseInt(this.mapCont.style.width)/2);
var dy=(this.mapImage.height/2-parseInt(this.mapCont.style.height)/2);
if((x-dx)<=0&&(dx+x)>=0){
this.map.style.left=x+"px";
}
if((y-dy)<=0&&(dy+y)>=0){
this.map.style.top=y+"px";
}
};
Screenshot.prototype.initContainer=function(){
while(this.mapCont.firstChild){
this.mapCont.removeChild(this.mapCont.firstChild);
}
var pr=document.createElement("IMG");
pr.style.position="absolute";
prWidth=parseInt(pr.width);
pr.style.left=((parseInt(this.mapCont.style.width)-prWidth)/2)+"px";
pr.style.top=(parseInt(this.mapCont.style.height)-parseInt(pr.height))/2+"px";
pr.style.zIndex=0;
pr.unselectable="on";
pr.onselectstart=Screenshot_ia;
pr.oncontextmenu=Screenshot_ia;
pr.style.MozUserSelect="none";
pr.style.border="0px";
this.mapCont.appendChild(pr);
this.map=document.createElement("DIV");
this.map.style.position="absolute";
this.mapCont.appendChild(this.map);
};
Screenshot.prototype.initView=function(){
this.initContainer();
this.addImage();
this.addScaleImages();
Screenshot_addEventListener(this.map,"mousedown",Screenshot_createMethodReference(this,"map_mouse_down"));
Screenshot_addEventListener(this.map,"mouseup",Screenshot_createMethodReference(this,"map_mouse_up"));
Screenshot_addEventListener(window.document,"mousemove",Screenshot_createMethodReference(this,"check_mouse_coords"));
Screenshot_addEventListener(window.document,"mouseup",Screenshot_createMethodReference(this,"map_mouse_up"));
};

