var GAJsCache={has:function(key){return(this[key]!=undefined);}};var full_cache="";var fullsize_container="fullsize";function fullsize_cback(){jQuery("#cropImage").attr({src:GAJsCache[full_cache]});}
var fullsize_cback_control_pID=0;var fullsize_cback_control_context="";var fullsize_cback_control_isPrimary=0;function fullsize_cback_control(){var crop_version_control="";if(fullsize_cback_control_context=="profile"){if(fullsize_cback_control_isPrimary==1){jQuery('#picsize').val('profile');crop_version_control="<a href='javascript:void(0)'  id='ctr_thumbnailversion' onclick='PhotoService.execprofileversion("+fullsize_cback_control_pID+")'>"
+"<span>Set Profile Version</span>"
+"</a>";}else{crop_version_control="<a href='javascript:void(0)'  id='ctr_thumbnailversion' onclick='PhotoService.execthumbnailversion("+fullsize_cback_control_pID+")'>"
+"<span>Set Thumbnail</span>"
+"</a>";}}else{crop_version_control="<a href='javascript:void(0)'  id='ctr_thumbnailversion' onclick='PhotoService.execthumbnailversion("+fullsize_cback_control_pID+")'>"
+"<span>Set Thumbnail</span>"
+"</a>";}
jQuery("#optioncontainer").html
("<ul>"
+"<li>"
+"<a href='javascript:void(0)' id='ctr_rotate' onclick='PhotoService.rotatephoto("+fullsize_cback_control_pID+")'>"
+"<span>Rotate</span>"
+"</a>"
+"</li>"
+"<li>"
+"<a href='javascript:void(0)'  id='ctr_editcaption' onclick='PhotoService.editcaption("+fullsize_cback_control_pID+")'>"
+"<span>Add/Edit photo Caption</span>"
+"</a>"
+"</li>"
+"<li>"
+crop_version_control
+"</li>"
+"<li>"
+"<a href='javascript:void(0)' id='ctr_delete' onclick='PhotoService.deletephoto("+fullsize_cback_control_pID+")'>"
+"<span>Delete</span>"
+"</a>"
+"</li>"
+"</ul>");}
function fullsize_cback_thickbox(){jQuery("#thickbox_jentry").attr({src:GAJsCache[full_cache]});}
function fullsize_cback_control_thickbox(){jQuery("#jentrylboxheader").attr("onclick","PhotoService.loadPhotoPopup("+fullsize_cback_control_pID+",'gallery')");}
mPhotoService=Class.create();mPhotoService.prototype={initialize:function(context,loginid,genid){this.layout=1;this.startrow=1;this.pagenum=1;this.context=context;this.loginid=loginid;this.genid=genid;this.isowner=0;this.uploadsucces_container="lboxgallerycontainer";this.pCount=0;this.curPos=0;this.curStrip=1;this.photoLinks=null;this.photoIDs=null;this.photoPrimaries=null;this.travelPrimaries=null;this.stemp=1;this.tmpcommentid=0;this.curCrop=null;this.YUIcarousel=null;this.islastCropthumb=0;this.lastCropthumb=null;this.iscomdivopen=false;jQuery.ajaxSetup({url:"/ajaxpages/PhotoUILayout.php",dataType:"html",cache:false});this.managePhotos=false;},setLayout:function(layout){this.layout=layout;},setisOwner:function(isowner){this.isowner=isowner;},loadPhotoPopup:function(pID,mode,genID,pcontext){if(genID!=undefined){this.genid=genID;}
if(pcontext!=undefined){this.context=pcontext;}
PhotoService.layout=1;PhotoService.uploadsucces_container="lboxgallerycontainer";tb_show('','/thickbox/thickbox.php?height=800&width=800&mode='+mode+'&pID='+pID,'');},imgLoader:function(){var loaderlayer=jQuery("<div id='loaderlayer' style='display:block;'></div>");var psloader=new Image();psloader.src="/images/loading.gif";psloader.id="psloader";jQuery(psloader).appendTo(loaderlayer);return loaderlayer;},loadgallery:function(context,pID,container){if(context!=undefined){var params='action=onloadgallery&isowner='+this.isowner+'&layout='+PhotoService.layout+'&startrow='+1+'&pagenum='+1+'&context='+context+'&loginid='+this.loginid+'&genid='+this.genid+'&pID='+pID;this.context=context;jQuery('#tabloading').html('<img src="/images/loading.gif">');}else{var params='action=onloadgallery&isowner='+this.isowner+'&layout='+PhotoService.layout+'&startrow='+this.startrow+'&pagenum='+this.pagenum+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&pID='+pID;}
if(this.managePhotos){params+="&manage=1";}
if(container!=undefined){update_element=container;}else{update_element=PhotoService.uploadsucces_container;}
new Ajax.Updater(update_element,'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onComplete:function(transport){jQuery("#cropImage").bind("load",function(){if(null!=jQuery("#navhover")){PhotoService.resetNavOnPhoto();}});},onException:function(req,ex){new Ajax.Request('/ajaxpages/PhotoUILayout.php',{method:"get",parameters:params,asynchronous:true,onSuccess:function(response){jQuery("#"+update_element).html(response.responseText);jQuery("#"+update_element).ready(function(){PhotoService.pCount=jQuery("#photoCount").val();PhotoService.curPos=jQuery("#startPos").val();PhotoService.setPhotoArray(jQuery("#photoLinks").val(),jQuery("#photoIDs").val(),jQuery("#photoPrimaries").val(),jQuery("#isTravelPrimaries").val());PhotoService.curStrip=Math.floor(jQuery("#startPos").val()/6)+1;jQuery(".carousel-area").show();jQuery(".carousel-area").jCarouselLite({btnNext:".jcarousel-next",btnPrev:".jcarousel-prev",circular:false,visible:6,start:PhotoService.curPos,scroll:6});jQuery("#cropImage").bind("load",function(){if(null!=jQuery("#navhover")){PhotoService.resetNavOnPhoto();}});});}});}});},viewfullsize:function(f_size,layout,pID,isprimary,is_travelprimaryphoto){jQuery("input[@name=btncancel]").click();if(this.curCrop!=null){this.curCrop.remove();}
var cachekey=layout+"_"+pID;var cachekey_caption=layout+"_"+pID+"_caption";if('undefined'!=typeof(photo_captions)){if(!photo_captions.isCaptionSet(photo_captions.getCurrentKey())){photo_captions.setCaption(photo_captions.getCurrentKey(),GAJsCache[layout+"_"+photo_captions.getCurrentKey()+"_caption"]);}
if(photo_captions.isCaptionSet(pID)){jQuery("#caption_area").html(photo_captions.getCaption(pID));}else{photo_captions.setCaption(pID,GAJsCache[cachekey_caption]);jQuery("#caption_area").html(GAJsCache[cachekey_caption]);}
photo_captions.setCurrentKey(pID);}else{jQuery("#caption_area").html(GAJsCache[cachekey_caption]);}
fullsize_container=f_size;full_cache=cachekey;if(layout==1){setTimeout("fullsize_cback()",100);}else{setTimeout("fullsize_cback_thickbox()",100);}
if(PhotoService.isowner){if(layout==1){fullsize_cback_control_pID=pID;fullsize_cback_control_context=this.context;fullsize_cback_control_isPrimary=isprimary;setTimeout("fullsize_cback_control()",100)}
if((isprimary==0||(this.context=="travellog"&&is_travelprimaryphoto==0))&&layout==1){if(isprimary==0){if(this.context=="profile"){var opt="<option value='1'>my profile</option>";}else if(this.context=='photoalbum'){var opt="<option value='1'>this album</option>";}else{var opt="<option value='1'>this entry</option>";}}
if(this.context=="travellog"&&is_travelprimaryphoto==0){var opt=opt+"<option value='2'>this journal</option>";}
jQuery("#optionprimary").html
("<div class='optionprimary'>"
+"<span>Set as primary photo for </span>"
+"<select id='primary' onchange='PhotoService.setprimary("+pID+")'>"
+"<option value='0'>--select--</option>"
+opt+
+"</select>"
+"</div>");}else{jQuery("#optionprimary").html("");}
if(layout==1&&PhotoService.islastCropthumb>0){jQuery("#previewWrap"+PhotoService.islastCropthumb).html("<img src='"+PhotoService.lastCropthumb+"' border='1'/>");}
jQuery("#cropcontrols").css({display:"none"});}
if(layout==4){}
if(null!=this.photoIDs&&null!=this.photoLinks){for(var i=0;i<this.photoIDs.length;i++){if(this.photoIDs[i]==pID){this.curPos=i;break;}}
if(0==this.curPos){jQuery("#prev_photo").addClass("p_disabled");jQuery("#next_photo").removeClass("p_disabled");}
if(this.curPos==this.pCount-1){jQuery("#next_photo").addClass("p_disabled");jQuery("#prev_photo").removeClass("p_disabled");}
if(0<this.curPos&&this.curPos<this.pCount-1){jQuery("#prev_photo").removeClass("p_disabled");jQuery("#next_photo").removeClass("p_disabled");}}},editcaption:function(pID,startrow){if(this.curCrop!=null){this.curCrop.remove();}
var cachekey_caption="1_"+pID+"_caption";jQuery("#actionscontrol").css({display:"block"});jQuery("#crop_control").css({display:"none"});jQuery("#caption_control").css({display:"block"});photo_captions.setCurrentKey(pID);if(photo_captions.isCaptionSet(pID)){jQuery("#txtcaption").val(photo_captions.getCaption(pID));}else{jQuery("#txtcaption").val(GAJsCache[cachekey_caption]);photo_captions.setCaption(pID,GAJsCache[cachekey_caption]);}
jQuery('#action').val('savecaption');jQuery('#photoid').val(pID);if(PhotoService.islastCropthumb>0){jQuery("#previewWrap"+PhotoService.islastCropthumb).html("<img src='"+PhotoService.lastCropthumb+"' border='1'/>");}
jQuery("#cropcontrols").css({display:"none"});this.captionChanged();},savecaption:function(){var str=Form.serialize('frmcontrols');jQuery.ajax({type:"GET",data:str,dataType:"script",beforeSend:function(data){PhotoService.showloading();},success:function(data){PhotoService.hideloading();jQuery("#actionscontrol").slideUp("slow");var newcaption=PhotoService.removeNewlines(jQuery("#txtcaption").val());jQuery("#caption_area").html(newcaption);photo_captions.setCaption(photo_captions.getCurrentKey(),newcaption);}});},deletephoto:function(pID){if(this.curCrop!=null){this.curCrop.remove();}
var params='action=deletephoto&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&startrow=1'+'&pagenum=1'+'&pID='+pID;if(confirm("Do you want to Delete this Photo?"))
new Ajax.Updater("PhotocallbackContainer",'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){PhotoService.showloading();},onComplete:function(){PhotoService.hideloading();jQuery("#actionscontrol").slideUp("slow");}});},uploadphoto:function(context){if(this.curCrop!=null){this.curCrop.remove();}
jQuery("#photogallery"+context).css({display:"none"});jQuery("#arrange_control"+context).css({display:"none"});jQuery("#upload_control"+context).css({display:"block"});jQuery("#cropcontrols").css({display:"none"});},cancelaction:function(){jQuery("#photogallery").after(jQuery("#loading")[0]);jQuery("#loading").css({display:"block"});PhotoService.loadgallery();},ajaxFileUpload:function(tmp_sid,action){this.managePhotos=true;jQuery("#uploadprocess").ajaxStart(function(){jQuery(this).css({display:"block"});jQuery("#ccontrols").css({display:"none"});}).ajaxComplete(function(){});jQuery.ajaxFileUpload
({url:'/cgi-bin/uu_upload.pl?tmp_sid='+tmp_sid,async:true,secureuri:false,hdvar:'hdvar',fileElementId:'upfile',num:5,dataType:'html',beforeSend:function(data){PhotoService.showloading();},success:function(data)
{if(jQuery.trim(data)!="invalid"){if(PhotoService.context=="group"){window.location.reload(true);}else{if(PhotoService.context=="profile"){PhotoService.showCropAfterUpload(data);}else{PhotoService.uploadsucces_container="PhotocallbackContainer";PhotoService.loadgallery();}}}else{alert("Pls. Upload Image with (.jpeg,.jpg,.gif,.png) format only.");jQuery("#ccontrols").css({display:"block"});jQuery("#uploadprocess").css({display:"none"});}
PhotoService.hideloading();},error:function(data,status,e)
{}})
return false;},cancelAfterUploadCrop:function(){if(this.curCrop!=null){this.curCrop.remove();}
PhotoService.uploadsucces_container="PhotocallbackContainer";PhotoService.loadgallery();},showCropAfterUpload:function(pIDs){var params='action=showcropafterupload&isowner='+this.isowner+'&layout='+PhotoService.layout+'&startrow='+this.startrow+'&pagenum='+this.pagenum+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&pIDs='+pIDs;new Ajax.Updater("PhotocallbackContainer",'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){},onComplete:function(){}});},editphoto:function(pID){var params='action=editphoto&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&pID='+pID;new Ajax.Updater('actionscontrol','/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){jQuery("#loading").css({display:"block"});jQuery("#uploadcallback").css({display:"none"});},onComplete:function(){$("loading").style.display="none";jQuery("#actionscontrol").css({display:"none"});jQuery("#actionscontrol").slideDown("slow");}});},setprimary:function(pID){if(this.curCrop!=null){this.curCrop.remove();}
var params='&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&pID='+pID;t=jQuery("#primary option:selected");t=t[0].value;if(t==1)
params="action=doprimary"+params;else if(t==2)
params="action=doprimarytravel"+params;jQuery.ajax({type:"GET",data:params,dataType:"script",beforeSend:function(data){PhotoService.showloading();},success:function(data){PhotoService.hideloading();jQuery("#actionscontrol").slideUp("slow");}});},rotatephoto:function(pID,angle,startrow){if(this.curCrop!=null){this.curCrop.remove();}
var params='action=rotatephoto&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&startrow='+startrow+'&pagenum='+startrow+'&pID='+pID+'&angle='+angle;if(confirm("Do you want to rotate this photo?")){jQuery.ajax({type:"GET",data:params,dataType:"script",beforeSend:function(data){PhotoService.showloading();jQuery("#caption_control").css({display:"none"});},success:function(data){PhotoService.hideloading();}});}},showrearrangephotos:function(context){if(this.curCrop!=null){this.curCrop.remove();}
var params='action=showrearrangephotos&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid;jQuery.ajax({type:"GET",data:params,success:function(data){jQuery("#arrange_control"+context).css({display:"block"});jQuery("#arrange_control"+context).html(data);jQuery('#sortable').ready(function(){Sortable.create('sortable',{overlap:'horizontal',constraint:false});});PhotoService.hideloading();jQuery("#cropcontrols").css({display:"none"});jQuery("#photogallery"+context).css({display:"none"});jQuery("#upload_control"+context).css({display:"none"});},beforeSend:function(data){PhotoService.showloading();}});},saverearrangephotos:function(s){var list=document.getElementById(s);var items=list.getElementsByTagName('li');var ids='';var hiddeninput=document.getElementById('txtsortval');for(var i=0;i<items.length;i++){if(i>0)ids+=',';var id=items[i].getAttribute("id");ids+=id;}
hiddeninput.value=ids;new Ajax.Updater("PhotocallbackContainer",'/ajaxpages/PhotoUILayout.php',{method:'post',parameters:Form.serialize('frmarrange'),asynchronous:true,evalScripts:true,onLoading:function(){jQuery("#img_loading").css({display:"block"});},onComplete:function(){jQuery("#img_loading").css({display:"none"});}});},showthumbnailversion:function(photoID){var params='action=showthumbnailversion&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&photoid='+photoID;new Ajax.Updater("actionscontrol",'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){jQuery("#loading").css({display:"block"});},onComplete:function(){jQuery("#"+PhotoService.uploadsucces_container).find("#loading").css({display:"none"});jQuery("#actionscontrol").css({display:"none"});jQuery("#actionscontrol").slideDown("slow");jQuery("#loading").css({display:"none"});}});},execthumbnailversion:function(pID){if(null!=this.photoIDs){pID=this.photoIDs[this.curPos];}
if(this.curCrop!=null){this.curCrop.remove();}
var params='action=execcrop'+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&picsize=thumbnail'+'&pID='+pID;jQuery("#caption_control").css({display:"none"});jQuery.ajax({type:"GET",data:params,dataType:"script",beforeSend:function(data){PhotoService.showloading();},success:function(data){PhotoService.hideloading();jQuery("#cropcontrols").css({display:"block"});}});jQuery('#action').val('savethumbversion');jQuery('#photoid').val(pID);},execprofileversion:function(pID){if(this.curCrop!=null){this.curCrop.remove();}
var params='action=execcrop'+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid+'&picsize=profile'+'&pID='+pID;jQuery("#caption_control").css({display:"none"});jQuery.ajax({type:"GET",data:params,dataType:"script",beforeSend:function(data){PhotoService.showloading();},success:function(data){PhotoService.hideloading();jQuery("#cropcontrols").css({display:"block"});}});jQuery('#action').val('saveprofileversion');jQuery('#photoid').val(pID);},cancelCROPPING:function(pID,thumb){if(this.curCrop!=null){this.curCrop.remove();}
var thumbnail=GAJsCache["1_"+pID+"_thumb"];jQuery("#previewWrap"+pID).html("<img src='"+thumbnail+"' border='1'/>");jQuery("#cropcontrols").css({display:"none"});},savethumbnailversion:function(tofullview){var params=Form.serialize('frmcontrols');jQuery.ajax({type:"GET",data:params,dataType:"script",beforeSend:function(data){jQuery("#cropsuccess").html('Saving thumbnail, please wait...').css({display:"block"});jQuery("#cropcontrols").css({display:"none"});},success:function(data){jQuery("#cropsuccess").html("Thumbnail saved successfully.").fadeOut(2000);}});if(this.curCrop!=null){this.curCrop.remove();}
PhotoService.islastCropthumb=0;},saveprofileversion:function(tofullview){var params=Form.serialize('frmcontrols');jQuery.ajax({type:"GET",data:params,beforeSend:function(data){jQuery("#cropsuccess").html('Saving Profile version, please wait...').css({display:"block"});jQuery("#cropcontrols").css({display:"none"});},success:function(data){jQuery("#cropsuccess").html("Profile version saved successfully.").fadeOut(2000);PhotoService.uploadsucces_container="PhotocallbackContainer";PhotoService.loadgallery();}});if(this.curCrop!=null){this.curCrop.remove();}
PhotoService.islastCropthumb=0;},GA_pageWidth:function(){return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;},GA_pageHeight:function(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;},GA_posLeft:function(){return typeof window.pageXOffset!='undefined'?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;},GA_posTop:function(){return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;},showuploadmenu:function(context){if(this.curCrop!=null){this.curCrop.remove();}
this.context=context;var params='action=uplcontext&isowner='+this.isowner+'&layout='+this.layout+'&context='+this.context+'&loginid='+this.loginid+'&genid='+this.genid;new Ajax.Updater("photogallery",'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){jQuery("#photogallery").before(jQuery("#loading")[0]);jQuery("#loading").css({display:"block"});},onComplete:function(){jQuery("#actionscontrol").css({display:"none"});jQuery("#loading").css({display:"none"});}});},checkpfile:function(){$('upload').disabled=false;},m_time:function(){},showloading:function(){jQuery("#loadingmeter").css({display:"block"});},hideloading:function(){jQuery("#loadingmeter").css({display:"none"});},uploadGroupLogo:function(genID){if(this.curCrop!=null){this.curCrop.remove();}
PhotoService.context="group";var params='action=uploadphoto&layout='+this.layout+'&context=group&loginid='+this.loginid+'&genid='+genID;new Ajax.Updater("lboxgallerycontainer",'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){},onComplete:function(){jQuery("#lboxgallerycontainer").show();}});},removeGroupLogo:function(gID){var params='action=deletelogo&context=group&genid='+gID;jQuery.ajax({type:"GET",data:params,dataType:"html",beforeSend:function(data){jQuery("#removelogo").html("Loading, Please wait...");},success:function(data){tb_remove();window.location.reload(true);}});},loadCollection:function(context,pID,container,genID,title){var params='action=onloadgallery&layout=1&context='+context+'&loginid='+this.loginid+'&genid='+genID+'&pID='+pID;var cachekey_collection=context+"_"+pID+"_"+genID;if(!GAJsCache.has(cachekey_collection)){new Ajax.Updater(container,'/ajaxpages/PhotoUILayout.php',{method:'get',parameters:params,asynchronous:true,evalScripts:true,onLoading:function(){},onComplete:function(transport){jQuery("#cache_element").data(cachekey_collection,transport.responseText);GAJsCache[cachekey_collection]=cachekey_collection;jQuery("#albumheader").html(title);jQuery("#cropImage").bind("load",function(){if(null!=jQuery("#navhover")){PhotoService.resetNavOnPhoto();}});}});}else{collection_cache=cachekey_collection
setTimeout("collection_cback()",100);jQuery("#albumheader").html(title);}},testClickThickbox:function(){window.href="#TB_inline?height=150&width=400&inlineId=myOnPageContent";},setPhotoArray:function(links,ids,prims,travs){var pids=ids.split("$");var lnks=links.split("$");var primaries=prims.split("$");var travels=travs.split("$");this.photoLinks=new Array(lnks.length);this.photoIDs=new Array(pids.length);this.photoPrimaries=new Array(primaries.length);this.travelPrimaries=new Array(travels.length);for(var i=0;i<pids.length;i++){this.photoLinks[i]=lnks[i];this.photoIDs[i]=pids[i];this.photoPrimaries[i]=primaries[i];this.travelPrimaries[i]=travels[i];}},scrollToPrevPhoto:function(){if(this.curPos>0){var strip=Math.floor((this.curPos-1)/6)+1;if((0==(this.curPos)%6)&&(strip!=this.curStrip)){jQuery(".carousel-prev").click();}
this.curPos--;this.viewfullsize('fullsize',1,this.photoIDs[this.curPos],this.photoPrimaries[this.curPos],this.travelPrimaries[this.curPos]);if(0==this.curPos){jQuery("#prev_photo").addClass("p_disabled");jQuery("#next_photo").removeClass("p_disabled");}else{jQuery("#next_photo").removeClass("p_disabled");}}},scrollToNextPhoto:function(){if(this.curPos<this.pCount-1){var strip=Math.floor((this.curPos+1)/6)+1;if((0==(this.curPos+1)%6)&&(strip!=this.curStrip)){jQuery(".carousel-next").click();}
this.curPos++;this.viewfullsize('fullsize',1,this.photoIDs[this.curPos],this.photoPrimaries[this.curPos],this.travelPrimaries[this.curPos]);if(this.curPos==this.pCount-1){jQuery("#next_photo").addClass("p_disabled");jQuery("#prev_photo").removeClass("p_disabled");}else{jQuery("#prev_photo").removeClass("p_disabled");}}},getCurrentPhotoWidth:function(){return document.getElementById("cropImage").width;},resetNavOnPhoto:function(){if(null!=document.getElementById("navhover")){jQuery(".image_container").attr("style","width:"+this.getCurrentPhotoWidth()+"px;");jQuery(".navhover").attr("style","width:"+this.getCurrentPhotoWidth()+"px;");}},captionChanged:function(){var captionLength=jQuery("#txtcaption").val().length;if(250<captionLength){jQuery("#txtcaption").val(jQuery("#txtcaption").val().substring(0,250));captionLength=0;}else{captionLength=250-captionLength;}
jQuery("#caption_counter").val(captionLength);},removeNewlines:function(str_value){var string=escape(str_value);try{for(i=0;i<str_value.length;i++){if(string.indexOf("%0D%0A")>-1){string=string.replace("%0D%0A","");}
else if(string.indexOf("%0A")>-1){string=string.replace("%0A","");}else if(string.indexOf("%0D")>-1){string=string.replace("%0D","");}}}catch(e){}
return unescape(string);}}
var collection_cache="";function collection_cback(){jQuery("#gallerycontainer").html(jQuery("#cache_element").data(collection_cache));}
var PhotoCaptions=function(){if(this instanceof PhotoCaptions){this.init();}else{return new PhotoCaptions();}};PhotoCaptions.prototype={key:null,caption:null,currKey:null,init:function(){},setCaption:function(k,s){var index=this.getKeyIndex(k);if(-1<index){this.caption[index]=s;return this.caption[index];}
return false;},getCaption:function(k){var index=this.getKeyIndex(k);if(-1<index){return this.caption[index];}
return false;},getKeyIndex:function(k){for(var i=0;i<this.key.length;i++){if(k==this.key[i]){return i;}}
return-1;},setCurrentKey:function(k){this.currKey=k;},getCurrentKey:function(){return this.currKey;},isCaptionSet:function(k){for(var i=0;i<this.key.length;i++){if(k==this.key[i]&&null!=this.caption[i]){return true;}}
return false;},setPhotoIDs:function(ids){var pids=ids.split("$");this.key=new Array(pids.length);this.caption=new Array(pids.length);for(var i=0;i<pids.length;i++){this.key[i]=pids[i];this.caption[i]=null;}}};var ContentSlider=function(){}
ContentSlider.prototype={SLIDETIMER:50,SLIDESPEED:50,SCROLLTIMER:50,SCROLLSPEED:50,STARTINGOPACITY:50,slideContent:function(id,prefix,timer){try{var div=document.getElementById(id);var slider=div.parentNode;clearInterval(slider.timer);slider.section=parseInt(id.replace(/\D/g,''));slider.target=div.offsetTop;slider.style.top=slider.style.top||'0px';slider.current=slider.style.top.replace('px','');slider.direction=(Math.abs(slider.current)>slider.target)?1:-1;slider.style.filter='alpha(opacity='+contentSlider.STARTINGOPACITY+')';slider.timer=setInterval(function(){contentSlider.slideAnimate(slider,prefix,timer)},contentSlider.SLIDETIMER);}catch(e){throw e;}},slideAnimate:function(slider,prefix,timer){var curr=Math.abs(slider.current);var tar=Math.abs(slider.target);var dir=slider.direction;if((tar-curr<=contentSlider.SLIDESPEED&&dir==-1)||(curr-tar<=contentSlider.SLIDESPEED&&dir==1)){slider.style.top=(slider.target*-1)+'px';slider.style.opacity=1;slider.style.filter='alpha(opacity=100)';clearInterval(slider.timer);if(slider.autoscroll){setTimeout(function(){contentSlider.autoScroll(slider.id,prefix,timer)},timer*1000);}}else{var pos=(dir==1)?parseInt(slider.current)+contentSlider.SLIDESPEED:slider.current-contentSlider.SLIDESPEED;slider.current=pos;slider.style.top=pos+'px';}},scrollContent:function(id,dir){var div=document.getElementById(id);clearInterval(div.timer);var sections=div.getElementsByTagName('div');var length=sections.length;var limit;if(dir==-1){limit=0;}else{if(length>1){limit=sections[length-1].offsetTop;}else{limit=sections[length-1].offsetHeight-div.parentNode.offsetHeight+20;}}
div.style.opacity=contentSlider.STARTINGOPACITY*.01;div.style.filter='alpha(opacity='+contentSlider.STARTINGOPACITY+')';div.timer=setInterval(function(){contentSlider.scrollAnimate(div,dir,limit)},contentSlider.SCROLLTIMER);},scrollAnimate:function(div,dir,limit){div.style.top=div.style.top||'0px';var top=div.style.top.replace('px','');if(dir==1){if(limit-Math.abs(top)<=contentSlider.SCROLLSPEED){contentSlider.cancelScroll(div.id);div.style.top='-'+limit+'px';}else{div.style.top=top-contentSlider.SCROLLSPEED+'px';}}else{if(Math.abs(top)-limit<=contentSlider.SCROLLSPEED){contentSlider.cancelScroll(div.id);div.style.top=limit+'px';}else{div.style.top=parseInt(top)+contentSlider.SCROLLSPEED+'px';}}},cancelScroll:function(id){var div=document.getElementById(id);div.style.opacity=1;div.style.filter='alpha(opacity=100)';clearTimeout(div.timer);},autoScroll:function(id,prefix,timer,restart){var div=document.getElementById(id);div.autoscroll=(!div.autoscroll&&!restart)?false:true;if(div.autoscroll){var sections=div.getElementsByTagName('div');var length=sections.length;div.section=(div.section&&div.section<length)?div.section+1:1;contentSlider.slideContent(prefix+'-'+div.section,prefix,timer);}},cancelAutoScroll:function(id){var div=document.getElementById(id);div.autoscroll=false;}}
var contentSlider=new ContentSlider();;var CollectionPopup=function(){if(this instanceof CollectionPopup){this.init();}else{return new CollectionPopup();}};CollectionPopup.prototype={context:null,genID:null,photoID:null,oType:null,oID:null,currentIndex:0,photoCount:0,photoIDs:null,photoLinks:null,photos:null,preloaded:null,captions:null,journalTitles:null,slider:null,sliderSectionName:"",sliderSectionVisible:1,sliderSectionCount:0,photosPerSection:6,isNew:true,init:function(){this.context=null;this.genID=null;this.photoID=null;},setParams:function(oType,oID){this.oType=oType;this.oID=oID;},loadGallery:function(cntxt,gID,pID){this.isNew=true;this.context=cntxt;this.genID=gID;if('undefined'!=typeof(pID)){this.photoID=pID;}
var url='/collection.php?modal=true&width=972&action=22&context='+this.context+'&genID='+this.genID;if(null!=this.photoID){url+='&photoID='+this.photoID;}
if(null!=this.oType&&null!=this.oID){url+='&ID='+this.oID+'&type='+this.oType;}
tb_open_new('',url);},closeGallery:function(){self.parent.tb_remove(this);this.init();},scrollToPrevStrip:function(auto){if(1==this.sliderSectionVisible&&"undefined"==typeof(auto)){return false;}
this.sliderSectionVisible--;var name=this.sliderSectionName+"-"+this.sliderSectionVisible;this.slider.slideContent(name);},scrollToNextStrip:function(auto){if(this.sliderSectionCount==this.sliderSectionVisible&&"undefined"==typeof(auto)){return false;}
this.sliderSectionVisible++;var name=this.sliderSectionName+"-"+this.sliderSectionVisible;this.slider.slideContent(name);},scrollToPrevPhoto:function(){var index=this.getCurrentIndex();if(0<index){this.setCurrentIndex(--index);this.setActivePhoto();}
this.checkCurrentSliderSectionVisible();},scrollToNextPhoto:function(){var index=this.getCurrentIndex();if(index<this.getPhotoCount()-1){this.setCurrentIndex(++index);this.setActivePhoto();}
this.checkCurrentSliderSectionVisible();},checkCurrentSliderSectionVisible:function(){var index=this.getCurrentIndex();var curStripVisible=Math.floor(index/this.photosPerSection)+1;if(curStripVisible>this.sliderSectionVisible){this.scrollToNextStrip(true);}else if(curStripVisible<this.sliderSectionVisible){this.scrollToPrevStrip(true);}},setActivePhoto:function(photoID){if('undefined'!=typeof(photoID)){var index=this.getPhotoIndex(photoID);if(-1<index&&this.getCurrentIndex()!=index){this.setCurrentIndex(index);}}
jQuery("#prev_photo").hide();jQuery("#next_photo").hide();var curLink=this.getCurrentPhotoLink();var curCaption=this.getCurrentCaption();var curTitle=this.getCurrentJournalTitle();jQuery("#loading_photo_").show();var curImage=new Image();curImage.src=curLink;if(jQuery.browser.msie){collectionPopup.preloaded[collectionPopup.currentIndex]=true;jQuery("#loading_photo").hide();jQuery("#active_photo").fadeOut("normal",function(){jQuery("#TB_ajaxContent").attr("style","width:986px;");jQuery("#active_photo").attr("src",curLink);jQuery("#active_photo").fadeIn("normal",function(){jQuery("#active_photo_caption").html(curCaption);if(null!=jQuery("#journal_title")){jQuery("#journal_title").html(curTitle);}
collectionPopup.updateNavOnPhoto();});if(collectionPopup.isNew){jQuery("#thickboxs").show();collectionPopup.isNew=false;}});jQuery("#loading_photo_").hide();}else{curImage.onload=function(){collectionPopup.preloaded[collectionPopup.currentIndex]=true;var source=this.src;var width=this.width+237;jQuery("#loading_photo").hide();jQuery("#active_photo").fadeOut("normal",function(){jQuery("#TB_ajaxContent").attr("style","width:986px;");jQuery("#active_photo").attr("src",source);jQuery("#active_photo").fadeIn("normal",function(){jQuery("#active_photo_caption").html(curCaption);if(null!=jQuery("#journal_title")){jQuery("#journal_title").html(curTitle);}
collectionPopup.updateNavOnPhoto();});if(collectionPopup.isNew){jQuery("#thickboxs").show();collectionPopup.isNew=false;}});jQuery("#loading_photo_").hide();}}
collectionPopup.preloadPhotos();collectionPopup.setFBLikeSource(this.photoIDs[collectionPopup.currentIndex]);},getPhotoIndex:function(photoID){for(var i=0;i<this.photoIDs.length;i++){if(photoID==this.photoIDs[i]){return i;}}
return-1;},setCurrentIndex:function(index){this.currentIndex=index;},getCurrentIndex:function(){return this.currentIndex;},getCurrentCaption:function(){return this.captions[this.getCurrentIndex()];},getCurrentJournalTitle:function(){return this.journalTitles[this.getCurrentIndex()];},getCurrentUploadDate:function(){return this.uploadDates[this.getCurrentIndex()];},getCurrentPhotoLink:function(){return this.photoLinks[this.getCurrentIndex()];},getPhotoCount:function(){return this.photoCount;},setGalleryData:function(defaultIndex,photocount,photoID_array,links_array){this.currentIndex=defaultIndex;this.photoCount=photocount;var ids=photoID_array.split(",");var links=links_array.split(",");this.photoLinks=new Array();this.photoIDs=new Array();this.photos=new Array();this.fullsizelinks=new Array();this.preloaded=new Array();this.captions=new Array();this.journalTitles=new Array();for(var i=0;i<ids.length;i++){if('undefined'==typeof(this.preloaded[i])){this.preloaded[i]=false;}
this.photoIDs[i]=ids[i];this.photoLinks[i]=links[i];this.captions[i]=jQuery("#caption_"+i).html();if(null!=jQuery("#jtitle_"+i)){this.journalTitles[i]=jQuery("#jtitle_"+i).html();}else{this.journalTitles[i]="";}}
this.updateNavOnPhoto();},preloadPhotos:function(){for(var i=this.currentIndex-1,j=1;i>0&&j<=3;i--,j++){this.photos[i]=new Image();this.photos[i].src=this.photoLinks[i];this.photos[i].onload=function(){collectionPopup.preloaded[i]=true;}}
for(var i=this.currentIndex+1,j=1;i<this.photoCount&&j<=3;i++,j++){this.photos[i]=new Image();this.photos[i].src=this.photoLinks[i];this.photos[i].onload=function(){collectionPopup.preloaded[i]=true;}}},setSlider:function(sliderObj,name,sectionVisible,photosPerSection,sectionCount){this.slider=sliderObj;this.sliderSectionName=name;this.sliderSectionVisible=sectionVisible;this.photosPerSection=photosPerSection;this.sliderSectionCount=sectionCount;if(this.sliderSectionVisible==1){jQuery("#btnPrevStrip").addClass("disabled");}
if(this.sliderSectionVisible==this.sliderSectionCount){jQuery("#btnNextStrip").addClass("disabled");}},getCurrentPhotoWidth:function(){return document.getElementById("active_photo").width;},getCurrentPhotoHeight:function(){return document.getElementById("active_photo").height;},resetNavOnPhoto:function(){if(null!=document.getElementById("navhover")){var width=751;var height=this.getCurrentPhotoHeight()+2;jQuery(".navhover").show();this.updateNavOnPhoto();if(!jQuery.browser.msie){jQuery(".viewed_holder").attr("style","margin: auto; width: "+this.getCurrentPhotoWidth()+"px;");}}
if(this.isNew){var width=986;jQuery("#TB_ajaxContent").attr("style","width:"+width+"px;");contentSlider.slideContent(this.sliderSectionName+"-"+this.sliderSectionVisible);this.isNew=false;this.updateNavOnPhoto();if(!jQuery.browser.msie){jQuery(".viewed_holder").attr("style","margin: auto; width: "+this.getCurrentPhotoWidth()+"px;");}}},updateNavOnPhoto:function(){var position_text=(this.currentIndex+1)+" of "+this.photoCount+" Photos";jQuery("p[@name=photo_position_marker]").html(position_text);if(0==collectionPopup.getCurrentIndex()){jQuery("a[@name=prev_button]").addClass("buttonDisable");}else{jQuery("a[@name=prev_button]").removeClass("buttonDisable");}
if(collectionPopup.getCurrentIndex()==collectionPopup.getPhotoCount()-1){jQuery("a[@name=next_button]").addClass("buttonDisable");}else{jQuery("a[@name=next_button]").removeClass("buttonDisable");}
if(2>collectionPopup.getPhotoCount()){return;}
if(0==collectionPopup.getCurrentIndex()){jQuery("#prev_photo").hide();}else{jQuery("#prev_photo").show();}
if(collectionPopup.getCurrentIndex()==collectionPopup.getPhotoCount()-1){jQuery("#next_photo").hide();}else{jQuery("#next_photo").show();}},setFBLikeSource:function(photoID){if(jQuery("#fbLikeButton").length){var iframe=jQuery("#fbLikeButton > iframe");var orig_src=iframe.attr("src");var arr=orig_src.split("&");var href="";var like_href="";for(key in arr){if(typeof(arr[key])=='string'){if(arr[key].match("^href=")){var hash=escape("#");href=arr[key].replace("href=","");like_href=href;var qry=href.split(hash);if(qry[1]){like_href=like_href.replace(hash+qry[1],hash+photoID);}else{like_href=like_href+hash+photoID;}}}}
if(like_href!=""){var src=orig_src.replace(href,like_href);iframe.attr("src",src);}}}}
var collectionPopup=new CollectionPopup();var ThumbGridControl=function(){if(this instanceof ThumbGridControl){this.init();}else{return new ThumbGridControl();}};ThumbGridControl.prototype={init:function(){},expandGrid:function(){jQuery("#expand_grid").hide();jQuery("#grid_expansion").slideDown("fast");jQuery("#collapse_grid").show();},collapseGrid:function(){jQuery("#collapse_grid").hide();jQuery("#grid_expansion").slideUp("fast");jQuery("#expand_grid").show();},showGallery:function(pID,genID,loginID,context){if('undefined'==typeof(context)){context="travellog";}
collectionPopup.loadGallery(context,genID,pID);}}
var thumbGridControl=new ThumbGridControl();;var tb_pathToImage="/images/loading.gif";
/*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
imgLoader=new Image();imgLoader.src=tb_pathToImage;jQuery(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');});function tb_init(domChunk){jQuery(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;});}
function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","auto");if(document.getElementById("TB_HideSelect")===null){jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click();}}else{if(document.getElementById("TB_overlay")===null){jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click();}}
if(tb_detectMacXFF()){jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{jQuery("#TB_overlay").addClass("TB_overlayBG");}
if(caption===null){caption="";}
jQuery("body").append("<div id='TB_load'> <table class='table_popbox table_loader'><tbody><tr><td class='popbox_topLeft'></td><td class='popbox_border'></td><td class='popbox_topRight'></td></tr><tr><td class='popbox_border'></td><td class='loading_message'><span id='imgLoading'><img alt='Loading' src='"+imgLoader.src+"' /></span><em id='statusCaption'>Please wait...</em></td><td class='popbox_border'></td></tr><tr><td class='popbox_bottomLeft'></td><td class='popbox_border'></td><td class='popbox_bottomRight'></td></tr></tbody></table></div>");jQuery('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}
var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=jQuery("a[@rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}}
imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}
TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>"+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='/images/g_close.gif' alt='Close' /></a> </div>");jQuery("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}
jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;}
jQuery("#TB_prev").click(goPrev);}
if(!(TB_NextHTML==="")){function goNext(){jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;}
jQuery("#TB_next").click(goNext);}
document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();jQuery("#TB_load").remove();jQuery("#TB_ImageOff").click(tb_remove);jQuery("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-0;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');jQuery("#TB_iframeContent").remove();if(params['modal']!="true"){jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:auto;' > </iframe>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:auto;'> </iframe>");}}else{if(jQuery("#TB_window").css("display")!="block"){if(params['modal']!="true"){jQuery("#TB_window").append("<div id='TB_ajaxContent' class='prompt' style='width:"+ajaxContentW+"px;height:auto;'></div>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal prompt' style='width:"+ajaxContentW+"px;height:auto'></div>");}}else{jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";jQuery("#TB_ajaxContent")[0].scrollTop=0;jQuery("#TB_ajaxWindowTitle").html(caption);}}
jQuery("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){jQuery("#TB_ajaxContent").append(jQuery('#'+params['inlineId']).children());jQuery("#TB_window").unload(function(){jQuery('#'+params['inlineId']).append(jQuery("#TB_ajaxContent").children());});tb_position();jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});if('auto'==params['height']){jQuery("#TB_ajaxContent").css({height:'auto'});}}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}}else{jQuery("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();jQuery("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");jQuery("#TB_window").css({display:"block"});});}}
if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}};}}catch(e){}}
function tb_showIframe(){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}
function tb_remove(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});jQuery("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){jQuery("body","html").css({height:"auto",width:"auto"});jQuery("html").css("overflow","");}
document.onkeydown="";document.onkeyup="";return false;}
function TB_pageWidth(){return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;}
function TB_pageHeight(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;}
function TB_posLeft(){return typeof window.pageXOffset!='undefined'?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;}
function TB_posTop(){return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;}
function tb_position(){jQuery("#TB_window").css({position:"absolute",width:TB_WIDTH+'px'});var TB_lt=TB_posLeft()+((TB_pageWidth()-TB_WIDTH)/2);var TB_tp=TB_posTop()+((TB_pageHeight()-TB_HEIGHT)/2);jQuery("#TB_window").css({left:TB_lt+'px'});jQuery("#TB_window").css({top:(TB_posTop()+30)+'px'});}
function tb_parseQuery(query){var Params={};if(!query){return Params;}
var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}
var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}
function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}
function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}}
var jThickboxNewLink;function tb_remove_open(reloadLink){jThickboxReloadLink=reloadLink;tb_remove();setTimeout("jThickboxNewLink();",500);return false;}
function tb_open_new(title,jThickboxNewLink){tb_show(title,jThickboxNewLink,null);}
