
window.name="MainWindow";self.onerror=show_error;document.onkeydown=handleSlideShowButtons;var slideshow;function initPage(){if(location.href.indexOf("?imageID=")>0||location.href.indexOf("&imageID=")>0){var qString=location.search.split('&');for(i=0;i<qString.length;i++){if(qString[i].indexOf("imageID=")>-1){var imageID=qString[i].split('=')[1];if(imageID.length==7){gotoPhoto(imageID);}}}}}
function loadPage(arg,continent,country){cont="&cont="+continent;ctry="&ctry="+country;autoIs="&auto=OFF";if(document.autobox){if(bName!="Netscape"&&document.autobox.auto.checked){auto="&auto=ON";}}
strQuery="/shared/SlideShow/PopUpShow.aspx?pagelist="+arg+cont+ctry+autoIs;slideWindow(strQuery);}
function loadPopUpWindow(arg){slideWindow("/shared/SlideShow/PopUpShow.aspx?pagelist="+arg+"&auto=OFF");}
function slideWindow(URL){if(gen5){slideshow=window.open(URL,'slideshow','resizable=no,toolbar=no,directories=no,location=no,scrollbars=auto,width=575,height=460');}else{slideshow=window.open(URL,'slideshow','resizable=no,toolbar=no,directories=no,location=no,scrollbars=auto,width=550,height=475');}}
function detailWindow(URL){if(gen5){newWin=window.open(URL,'photodetail','resizable=no,toolbar=no,directories=no,location=no,scrollbars=auto,width=575,height=460');}else{newWin=window.open(URL,'photodetail','resizable=no,toolbar=no,directories=no,location=no,scrollbars=auto,width=550,height=475');}}
function showPreview(arg){URL="/shared/SlideShow/PreviewSlides.aspx?pagelist="+arg;previewWin=window.open(URL,'Preview','resizable=yes,toolbar=no,directories=no,location=no,scrollbars=yes,width=535,height=650');}
function gotoPhoto(arg){if(bName=="Netscape"&&bVer<5){slideshow.gotoSlide(arg);}else{slideframe.gotoSlide(arg);}}
function show_error(msg,url,line){if(msg.indexOf("gotoSlide")>-1||msg.indexOf("slideshow")>-1){alert("\nError: You must open the slide show first \nbefore selecting a specific photo.\n");return true;}else{return false;}}
function helpWindow(URL){helpWin=window.open(URL,'thewindow','resizable=yes,toolbar=no,directories=no,location=no,scrollbars=yes,width=470,height=510');}
function setAutoButton(arg){var htmlCode="";var urlRef="\"javascript:slideframe.autoSlide()\"";if(arg.toUpperCase()=="ON"){var btn=document.getElementById('AutoButton');btn.title="Stop automation [Shft-End]";}else{var btn=document.getElementById('AutoButton');btn.title="Start automation [Shft-End]";}}
function changeContent(elementid,content){if(document.getElementById){rng=document.createRange();el=document.getElementById(elementid);rng.setStartBefore(el);htmlFrag=rng.createContextualFragment(content);while(el.hasChildNodes()){el.removeChild(el.lastChild);}
el.appendChild(htmlFrag);}}
function showSlides(arg){var isPreview=false;if(arg!=null){if(arg=="true"){isPreview=true;}else{isPreview=false;}}
PhotoList=new Object();var str=" ";PhotoList.length=0;counter=0;if(document.boxes.cb.length){for(i=0;i<document.boxes.cb.length;i++){if(document.boxes.cb[i].checked){str=new String("slide"+counter);PhotoList[str]=document.boxes.cb[i].value;PhotoList.length+=1;counter+=1;}}}
if(PhotoList.length==0){noPhotoSelected();}else if(PhotoList.length==1){showPhoto(PhotoList["slide0"]);}else{str="\"";for(i=0;i<PhotoList.length-1;i++){s=new String("slide"+i);str+=PhotoList[s]+",";}
s=new String("slide"+(PhotoList.length-1));str+=PhotoList[s]+"\"";if(isPreview){loadPreview(str);}else{loadSlides(str);}}}
function loadSlides(arg){slideWindow("/shared/SlideShow/PopUpShow.aspx?photolist="+arg);}
function loadPreview(arg){slideWindow("/shared/SlideShow/PopUpShow.aspx?photolist="+arg+"&isPreview=true");}
function showPhoto(arg){detailWindow("/shared/SlideShow/PopUpShow.aspx?searchID="+arg);}
function noPhotoSelected(){alert('You did not select any photographs for the slide show. \n'+'        Check one or more boxes on the right.');}
var allBoxesChecked=false;function checkAllBoxes(){if(document.boxes.cb.length){for(i=0;i<document.boxes.cb.length;i++){document.boxes.cb[i].checked=!allBoxesChecked;}
allBoxesChecked=!allBoxesChecked}else{document.boxes.cb.checked=!allBoxesChecked;allBoxesChecked=!allBoxesChecked}}
function handleSlideShowButtons(e){if(!isOpera){if(document.all){e=window.event;}
if(e.shiftKey&&e.keyCode==39){slideframe.nextSlide();return false;}else if(e.shiftKey&&e.keyCode==37){slideframe.lastSlide();return false;}else if(e.shiftKey&&e.keyCode==36){slideframe.firstSlide();return false;}else if(e.shiftKey&&e.keyCode==35){slideframe.autoSlide();return false;}else if(e.keyCode==27){CloseMenu();}}else{if(e.keyCode==27){CloseMenu();}}}