var shortText="";var longText="";var captionText="";var lettersCut=10200;var captMargin="";var captDisplay="";function getElement(a){var b=(document.getElementById)?document.getElementById(a):document.all[a];return b}function LTrim(b){var a=/\s*((\S+\s*)*)/;return b.replace(a,"$1")}function RTrim(b){var a=/((\s*\S+)*)\s*/;return b.replace(a,"$1")}function Trim(a){return LTrim(RTrim(a))}function SetStars(f,c){if(c){var a=document.getElementById("rateStarPhotoId").value;var e=document.getElementById("rateStarValue"+a);if(e){f=e.value}}var b=document.getElementById("rateStar1");var j=document.getElementById("rateStar2");var h=document.getElementById("rateStar3");var g=document.getElementById("rateStar4");var d=document.getElementById("rateStar5");setonestar(d,f>4);setonestar(g,f>3);setonestar(h,f>2);setonestar(j,f>1);setonestar(b,f>0)}function setonestar(b,a){if(b){if(a){b.className="ratingStar filledRatingStar"}else{b.className="ratingStar emptyRatingStar"}}}function ratePhoto(b){var a=document.getElementById("PhotogalleryId").value;var d=document.getElementById("rateStarPhotoId").value;var c=document.getElementById("rateStarValue"+d);if(c&&c.value<1){SetStars(b,false);www.rferl.org.Services.PhotogalleryService.PhotogalleryVote(a,d,b,userIP,SuccessCallbackPhotogallery,ErrorCallbackPhotogallery);c.value=b}}function SuccessCallbackPhotogallery(a){var b=document.getElementById("divVoteResult");if(b){b.innerHTML=a}}function SwitchGalleryRating(c){document.getElementById("rateStarPhotoId").value=c;var b=document.getElementById("rateStarValue"+c);if(b){if(b.value==-1){var a=Get_Cookie("GalleryVote"+c);if(a){b.value=a;SetStars(b.value,false)}else{www.rferl.org.Services.PhotogalleryService.LoadRatingPhotogallery(c,userIP,SuccessCallbackCheckVote,ErrorCallbackPhotogallery)}}else{SetStars(b.value,false)}}SuccessCallbackPhotogallery("");HideGalleryResult()}function SuccessCallbackCheckVote(a){SetStars(a,false);var c=document.getElementById("rateStarPhotoId").value;var b=document.getElementById("rateStarValue"+c);if(b){b.value=a}}function ShowGalleryResult(a){www.rferl.org.Services.PhotogalleryService.PhotogalleryShowResults(a,SuccessCallbackShowResults,ErrorCallbackPhotogallery)}function SuccessCallbackShowResults(a){var b=document.getElementById("galleryRateResult");b.innerHTML=a;b.className="galleryOverlay"}function HideGalleryResult(){var a=document.getElementById("galleryRateResult");if(a){a.innerHTML="";a.className=""}}function ErrorCallbackPhotogallery(a){}var boolMediaLinks=true;function showMore(){SLIDES.pause();boolMediaLinks=false;lettersCut=10240;if(boolMediaLinks){getElement("descText").style.height="240px"}else{getElement("descText").style.height="250px"}captMargin=getElement("captionText").style.margin;captDisplay=getElement("captionText").style.display;getElement("captionText").style.margin="0px";getElement("captionText").style.display="inline";getElement("descText").innerHTML=longText}function showLess(){if(getElement("captionText")!=null&&Trim(longText).length>1){getElement("captionText").innerHTML=longText}if(Trim(shortText).length>1){getElement("descText").innerHTML=shortText}else{getElement("descText").innerHTML=longText}}function slide(f,b,e,d,g,c,a){this.src=f;this.link=b;this.text=e;this.desc=d;this.pgid=g;this.target=c;this.attr=a;if(document.images){this.image=new Image()}this.loaded=false;this.load=function(){if(!document.images){return}if(!this.loaded){this.image.src=this.src;this.loaded=true}};this.hotlink=function(){var h;if(!this.link){return}if(this.target){if(this.attr){h=window.open(this.link,this.target,this.attr)}else{h=window.open(this.link,this.target)}if(h&&h.focus){h.focus()}}else{location.href=this.link}}}function slideshow(a){this.name=a;this.repeat=false;this.prefetch=-1;this.image;this.textid;this.descid;this.textarea;this.timeout=3000;this.post_update_hook=function(){this.getElementById("pgCounter").innerHTML=this.current+1+"&nbsp;/&nbsp;"+this.slides.length};this.fire_pause=function(){this.src="/img/frame_pause_.gif"};this.out_pause=function(){this.src="/img/frame_pause.gif"};this.fire_play=function(){this.src="/img/frame_run_.gif"};this.out_play=function(){this.src="/img/frame_run.gif"};this.pre_play_hook=function(){this.getElementById("gallerybutton").innerHTML="<img id='ir' onClick='SLIDES.pause()' class='navButtonPhotoglr' src='/img/frame_pause.gif' onmouseover='this.src=\"/img/frame_pause_.gif\"' onmouseout='this.src=\"/img/frame_pause.gif\"' alt='' border='0' />"};this.pre_pause_hook=function(){this.getElementById("gallerybutton").innerHTML="<img id='ir' class='navButtonPhotoglr' onmouseover='this.src=\"/img/frame_run_.gif\"' onmouseout='this.src=\"/img/frame_run.gif\"' onClick='SLIDES.next();SLIDES.play()' src='/img/frame_run.gif' alt='' border='0' />"};this.slides=new Array();this.current=0;this.timeoutid=0;this.add_slide=function(b){var c=this.slides.length;if(this.prefetch==-1){b.load()}this.slides[c]=b};this.play=function(b){this.pause();this.pre_play_hook();if(b){this.timeout=b}if(typeof this.slides[this.current].timeout!="undefined"){b=this.slides[this.current].timeout}else{b=this.timeout}this.timeoutid=setTimeout(this.name+".loop()",b)};this.pause=function(){this.pre_pause_hook();if(this.timeoutid!=0){clearTimeout(this.timeoutid);this.timeoutid=0}};this.update=function(){if(!this.valid_image()){return}if(typeof this.pre_update_hook=="function"){this.pre_update_hook()}var b=this.slides[this.current];var h=false;if(this.image&&typeof this.image.filters!="undefined"&&typeof this.image.filters[0]!="undefined"){h=true}b.load();if(h){if(b.filter&&this.image.style&&this.image.style.filter){this.image.style.filter=b.filter}this.image.filters[0].Apply()}this.image.src=b.image.src;try{var e=new RegExp("<[^>]*>","g");this.image.alt=b.text.replace(e,"")}catch(c){}if(h){this.image.filters[0].Play()}this.display_text();SwitchGalleryRating(this.slides[this.current].pgid);if(typeof this.post_update_hook=="function"){this.post_update_hook()}if(this.prefetch>0){var d,g,f;d=this.current;g=this.current;f=0;do{if(++d>=this.slides.length){d=0}if(--g<0){g=this.slides.length-1}this.slides[d].load();this.slides[g].load()}while(++f<this.prefetch)}};this.goto_slide=function(b){if(b==-1){b=this.slides.length-1}if(b<this.slides.length&&b>=0){this.current=b}this.update()};this.goto_random_slide=function(b){var c;if(this.slides.length>1){do{c=Math.floor(Math.random()*this.slides.length)}while(c==this.current);this.goto_slide(c)}};this.next=function(){if(this.current<this.slides.length-1){this.current++}else{if(this.repeat){this.current=0}}this.update()};this.previous=function(){if(this.current>0){this.current--}else{if(this.repeat){this.current=this.slides.length-1}}this.update()};this.shuffle=function(){var d,e,b,c;b=new Array();for(d=0;d<this.slides.length;d++){b[d]=this.slides[d]}c=new Array();do{d=Math.floor(Math.random()*b.length);c[c.length]=b[d];for(e=d+1;e<b.length;e++){b[e-1]=b[e]}b.length--}while(b.length);this.slides=c};this.get_text=function(){return(this.slides[this.current].text)};this.get_all_text=function(c,b){all_text="";for(i=0;i<this.slides.length;i++){slide=this.slides[i];if(slide.text){all_text+=c+slide.text+b}}return(all_text)};this.display_text=function(e){if(!e){e=this.slides[this.current].text;desc=this.slides[this.current].desc}shortText="";longText=e;var d=desc.split(" ");var c=false;var b=0;for(num=0;num<d.length;num++){if(b<lettersCut){shortText+=d[num]+" "}else{c=true}b+=d[num].length}captionText=e;showLess();if(this.textarea&&typeof this.textarea.value!="undefined"){this.textarea.value=e}if(this.textid){r=this.getElementById(this.textid);if(!r){return false}if(typeof r.innerHTML=="undefined"){return false}r.innerHTML=e}if(this.descid){r=this.getElementById(this.descid);if(!r){return false}if(typeof r.innerHTML=="undefined"){return false}r.innerHTML=desc}};this.hotlink=function(){this.slides[this.current].hotlink()};this.save_position=function(b){if(!b){b=this.name+"_slideshow"}document.cookie=b+"="+this.current};this.restore_position=function(b){if(!b){b=this.name+"_slideshow"}var c=b+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(c);if(offset!=-1){offset+=c.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}this.current=parseInt(unescape(document.cookie.substring(offset,end)))}}};this.noscript=function(){$html="\n";for(i=0;i<this.slides.length;i++){slide=this.slides[i];$html+="<P>";if(slide.link){$html+='<a href="'+slide.link+'">'}$html+='<img src="'+slide.src+'" ALT="slideshow image">';if(slide.link){$html+="</a>"}if(slide.text){$html+="<BR>\n"+slide.text}$html+="</P>\n\n"}$html=$html.replace(/\&/g,"&amp;");$html=$html.replace(/</g,"&lt;");$html=$html.replace(/>/g,"&gt;");return("<pre>"+$html+"</pre>")};this.loop=function(){if(this.current<this.slides.length-1){next_slide=this.slides[this.current+1];if(next_slide.image.complete==null||next_slide.image.complete){this.next()}}else{this.next()}this.play()};this.valid_image=function(){if(!this.image){return false}else{return true}};this.getElementById=function(b){if(document.getElementById){return document.getElementById(b)}else{if(document.all){return document.all[b]}else{if(document.layers){return document.layers[b]}else{return undefined}}}};this.set_image=function(b){if(!document.images){return}this.image=b};this.set_textarea=function(b){this.textarea=b;this.display_text()};this.set_textid=function(b){this.textid=b;this.display_text()}};