function VietEasyHTMLImage(pParent,pName,pDisabled,pSource,pDisabledSource,pCfg){
	if(!this.objType)
		this.objType="VietEasyHTMLImage";
	this.base=VietEasyHTML;
	this.base(pParent,pName,pName,pDisabled,pCfg);
	this.sEnabledSource=this.sDisabledSource=pSource;
	if(pDisabledSource)
		this.sDisabledSource=pDisabledSource;
	this.enableBase=this.enable;
	this.subscribeEvents("onclick","onmouseover","onmouseout");
}

window.toPixels=function(number){
	return number+"px";
};

window.scrollTop=function(){
	if(window.pageYOffset!=null)return window.pageYOffset;
	else if(document.documentElement&&document.documentElement.scrollTop)
		return Math.max(document.documentElement.scrollTop,document.body.scrollTop);
	else return document.body.scrollTop;
};

window.scrollLeft=function(){
	if(window.pageXOffset!=null)
		return window.pageXOffset;
	else if(document.documentElement&&document.documentElement.scrollLeft)
		return Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);
	else return document.body.scrollLeft;
};

window.scrollWidth=function(){
	return Math.max(document.body.offsetWidth,document.body.scrollWidth);};window.scrollHeight=function(){var scrollHeight=Math.max(document.body.offsetHeight,document.body.scrollHeight);if(document.documentElement)return Math.max(scrollHeight,document.documentElement.offsetHeight);else return scrollHeight;};window.clientTop=function(){if(document.documentElement)return document.documentElement.clientTop;else return document.body.clientTop;};window.clientLeft=function(){if(document.documentElement)return document.documentElement.clientLeft;else return document.body.clientLeft;};window.clientWidth=function(){var documentElement=document.documentElement;if(documentElement&&documentElement.clientWidth&&window.innerWidth)return Math.min(documentElement.clientWidth,window.innerWidth);else if(documentElement&&documentElement.clientWidth)return documentElement.clientWidth;else if(window.innerWidth)return window.innerWidth;else if(document.body.clientWidth)return document.body.clientWidth;else return document.body.offsetWidth;};window.clientHeight=function(){var documentElement=document.documentElement;if(documentElement&&documentElement.clientHeight&&window.innerHeight)return Math.min(documentElement.clientHeight,window.innerHeight);else if(documentElement&&documentElement.clientHeight)return documentElement.clientHeight;else if(window.innerHeight)return window.innerHeight;else if(document.body.clientHeight)return document.body.clientHeight;else return document.body.offsetHeight;};window.offsetTop=function(element){for(var offsetTop=0;(element!=null);element=element.offsetParent)offsetTop+=element.offsetTop;return offsetTop;};window.offsetLeft=function(element){for(var offsetLeft=0;(element!=null);element=element.offsetParent)offsetLeft+=element.offsetLeft;return offsetLeft;};window.eventTop=function(event){if(event.pageY!=null)return event.pageY;else if(document.documentElement&&document.documentElement.scrollTop)return event.clientY+Math.max(document.documentElement.scrollTop,document.body.scrollTop);else return event.clientY+document.body.scrollTop;};window.eventLeft=function(event){if(event.pageX!=null)return event.pageX;else if(document.documentElement&&document.documentElement.scrollLeft)return event.clientX+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);else return event.clientX+document.body.scrollLeft;};window.createElement=function(name){return document.standardCreateElement?document.standardCreateElement(name):document.createElement(name);};window.containsElement=function(container,element){while((element.parentNode!=null)&&(element!=container))element=element.parentNode;return(element==container);};window.firstTagName=function(parent,tagName){for(var node=parent.firstChild;((node!=null)&&(node.tagName!=tagName));node=node.nextSibling);return node;};

DHTMLEvent=new Object();
if(window.addEventListener){
	DHTMLEvent.addEventListener=function(object,name,listener){
		return object.addEventListener(name,listener,true);
	};
	DHTMLEvent.removeEventListener=function(object,name,listener){
		object.removeEventListener(name,listener,true);
	};
}
else if(window.attachEvent){
	DHTMLEvent.addEventListener=function(object,name,listener){
		return object.attachEvent("on"+name,listener);
	};
	DHTMLEvent.removeEventListener=function(object,name,listener){
		object.detachEvent("on"+name,listener);
	};
}
else{
	DHTMLEvent.addEventListener=function(object,name,listener){
		return false
	};
	DHTMLEvent.removeEventListener=function(object,name,listener){};
};
DHTMLEvent.target=function(event){
	return(event.target)?event.target:event.srcElement;
};
DHTMLEvent.currentTarget=function(event){
	return(event.currentTarget)?event.currentTarget:event.srcElement;
};
DHTMLEvent.originalTarget=function(event){
	return(event.originalTarget)?event.originalTarget:event.srcElement;
};

Dlg=function(parent,name,config){
	var self=this;
	this.name=name;
	this.config=config;
	this.client=vieteasy.oGlobals.oClient;
	this.ie5=(this.client.bIE&&this.client.iVer==5);
	this.dialog=document.getElementById(this.name);
	this.dialog=this.dialog.parentNode.removeChild(this.dialog);
	this.dialog=document.body.insertBefore(this.dialog,document.body.firstChild);
	this.content=document.getElementById(this.name.concat("Content"));
	this.frame=document.getElementById(this.name.concat("Frame"));
	this.body=document.getElementById(this.name.concat("Body"));
	this.backing=this.createBacking();
	this.shadow=document.getElementById(this.name.concat("Shadow"));
	this.arrowLeft=document.getElementById(this.name.concat("ArrowLeft"));
	this.arrowRight=document.getElementById(this.name.concat("ArrowRight"));
	
	this.onmousemove=function(event){
		return self.onMouseMove(event);
	};
	this.onresize=function(){
		return self.resize();
	};
	this.ontimeout=function(){
		return self.onTimeout();
	};
	this.listener=(document.documentElement)?document.documentElement:document.body;
	this.timer=null;
	this.resizer=null;
};

Dlg.prototype.createBacking=function(){
	var backing=this.backing;
	if(backing!=null)return backing;
	backing=window.createElement("iframe");
	backing.frameBorder=0;
	backing.className="backing";
	backing.style.display=this.client.bIE?"block":"none";
	return this.content.insertBefore(backing,this.content.firstChild);
};

Dlg.prototype.load=function(content){
	this.body.innerHTML=content;
};

Dlg.prototype.open=function(top,left,width,height,origin){
	this.top=top;
	this.left=left;
	this.width=width;
	this.height=height;
	this.origin=origin;
	this.active=true;
	this.borderWidth=(!this.ie5)?2:0;
	this.borderHeight=(!this.ie5)?2:0;
	this.scrollTop=window.scrollTop();
	this.scrollLeft=window.scrollLeft();
	this.clientWidth=window.clientWidth();
	this.clientHeight=window.clientHeight();
	this.clientBottom=this.scrollTop+this.clientHeight;
	this.clientRight=this.scrollLeft+this.clientWidth;
	this.dialog.style.display="none";
	this.backing.style.width="auto";
	this.backing.style.height="auto";
	this.shadow.style.width="auto";
	this.shadow.style.height="auto";
	this.frame.style.width="auto";
	this.frame.style.height="auto";
	this.resizes=4;this.resize();
};

Dlg.prototype.resize=function(){
	this.dialog.style.display="block";
	var widthLeft=this.clientRight-(this.left+(this.body.offsetWidth+27));
	var widthRight=(this.left-(this.body.offsetWidth+27))-this.scrollLeft;
	this.frameHeight=Math.min(this.body.offsetHeight+(this.frame.clientHeight?(this.frame.offsetHeight-this.frame.clientHeight):this.borderHeight),this.clientHeight,this.height);
	this.frame.style.height=window.toPixels(this.frameHeight-this.borderHeight);
	if(widthLeft>=0)this.openLeft();
	else if(widthRight>=0)this.openRight();
	else if(widthRight>widthLeft)this.openRight();
	else this.openLeft();
	this.frameHeight=Math.min(this.body.offsetHeight+(this.frame.clientHeight?(this.frame.offsetHeight-this.frame.clientHeight):this.borderHeight),this.clientHeight,this.height);
	
	this.frame.style.height=window.toPixels(this.frameHeight-this.borderHeight);
	this.offsetTop=Math.max(Math.min(this.top-this.origin,this.clientBottom-this.frame.offsetHeight-this.shadow.offsetTop),this.scrollTop);
	this.arrowTop=Math.min(this.top-this.offsetTop,this.frame.offsetHeight-27);
	this.frame.scrollTop=0;
	this.shadow.style.width=window.toPixels(this.frame.offsetWidth);
	this.shadow.style.height=window.toPixels(this.frame.offsetHeight);
	this.dialog.style.top=window.toPixels(this.offsetTop);
	this.dialog.style.left=window.toPixels(this.offsetLeft);
	this.backing.style.width=window.toPixels(this.content.offsetWidth);
	this.backing.style.height=window.toPixels(this.content.offsetHeight);
	this.arrow.style.top=window.toPixels(this.arrowTop);
	var element=(document.documentElement)?document.documentElement:document.body;
	
	DHTMLEvent.removeEventListener(this.listener,"mousemove",this.onmousemove);
	DHTMLEvent.addEventListener(this.listener,"mousemove",this.onmousemove);
	
	if(this.resizes--)this.resizer=window.setTimeout(this.onresize,100);
	else this.setTimeout(this.config.timeout,true);
};

Dlg.prototype.openLeft=function(){
	this.arrow=this.arrowLeft;
	this.arrow.style.display="block";
	this.arrowRight.style.display="none";
	this.offsetLeft=Math.max(this.left,this.scrollLeft);
	this.frameWidth=Math.min(this.body.offsetWidth+(this.frame.clientWidth?(this.frame.offsetWidth-this.frame.clientWidth):this.borderWidth),this.clientRight-this.arrowLeft.offsetWidth-this.offsetLeft-this.shadow.offsetLeft,this.width);
	this.frame.style.width=window.toPixels(this.frameWidth-this.borderWidth);
};

Dlg.prototype.openRight=function(){
	this.arrow=this.arrowRight;
	this.arrow.style.display="block";
	this.arrowLeft.style.display="none";
	this.offsetRight=Math.min(this.left,this.clientRight);
	this.frameWidth=Math.min(this.body.offsetWidth+(this.frame.clientWidth?(this.frame.offsetWidth-this.frame.clientWidth):this.borderWidth),this.offsetRight-this.arrowRight.offsetWidth-this.scrollLeft,this.width);
	this.frame.style.width=window.toPixels(this.frameWidth-this.borderWidth);
	this.offsetLeft=Math.max(this.offsetRight-this.dialog.offsetWidth,0);
};

Dlg.prototype.close=function(){
	this.active=false;
	this.dialog.style.display="none";
	window.clearTimeout(this.timer);
	window.clearTimeout(this.resizer);
	DHTMLEvent.removeEventListener(this.listener,"mousemove",this.onmousemove);
	if(this.onclose)this.onclose();
};

Dlg.prototype.setTimeout=function(timeout,active){
	this.active=active;
	window.clearTimeout(this.timer);
	this.timer=(timeout)?window.setTimeout(this.ontimeout,timeout):null;return false;
};

Dlg.prototype.onTimeout=function(event){this.close();};

Dlg.prototype.onMouseMove=function(event){
	var eventTarget=DHTMLEvent.target(event);
	if(window.containsElement(this.link,eventTarget))return this.setTimeout(this.timeout,true);
	else if(window.containsElement(this.frame,eventTarget))
		return this.setTimeout(this.timeout,true);
	else if(window.containsElement(this.arrow,eventTarget))
		return this.setTimeout(this.timeout,true);
	var xorg=window.offsetLeft(this.arrow)-window.eventLeft(event);
	var yorg=window.offsetTop(this.arrow)-window.eventTop(event);
	if((Math.abs(xorg)<25)&&(Math.abs(yorg)<25))return this.setTimeout(this.timeout,true);
	else if(this.active)
		return this.setTimeout(this.config.mouseout,false);
};

Dlg.prototype.hideSelects=function(){
	this.selects=new Array();
	var dialogTop=window.offsetTop(this.dialog);
	var dialogLeft=window.offsetLeft(this.dialog);
	var dialogBottom=dialogTop+this.dialog.offsetHeight;
	var dialogRight=dialogLeft+this.dialog.offsetWidth;
	var selects=document.getElementsByTagName("select");
	for(var idx=0;(idx<selects.length);idx++){
		var select=selects[idx];
		var selectTop=window.offsetTop(select);
		var selectLeft=window.offsetLeft(select);
		var selectBottom=selectTop+select.offsetHeight;
		var selectRight=selectLeft+select.offsetWidth;
		if((selectTop>dialogBottom)||(selectBottom<dialogTop))continue;
		else if((selectLeft>dialogRight)||(selectRight<dialogLeft))continue;
		select.style.visibility="hidden";
		this.selects[this.selects.length]=select;
	}
};

Dlg.prototype.showSelects=function(){
	for(var idx=0;(idx<this.selects.length);idx++){
		this.selects[idx].style.visibility="inherit";
	}
};

function FullSize(pBase,config){
	var self=this;this.objType="FullSize";
	this.base=VietEasyBaseControl;
	this.base(pBase,"FullSize");
	this.config=config;
	
	this.onopen=function(){
		return self.onOpen();
	};
	this.onclose=function(){
		return self.onClose();
	};
	this.onmouseout=function(event){
		return self.onMouseOut(event);
	};
	this.body=document.getElementById("FullSizeDialogBody");
	this.image=document.getElementById("FullSizeDialogImage");
	this.thumbs=document.getElementById("FullSizeDialogThumbs");
	this.thumblayer=document.getElementById("FullSizeThumbLayer");
	this.slider=document.getElementById("FullSizeSlider");
	this.paginationUp=document.getElementById("paginationUp");
	this.paginationDown=document.getElementById("paginationDown");
	this.sliderUp=document.getElementById("ArrowUp");
	this.sliderDown=document.getElementById("ArrowDown");
	
	this.onloadimage=function(event){
		return self.onLoadImage(event);
	};
	this.onloaderror=function(){
		return self.onLoadError();
	};
	this.onloadticker=function(){
		return self.showProgress();
	};
	this.onscrolldown=function(){
		return self.onScrollDown();
	};
	this.onscrollup=function(){
		return self.onScrollUp();
	};
	this.onimgload=function(){
		return self.shrinknShowSSImage();
	};
	this.onload=function(){
		return self.preCache();
	};
	
	this.dialog=new Dlg(this,"FullSizeDialog",config);
	this.dialog.onclose=this.onclose;
};

FullSize.prototype.setDelay=function(event,link,gallery,top,left){
	this.link=link;
	this.gallery=gallery;
	this.top=window.offsetTop(this.link)+top;
	this.left=window.offsetLeft(this.link)+left;
	window.clearTimeout(this.timer);
	this.timer=window.setTimeout(this.onopen,this.config.mouseover);
	DHTMLEvent.removeEventListener(this.link,"mouseout",this.onmouseout);
	DHTMLEvent.addEventListener(this.link,"mouseout",this.onmouseout);
	return false;
};

FullSize.prototype.onMouseOut=function(event){
	window.clearTimeout(this.timer);
	DHTMLEvent.removeEventListener(this.link,"mouseout",this.onmouseout);
	return false;
};

FullSize.prototype.onOpen=function(){
	this.SGContent();
	this.bigImages=new Array(this.gallery.nImgs);
	this.dialog.link=this.link;
	this.dialog.body.style.width=window.toPixels((this.gallery.enableThumbs=="true"&&(this.gallery.nImgs>1))?510:420);
	this.dialog.open(this.top,this.left,this.config.width,this.config.height,this.config.origin);
	this.slider.style.top=window.toPixels(0);
	DHTMLEvent.removeEventListener(this.link,"mouseout",this.onmouseout);
	this.loader=new Object();
	this.loader.index=0;
	this.loader.elapsed=0;
	this.preCache();
};

FullSize.prototype.preCache=function(){
	this.loaded=false;
	this.loader.image=new Image();
	this.loader.start=new Date().getTime();
	var index=this.loader.index+1;
	var bigImgUrl=this.config.host+this.gallery.id;//+".jpg";
	this.loader.tick=Math.max(Math.round(this.loader.elapsed/16),250);
	this.loader.timeout=window.setTimeout(this.onloaderror,Math.max(32*this.loader.tick,30000));
	this.loader.image.onload=this.onloadimage;
	this.loader.image.onerror=this.onloaderror;
	this.loader.image.onabort=this.onloaderror;
	if(this.gallery.nImgs>1&&this.gallery.enableThumbs=="true")this.showProgress();
	this.loader.image.src=bigImgUrl;
};

FullSize.prototype.showProgress=function(){
	if(this.loader.index<this.gallery.nImgs){
		var str="progressLyr"+this.loader.index;
		var oProgressLyr=document.getElementById(str);
		oProgressLyr.style.top=window.toPixels(oProgressLyr.offsetTop+10);
		if(oProgressLyr.offsetHeight>10)
			oProgressLyr.style.height=window.toPixels(oProgressLyr.offsetHeight-10);
		if(oProgressLyr.offsetHeight>4)
			this.loader.ticker=window.setTimeout(this.onloadticker,this.loader.tick);
	}
};

FullSize.prototype.onLoadImage=function(event){
	this.loaded=true;
	window.clearTimeout(this.loader.ticker);
	window.clearTimeout(this.loader.timeout);
	if(this.loader.index==0&&(this.gallery.nImgs==1||this.gallery.enableThumbs!="true")){
		var imgId=document.getElementById("imgBig");
		imgId.src=this.loader.image.src;
		this.onBigImgload();
	}
	else{
		if(this.loader.index<this.gallery.nImgs){
			var str="progressLyr"+this.loader.index;
			var oProgressLyr=document.getElementById(str);
			oProgressLyr.style.top=window.toPixels(64);
			oProgressLyr.style.height=window.toPixels(0);
			oProgressLyr.style.display="none";
			this.bigImages[this.loader.index]=this.loader.image.src;
			if(this.loader.index==0){
				var imgId=document.getElementById("imgBig");
				imgId.src=this.loader.image.src;
				this.onBigImgload();
			}
			else{
				this.onLoadDone();
			}
		}
	}
};

FullSize.prototype.onLoadDone=function(){
	this.loader.index=this.loader.index+1;
	this.loader.finish=new Date().getTime();
	this.loader.elapsed=Math.max(this.loader.finish-this.loader.start,1);
	if(this.loader.index<this.gallery.nImgs)
		return window.setTimeout(this.onload,1);
	else if(!this.loaded)this.setBigImgTxt(this.config.error);
};

FullSize.prototype.onLoadError=function(){
	window.clearTimeout(this.loader.ticker);
	window.clearTimeout(this.loader.timeout);
	if((this.gallery.enableThumbs=="true")&&(this.gallery.nImgs>1)){
		var str="progressLyr"+this.loader.index;
		var oProgressLyr=document.getElementById(str);
		oProgressLyr.style.display="block";
		oProgressLyr.style.top=window.toPixels(0);
		oProgressLyr.style.left=window.toPixels(0);
		oProgressLyr.style.height=window.toPixels(64);
	}
	this.onLoadDone();
};

FullSize.prototype.onClose=function(){
	var oSurvey=vieteasy._Doc._Page._getControl("KeyFlow.Exit.Survey");
	if(oSurvey)
		oSurvey.enable();
};

FullSize.prototype.SGContent=function(){
	this.setBigImgTxt(this.config.loading);
	if(this.gallery.enableThumbs=="true"&&this.gallery.nImgs>1){
		this.thumbs.style.display="";
		this.slider.innerHTML=this.getThumbLayerContent();
		if(this.gallery.nImgs<=4){
			this.paginationUp.style.display="none";
			this.paginationDown.style.display="none";
			this.thumblayer.style.marginTop=window.toPixels(41);
		}
		else{
			this.paginationUp.style.display="block";
			this.paginationDown.style.display="block";
			this.thumblayer.style.marginTop=window.toPixels(19);
		}
		this.images=this.slider.getElementsByTagName("div");
		this.images[0].className="outerThumbDiv selected";
		var setThumbOpacity="";
		var opacity=0.7;
		for(var i=0;i<this.gallery.nImgs;i++){
			setThumbOpacity=document.getElementById("progressLyr"+i);
			setThumbOpacity.style.filter="alpha(opacity="+parseInt(100*opacity)+")";
			setThumbOpacity.style.opacity=opacity;
		}
		
		this.selected=0;
		this.scrollEnable(0);
		this.dialogHandlers();
	}
	else{
		this.thumbs.style.display="none";
	}
	this.oBigImg=new VietEasyHTMLImage(this,'imgBig');
	this.oBigImg._registerEvent("onclick","parent.showViewItem");
	this.oBigImg.showViewItem=parent.showViewItem;
	this.oBigImg.bind();
};

FullSize.prototype.scrollEnable=function(scrollIndex){this.scrollIndex=scrollIndex;var i=scrollIndex+4;this.sliderUp.disabled=(scrollIndex<=0);this.sliderUp.src=(this.sliderUp.disabled)?this.config.coreImgHost+"buttons/btnpreviousNA.gif":this.config.coreImgHost+"buttons/btnprevious.gif";this.paginationUp.style.cursor=(this.sliderUp.disabled)?"default":"pointer";this.sliderDown.disabled=(i>=this.gallery.nImgs);this.sliderDown.src=(this.sliderDown.disabled)?this.config.coreImgHost+"buttons/btnnextNA.gif":this.config.coreImgHost+"buttons/btnnext.gif";this.paginationDown.style.cursor=(this.sliderDown.disabled)?"default":"pointer";this.sliderTop=-this.images[scrollIndex*3].offsetTop;};

FullSize.prototype.dialogHandlers=function(){this.oDivThumbObj=new Array();for(var i=0;i<this.gallery.nImgs;i++){var divId="divThumb"+i;this.oDivThumbObj[i]=new VietEasyHTMLLayer(this,divId);

this.oDivThumbObj[i].thumbClick=function()
{
	if(this.selectedThumb!=this.parent.selected){
		this.parent.setBigImgTxt(this.parent.config.loading);
		var id=this.selectedThumb+1;
		var selThumbDiv=document.getElementById("divThumb"+this.selectedThumb);
		var prevSelThumbDiv=document.getElementById("divThumb"+this.parent.selected);
		selThumbDiv.className="outerThumbDiv selected";
		prevSelThumbDiv.className="outerThumbDiv";
		this.parent.selected=this.selectedThumb;
		var imgId=document.getElementById("imgBig");
		if(this.parent.bigImages[this.selectedThumb]==null){
			var bigImageUrl=this.parent.config.host+this.parent.gallery.id+"_"+id+"_"+this.parent.gallery.version+"_1.jpg";
			imgId.onload=this.parent.onBigImgload;
			imgId.onerror=this.parent.onBigImgloadError;
			imgId.onabort=this.parent.onBigImgloadError;
			imgId.src=bigImageUrl;
		}
	else
	{imgId.src=this.parent.bigImages[this.selectedThumb]
this.parent.onBigImgload();}
return false;}}
this.oDivThumbObj[i].subscribeEvents("onclick");this.oDivThumbObj[i]._registerEvent("onclick","thumbClick");this.oDivThumbObj[i].selectedThumb=i;this.oDivThumbObj[i].bind();}};

FullSize.prototype.setBigImgTxt=function(text){var bImgDiv=document.getElementById("bImgDiv");bImgDiv.style.display="none";var imgId=document.getElementById("imgBig");imgId.style.width="";imgId.style.height="";var bImgTxt=document.getElementById("bImgTxt");bImgTxt.innerHTML=text;bImgTxt.style.display="block";};

FullSize.prototype.onBigImgload=function(){var bImgTxt=document.getElementById("bImgTxt");var bImgDiv=document.getElementById("bImgDiv");var bImg=document.getElementById("imgBig");var control=vieteasy._Doc._getControl("FullSize");if(control.gallery.isSuperSz==1){bImgDiv.className="hiddenimg";bImgTxt.style.display="block";bImgDiv.style.display="block";control.bTimer=window.setTimeout(control.onimgload,100);}
else{bImgTxt.style.display="none";bImgDiv.style.display="block";if(this.selected==0)
this.onLoadDone();}};

FullSize.prototype.shrinknShowSSImage=function(){window.clearTimeout(this.bTimer);var bImgTxt=document.getElementById("bImgTxt");var bImgDiv=document.getElementById("bImgDiv");var bImg=document.getElementById("imgBig");var imgW=bImg.width;var imgH=bImg.height;var scale=1.0;if((imgW>=imgH)&&(imgW>400))
scale=400/imgW;else if((imgH>400)&&(imgH>=imgW))
scale=400/imgH;bImg.style.width=window.toPixels(scale*imgW);bImg.style.height=window.toPixels(scale*imgH);bImgDiv.className="imgvisible";bImgTxt.style.display="none";bImgDiv.style.display="block";if(this.selected==0)
this.onLoadDone();}

FullSize.prototype.onBigImgloadError=function(){var bImgTxt=document.getElementById("bImgTxt");var bImgDiv=document.getElementById("bImgDiv");bImgTxt.innerHTML="Error loading the image";bImgTxt.style.display="none";bImgDiv.style.display="block";};

FullSize.prototype.showViewItem=function(){
	window.open(this.parent.gallery.vItemlnk,'newwindow1');

	//document.location.href=this.parent.gallery.vItemlnk;
	//document.location.target='_blank';
};

FullSize.prototype.getThumbLayerContent=function(){var outPut="";var id=0;var thumbImg;for(var i=0;i<this.gallery.nImgs;i++){id=i+1;thumbImg=this.config.host+this.gallery.id+"_"+id+"_"+this.gallery.version+"_0.jpg";outPut=outPut+"<div class='outerThumbDiv' name='divThumb"+i+"' id='divThumb"+i+"' ><div class='thumbnail' ><img src='"+thumbImg+"' id='imgThumb"+i+"' name='imgThumb"+i+"'"+"onload='onFullSizeThumb("+i+");'"+" /></div><div class='pLayer' id='progressLyr"+i+"'></div></div>";}
return outPut;};

FullSize.prototype.onSlideNext=function(event){var i=Math.min(((this.scrollIndex)+4),(Math.max(this.gallery.nImgs-4,0)));this.scrollEnable(i);window.setTimeout(this.onscrolldown,this.config.timer);};

FullSize.prototype.onScrollDown=function(){this.slider.style.top=window.toPixels(Math.max(this.slider.offsetTop-this.config.pixels,this.sliderTop));if((this.slider.offsetTop-this.sliderTop)>this.config.pixels)window.setTimeout(this.onscrolldown,this.config.timer);else this.slider.style.top=window.toPixels(this.sliderTop);};

FullSize.prototype.onSlidePrev=function(){this.scrollEnable(Math.max(this.scrollIndex-4,0));window.setTimeout(this.onscrollup,this.config.timer);};

FullSize.prototype.onScrollUp=function(){this.slider.style.top=window.toPixels(Math.min(this.slider.offsetTop+this.config.pixels,this.sliderTop));if((this.sliderTop-this.slider.offsetTop)>this.config.pixels)window.setTimeout(this.onscrollup,this.config.timer);else this.slider.style.top=window.toPixels(this.sliderTop);};function onSlidePrev(event){var control=vieteasy._Doc._getControl("FullSize");return(control)?control.onSlidePrev(event):false;};function onSlideNext(event){var control=vieteasy._Doc._getControl("FullSize");return(control)?control.onSlideNext(event):false;};
function onFullSize(event,itemId,nImgs,isSuperSz,version,enableThumbs,vItemlnk)
{
	var oSurvey=vieteasy._Doc._Page._getControl("KeyFlow.Exit.Survey");
	if(oSurvey)
		oSurvey.disable();
	event.cancelBubble=true;
	var control=vieteasy._Doc._getControl("FullSize");
	if((control==null)||(control.dialog.active))return false;
	var link=DHTMLEvent.currentTarget(event);
	while(link&&(link.onmouseover==null))link=link.parentNode;
	if(link==null)return false;
	if(link.active)return false;
	var control=vieteasy._Doc._getControl("FullSize");
	if(control==null)return false;
	var gallery=new Array();
	gallery.id=itemId;
	gallery.nImgs=nImgs;
	gallery.isSuperSz=isSuperSz;
	gallery.enableThumbs=enableThumbs;
	gallery.version=version;
	if(version=="")gallery.version=1;
	gallery.vItemlnk=vItemlnk;
	if(link.className=="galleryplus")
		control.setDelay(event,link,gallery,(link.height/2),(link.width/2));
	else
		control.setDelay(event,link,gallery,5,10);
	return false;
};
function onFullSizeThumb(idx){var image=document.getElementById("imgThumb"+idx);if(image==null)return;if((image.width>64)&&(image.width>=image.height))image.width=(64/image.width)*image.width;else if((image.height>64)&&(image.height>=image.width))image.height=(64/image.height)*image.height;image.onload=null;image.style.position="relative";image.style.top=window.toPixels(Math.floor((64-image.height)/2));image.style.left=window.toPixels(Math.floor((64-image.width)/2));};var cfg=vieteasy._Doc.getConfig("FullSize");if(cfg)new FullSize(vieteasy._Doc._Page,cfg);


