var tool=new function(){}
tool.isFunction=function(a){return typeof a=='function';};tool.isObject=function(a){return(a&&typeof a=='object')||isFunction(a);};tool.createNewElement=function(type,property,style){var el=document.createElement(type);if(property&&property!=null){for(var prop in property){el[prop]=property[prop];}}
if(style&&style!=null){for(var stl in style){el.style[stl]=style[stl];}}
return el;};tool.getPosition=function(theElement){var positionX=0;var positionY=0;while(theElement!=null){positionX+=theElement.offsetLeft;positionY+=theElement.offsetTop;theElement=theElement.offsetParent;}
return[positionX,positionY];};tool.registerEvent=function(obj,evt,handler){if(obj.attachEvent)obj.attachEvent("on"+evt,handler);else obj.addEventListener(evt,handler,false);};tool.contains_ns6=function(a,b){while(b.parentNode)
if((b=b.parentNode)==a)
return true;return false;};tool.inArray=function(arr,val){for(var i=0;i<arr.length;i++){if(arr[i]==val){return true;break;}}
return false;}
tool.isObjectPropertyValueExists=function(obj,val){for(var property in obj){if(obj[property]==val){return true;}}
return false;}
tool.isObjectPropertyExists=function(obj,key){for(var property in obj){if(property==key){return true;}}
return false;}
tool.isInstanceOf=function(obj,_constructor){while(obj!=null){if(obj==_constructor.prototype)return true;obj=obj.__proto__;}
return false;}
tool.getObjectLen=function(obj){var i=0;for(var prop in obj){i++;}
return i;}
tool.AddEvent=function(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false);}
else if(obj.attachEvent){obj['e'+type+fn]=fn;obj[type+fn]=function(){this['e'+type+fn](window.event);}
obj.attachEvent('on'+type,obj[type+fn]);}
obj=null;};tool.RemoveEvent=function(obj,type,fn){if(obj.detachEvent){obj.detachEvent('on'+type,obj[type+fn]);obj[type+fn]=null;}
else obj.removeEventListener(type,fn,false);};tool.isObject=function(obj){return(obj&&typeof obj=='object')||tool.isFunction(obj)};tool.isArray=function(obj){return tool.isObject(obj)&&obj.constructor==Array};tool.isBoolean=function(obj){return typeof obj=='boolean'};tool.isFunction=function(obj){return typeof obj=='function'};tool.isNull=function(obj){return typeof obj=='object'&&!obj};tool.isNumber=function(obj){return typeof obj=='number'&&isFinite(obj)};tool.isString=function(obj){return typeof obj=='string'}
tool.isUndefined=function(obj){return typeof obj=='undefined';}
tool.utf8Encode=function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;}
tool.utf8Decode=function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}
if(!tool.isFunction(Function.apply)){Function.method('apply',function(o,a){var r,x='____apply';if(!tool.isObject(o)){o={};}
o[x]=this;switch((a&&a.length)||0){case 0:r=o[x]();break;case 1:r=o[x](a[0]);break;case 2:r=o[x](a[0],a[1]);break;case 3:r=o[x](a[0],a[1],a[2]);break;case 4:r=o[x](a[0],a[1],a[2],a[3]);break;case 5:r=o[x](a[0],a[1],a[2],a[3],a[4]);break;case 6:r=o[x](a[0],a[1],a[2],a[3],a[4],a[5]);break;default:alert('Too many arguments to apply.');}
delete o[x];return r;});};Function.prototype.bind=function(object){var __method=this;return function(){__method.apply(object,arguments);}};if(!$){var $=function(id){return document.getElementById(id);}};function map(dId){var mapId=dId;this.mapLocation=new Array();this.mapFrame=document.getElementById(dId);this.gMapApi=new GMap2(this.mapFrame);this.fixZoomLevel=0;this.lineWidth=0;this.connectMarkers=true;if(this.mapFrame.style.width.substr(0,this.mapFrame.style.width.length-2)==''){this.gMapApi.addControl(new GLargeMapControl());this.gMapApi.addControl(new GMapTypeControl(true));}
else if(this.mapFrame.style.width.substr(0,this.mapFrame.style.width.length-2)<=550){this.gMapApi.addControl(new GSmallMapControl());}
else{this.gMapApi.addControl(new GLargeMapControl());this.gMapApi.addControl(new GMapTypeControl(true));}
this.onClick=function(){};this.onZoom=function(oldZoomLevel,newZoomLevel){var zoomLevel=(typeof newZoomLevel!='undefined')?newZoomLevel:this.fixZoomLevel;var quad=Math.abs(Math.floor(zoomLevel/3));this.lineWidth=((quad<=0)?1:quad)*2;this.clearMapMarkers();this.markMapLocations();this.connectMapLocations();};GEvent.bind(this.gMapApi,"click",this,function(overlay,point){this.onClick(overlay,point)});this.getMapId=function(){return mapId;}};map.prototype.setConnectMarkers=function(_con){this.connectMarkers=_con;}
map.prototype.getConnectMarkers=function(){return this.connectMarkers;}
map.prototype.setFixZoomLevel=function(_fx){this.fixZoomLevel=_fx;}
map.prototype.getPoint=function(overlay,point){if(point){alert('You clicked at: '+point);}};map.prototype.addMapLocation=function(loc){this.mapLocation[this.mapLocation.length]=loc;};map.prototype.markMapLocations=function(){for(var i=0;i<this.mapLocation.length;i++){if(this.mapLocation[i].getMapMarker()!=null){var mkr=mapHelper.createGMarker(this.mapLocation[i]);this.gMapApi.addOverlay(mkr);}};};map.prototype.connectMapLocations=function(){var pts=new Array();if(this.connectMarkers==true){for(var i=0;i<this.mapLocation.length;i++){if(this.mapLocation[i].getMapMarker()!=null){pts[i]=new GLatLng(this.mapLocation[i].getLat(),this.mapLocation[i].getLng());}}
if(pts.length){this.gMapApi.addOverlay(new GPolyline(pts,'RED',2));}}}
map.prototype.initZoomingCenter=function(){this.setCenter();this.setZoom();};map.prototype.setZoom=function(zm){if(this.fixZoomLevel==0){var bounds=new GLatLngBounds();for(var i=0;i<this.mapLocation.length;i++){bounds.extend(new GLatLng(this.mapLocation[i].getLat(),this.mapLocation[i].getLng()));}
if(this.mapLocation.length){this.gMapApi.setZoom(this.gMapApi.getBoundsZoomLevel(bounds));}
else{this.gMapApi.setZoom(8);}}
else{this.gMapApi.setZoom(this.fixZoomLevel);}};map.prototype.setCenter=function(){var focusedLatLng=null;var bounds=new GLatLngBounds();for(var i=0;i<this.mapLocation.length;i++){if(this.mapLocation[i].isFocused()){focusedLatLng=new GLatLng(this.mapLocation[i].getLat(),this.mapLocation[i].getLng())
break;}
bounds.extend(new GLatLng(this.mapLocation[i].getLat(),this.mapLocation[i].getLng()));}
if(focusedLatLng==null){if(this.mapLocation.length){var zmLevel=(this.gMapApi.getBoundsZoomLevel(bounds)>2)?2:this.gMapApi.getBoundsZoomLevel(bounds);this.gMapApi.setCenter(bounds.getCenter());this.gMapApi.setZoom(zmLevel);}
else{this.gMapApi.setCenter(new GLatLng(0,0));}}
else{this.gMapApi.setCenter(focusedLatLng);}};map.prototype.clearMapLocations=function(){this.mapLocation.length=0;this.clearMapMarkers();}
map.prototype.clearMapMarkers=function(){this.gMapApi.clearOverlays();}
map.prototype.getMapLocations=function(){return this.mapLocation;}
function mapLocation(){var lng=null;var lat=null;var link=null;var marker=null;var isFocused=false;this.setLat=function(_lat){lat=_lat;};this.getLat=function(){return lat;};this.setLng=function(_lng){lng=_lng;};this.setFocus=function(){isFocused=true};this.removeFocus=function(){isFocused=false};this.getLng=function(){return lng;};this.setMapMarker=function(_marker){marker=_marker};this.getMapMarker=function(){return marker};this.isFocused=function(){return isFocused};};function mapMarker(){var txt="";var link="";this.setTxt=function(_txt){txt=_txt;};this.getTxt=function(){return txt;};this.setLink=function(_link){link=_link};this.getLink=function(){return link};};function geoCoderAgent(){this.address=null;this.onFail=function(){};this.onSuccess=function(){};this.point=null;};;var mapAgent=new function(){this.mapRegistry=new Array();this.mapDummy=new Array();this.eventRegistry={onLoad:function(){}};};mapAgent.registerEvent=function(evt,method){mapAgent.eventRegistry[evt]=method;}
mapAgent.load=function(){if(GBrowserIsCompatible()){var ardiv=document.getElementsByTagName('div');for(var i=0;i<ardiv.length;i++){if(ardiv[i].className=='map'){var _map=new map(ardiv[i].id);for(var x=0;x<mapAgent.mapDummy.length;x++){if(mapAgent.mapDummy[x].getMapId()==_map.getMapId()){_map.setFixZoomLevel(mapAgent.mapDummy[x].getFixZoomLevel());_map.setConnectMarkers(mapAgent.mapDummy[x].getConnectMarkers());var withCoor=false;for(var j=0;j<mapAgent.mapDummy[x].dataDummy.length;j++){var curDataDummy=mapAgent.mapDummy[x].dataDummy[j];if(typeof(curDataDummy.getLat())!='undefined'&&typeof(curDataDummy.getLat())!='undefined'){withCoor=true;var _loc=new mapLocation();_loc.setLat(curDataDummy.getLat());_loc.setLng(curDataDummy.getLng());if(curDataDummy.isFocused()){_loc.setFocus();}
if(curDataDummy.getVisibility()){_mkr=new mapMarker();_mkr.setTxt(curDataDummy.getTxt());_mkr.setLink(curDataDummy.getLink());_loc.setMapMarker(_mkr);}
_map.addMapLocation(_loc);}}
if(!withCoor){var _loc=new mapLocation();_loc.setLat(0);_loc.setLng(0);_map.addMapLocation(_loc);}}}
mapAgent.registerMap(_map);}}
mapAgent.configureMaps();mapAgent.eventRegistry['onLoad']();}
else alert('Sorry, your browser does not support the Google Maps API. Map features will not be available to you.');}
mapAgent.configureMaps=function(){for(var i=0;i<mapAgent.mapRegistry.length;i++){mapAgent.mapRegistry[i].initZoomingCenter();mapAgent.mapRegistry[i].markMapLocations();if(mapAgent.mapRegistry[i].getConnectMarkers()==true){mapAgent.mapRegistry[i].connectMapLocations();}}}
mapAgent.registerMap=function(_map){mapAgent.mapRegistry[mapAgent.mapRegistry.length]=_map;}
mapAgent.removeMap=function(dId){var _mapId=(dId)?'_map'+dId:mapAgent.mapRegistry[mapAgent.mapRegistry.length-1].mapId;var mapEl=document.getElementById(_mapId);var prEl=mapEl.parentNode;prEl.removeChild(mapEl);}
mapAgent.unload=function(){GUnload();}
mapAgent.getMap=function(dId){if(dId){for(var i=0;i<mapAgent.mapRegistry.length;i++){if(mapAgent.mapRegistry[i].mapId=='_map'+dId)return mapAgent.mapRegistry[i];}
alert('Warning! Map with map ID \''+dId+'\' is undefined.');}
else{if(!mapAgent.mapRegistry.length)alert('Error! No map is defined.');else return mapAgent.mapRegistry[mapAgent.mapRegistry.length-1];}}
mapAgent.getAllMaps=function(){return mapAgent.mapRegistry;}
mapAgent.addMapDummy=function(mDummy,mId){mapAgent.mapDummy[mapAgent.mapDummy.length]=mDummy;}
mapAgent.getLatLng=function(gcAgent){return mapHelper.getLatLng(gcAgent);}
window.onunload=mapAgent.unload;function mapDummy(){this.dataDummy=new Array();var mapId="";var fixZoomLevel=0;var connectMarkers=true;this.setMapId=function(_mapId){mapId=_mapId;}
this.getMapId=function(){return mapId;}
this.addDataDummy=function(_dum){this.dataDummy[this.dataDummy.length]=_dum;}
this.setFixZoomLevel=function(_fixZoomLevel){fixZoomLevel=_fixZoomLevel;}
this.getFixZoomLevel=function(){return fixZoomLevel;}
this.setConnectMarkers=function(_con){connectMarkers=_con;}
this.getConnectMarkers=function(){return connectMarkers;}}
function dataDummy(){var lat=null;var lng=null;var text=null;var link=null;var visibility=true;var isFocused=false;this.setLat=function(_lat){lat=_lat;}
this.setLng=function(_lng){lng=_lng;}
this.setTxt=function(_text){text=_text;}
this.setLink=function(_link){link=_link;}
this.setVisibility=function(_visibility){visibility=_visibility}
this.setFocus=function(){isFocused=true;}
this.removeFocus=function(){isFocused=false;}
this.getLat=function(){return lat;}
this.getLng=function(){return lng;}
this.getTxt=function(){return text;}
this.getLink=function(){return link;}
this.getVisibility=function(){return visibility;}
this.isFocused=function(){return isFocused;}};var mapHelper=new function(){this.arrowIcon=new GIcon();this.arrowIcon.iconSize=new GSize(24,24);this.arrowIcon.shadowSize=new GSize(1,1);this.arrowIcon.iconAnchor=new GPoint(12,12);this.arrowIcon.infoWindowAnchor=new GPoint(0,0);this.geoCoder=new GClientGeocoder();};mapHelper.createGMarker=function(loc){var icon=new GIcon();icon.image="/images/ga_markerTransparent.png";icon.shadow="/images/ga_marker_shadowTransparent.png";icon.iconSize=new GSize(12,20);icon.shadowSize=new GSize(22,20);icon.iconAnchor=new GPoint(6,20);icon.infoWindowAnchor=new GPoint(loc.getLat(),loc.getLng());var point=new GLatLng(loc.getLat(),loc.getLng());var marker=new GMarker(point,icon);if(loc.getMapMarker().getLink()!=null){GEvent.addListener(marker,"click",function(){window.location=loc.getMapMarker().getLink();});}
if(loc.getMapMarker().getTxt()!=null&&loc.getMapMarker().getTxt().length){var html='<div>'+loc.getMapMarker().getTxt()+'</div>';GEvent.addListener(marker,"mouseover",function(){marker.openInfoWindowHtml(html);});}
return marker;};mapHelper.bearing=function(from,to){var degreesPerRadian=180.0/Math.PI;var lat1=from.latRadians();var lon1=from.lngRadians();var lat2=to.latRadians();var lon2=to.lngRadians();var angle=-Math.atan2(Math.sin(lon1-lon2)*Math.cos(lat2),Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(lon1-lon2));if(angle<0.0)angle+=Math.PI*2.0;angle=angle*degreesPerRadian;angle=angle.toFixed(1);return angle;};mapHelper.arrowHead=function(map,points,size){var p1=points[points.length-1];var p2=points[points.length-2];if(points.length>1){var dir=mapHelper.bearing(p2,p1);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}
mapHelper.arrowIcon.image="http://www.google.com/intl/en_ALL/mapfiles/dir_"+dir+".png";mapHelper.arrowIcon.iconSize=(typeof size!='undefined')?size:mapHelper.arrowIcon.iconSize;mapHelper.arrowIcon.shadowSize=(typeof size!='undefined')?size:mapHelper.arrowIcon.shadowSize;map.addOverlay(new GMarker(p1,mapHelper.arrowIcon));}
else{map.addOverlay(new GMarker(p1));}};mapHelper.midArrows=function(map,points){for(var i=1;i<points.length-1;i++){var p1=points[i-1];var p2=points[i+1];var dir=mapHelper.bearing(p1,p2);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}
mapHelper.arrowIcon.image="http://www.google.com/intl/en_ALL/mapfiles/dir_"+dir+".png";map.addOverlay(new GMarker(points[i],mapHelper.arrowIcon));}};mapHelper.trimCoor=function(_str){_str=_str.replace(/,/g,"");_str=_str.replace(/ /g,"");_str=_str.replace(/\(/g,"");_str=_str.replace(/\)/g,"");return _str;};mapHelper.convertGPoint=function(point){if(point){var lat=sTrim(point.toString().split(',')[0]);var lng=sTrim(point.toString().split(',')[1]);return new mLocation(lat,lng);}
else return null;}
mapHelper.getLatLng=function(gcAgent){mapHelper.geoCoder.getLatLng(gcAgent.address,function(point){if(!point){gcAgent.onFail();}
else{gcAgent.point=point;gcAgent.onSuccess();}})};;var Video={validate:function(){var checkUrl=true;var checkCaption=true;var checkTitle=true;var url=jQuery('#txtVideoUrl').attr('value');var title=jQuery('#txtVideoTitle').attr('value');var caption=jQuery('#txaVideoCaption').attr('value');if(0<url.length){if((-1==url.indexOf('embed')&&-1==url.indexOf('object')&&-1<url.indexOf('.com'))||(url.indexOf('youtu.be')>-1)){if(-1==url.indexOf('youtube.com')&&(-1==url.indexOf('youtu.be'))&&(-1==url.indexOf('video.google.com'))&&(-1==url.indexOf('vimeo.com'))){jQuery('#urlError').html('Url not supported').show();checkUrl=false;}
else{jQuery('#urlError').empty().hide();checkUrl=true;}}
else{jQuery('#urlError').html('Invalid url').show();checkUrl=false;}}
else{jQuery('#urlError').html('Required').show();checkUrl=false;}
if(-1<title.indexOf('+')||-1<title.indexOf('#')){jQuery('#titleError').show();checkTitle=false;}
else{jQuery('#titleError').hide();checkTitle=true;}
if(-1<caption.indexOf('+')||-1<caption.indexOf('\\')||-1<caption.indexOf('#')){jQuery('#captionError').show();checkCaption=false;}
else{jQuery('#captionError').hide();checkCaption=true;}
return(checkUrl&&checkTitle&&checkCaption);},submit_form:function(videoID,type,entryID,collectionID,ownerID,ownerType,redirect){if(this.validate()){var regExp1=new RegExp('&','gim');var regExp2=new RegExp('&','gim');var regExp3=new RegExp('&','gim');var regExp4=new RegExp('#','gim');var location='/video.php?';if('group_template'==ownerType)
location+='action=save&vID='+videoID;else
location+='action=saveVideo&videoID='+videoID;location+='&videoUrl='+jQuery('#txtVideoUrl').attr('value').replace(regExp1,'@').replace(regExp4,'~');location+='&title='+jQuery('#txtVideoTitle').attr('value').replace(regExp2,'@');location+='&caption='+jQuery('#txaVideoCaption').attr('value').replace(regExp3,'@');location+='&type='+type;if('album'==type){if('group_template'==ownerType)
location+='&aID='+collectionID;else
location+='&albumID='+collectionID;}
else{location+='&travelID='+collectionID;location+='&travelLogID='+entryID;}
if('group_template'!=ownerType){if('traveler'==ownerType.toLowerCase())
location+='&travelerID='+ownerID;else
location+='&gID='+ownerID;}
if(''==redirect)
this.hidePopUp();else{this.hideThickbox();location+='&redirect='+redirect;}
window.location.href=location;}},hidePopUp:function(){var dimmer=document.getElementById("popup_dimmer");var popup=document.getElementById("popup");document.body.removeChild(popup);document.body.removeChild(dimmer);},hideThickbox:function(){tb_remove();document.getElementById("txtVideoUrl").value="";document.getElementById("txtVideoTitle").value="";document.getElementById("txaVideoCaption").value="";document.getElementById("urlError").innerHTML="";document.getElementById("titleError").innerHTML="";document.getElementById("captionError").innerHTML="";},showAddCustomPopUp:function(type,collectionID,ownerID,ownerType){if(0==collectionID&&'journal'==type){CustomPopup.initPrompt("A journal entry must be selected first for you to be able to add a video for this collection.","Add Video","Ok");CustomPopup.createPopup();}
else{var htmlCode="<div id='popup_confirm' class='confirm'>";htmlCode+="<center><img src='/images/loading.gif' /><br/>Loading</center>";htmlCode+="</div>";CustomPopup.createPopUpUsingLayout1(htmlCode,100,100,'popup_dimmer','popup');jQuery.ajax({url:"/ajaxpages/manage-videos.php",data:"videoID=0&type="+type+"&collectionID="+collectionID+"&ownerID="+ownerID+"&ownerType="+ownerType,success:function(json){CustomPopup.removePopup();var data=eval('('+json+')');var htmlCode="<h4 id='popup_header' class='header'><strong>Add Video</strong></h4>";htmlCode+="<div id='popup_confirm' class='confirm'>";htmlCode+="<div>";htmlCode+="<strong>URL:<span class='required'>*</span></strong>";htmlCode+="<span id='urlError' style='display:none' class='required'></span>";htmlCode+="</div>";htmlCode+="<div><input type='text' id='txtVideoUrl' name='txtVideoUrl' value='' size='30' class='inputs'/></div>";htmlCode+="<div>";htmlCode+="<strong>Title:</strong>";htmlCode+="<span id='titleError' style='display:none' class='required'>Do not use + and # for video title.</span>";htmlCode+="</div>";htmlCode+="<div><input type='text' id='txtVideoTitle' name='txtVideoTitle' value='' size='30' class='inputs'/></div>";htmlCode+="<div>";htmlCode+="<strong>Caption:</strong>";htmlCode+="<span id='captionError' style='display:none' class='required'>Do not use +, \\ and # for video caption.</span>";htmlCode+="</div>";htmlCode+="<div><textarea name='txaVideoCaption' id='txaVideoCaption' class='inputs' style='width:250px;'></textarea></div>";htmlCode+="</div>";htmlCode+="<div id='popup_buttons' class='buttons_box'>";htmlCode+="<input id='a_submit' class='prompt_button' type='button' onclick='Video.submit_form("+data['id']+",\""+data['type']+"\","+data['entryID']+","+data['collectionID']+","+data['ownerID']+",\""+data['ownerType']+"\", \"\")' value='Add'/>";htmlCode+="<input id='a_cancel' class='prompt_button' type='button' value='Cancel' onclick='Video.hidePopUp()'/>";htmlCode+="</div>";CustomPopup.createPopUpUsingLayout1(htmlCode,400,500,'popup_dimmer','popup');}});}},showEditCustomPopUp:function(videoID,type){var htmlCode="<div id='popup_confirm' class='confirm'>";htmlCode+="<center><img src='/images/loading.gif' /><br/>Loading</center>";htmlCode+="</div>";CustomPopup.createPopUpUsingLayout1(htmlCode,100,100,'popup_dimmer','popup');jQuery.ajax({url:"/ajaxpages/manage-videos.php",data:"videoID="+videoID+"&type="+type,success:function(json){CustomPopup.removePopup();var data=eval('('+json+')');data['title']=data['title'].replace(/\'/g,'&#39;');data['title']=data['title'].replace(/\"/g,'&#34;');data['title']=data['title'].replace(/\\/g,'&#92');var htmlCode="<h4 id='popup_header' class='header'><strong>Edit Video</strong></h4>";htmlCode+="<div id='popup_confirm' class='confirm'>";htmlCode+="<div>";htmlCode+="<strong>URL:<span class='required'>*</span></strong>";htmlCode+="<span id='urlError' style='display:none' class='required'></span>";htmlCode+="</div>";htmlCode+="<div><input type='text' id='txtVideoUrl' name='txtVideoUrl' value='"+data['url']+"' size='30' class='inputs'/></div>";htmlCode+="<div>";htmlCode+="<strong>Title:</strong>";htmlCode+="<span id='titleError' style='display:none' class='required'>Do not use + and # for video title.</span>";htmlCode+="</div>";htmlCode+="<div><input type='text' id='txtVideoTitle' name='txtVideoTitle' value='"+data['title']+"' size='30' class='inputs'/></div>";htmlCode+="<div>";htmlCode+="<strong>Caption:</strong>";htmlCode+="<span id='captionError' style='display:none' class='required'>Do not use +, \\ and # for video caption.</span>";htmlCode+="</div>";htmlCode+="<div><textarea name='txaVideoCaption' id='txaVideoCaption' class='inputs' style='width:250px;'>"+data['caption']+"</textarea></div>";htmlCode+="</div>";htmlCode+="<div id='popup_buttons' class='buttons_box'>";htmlCode+="<input id='a_submit' class='prompt_button' type='button' onclick='Video.submit_form("+data['id']+",\""+data['type']+"\","+data['entryID']+","+data['collectionID']+","+data['ownerID']+",\""+data['ownerType']+"\", \"\")' value='Edit'/>";htmlCode+="<input id='a_cancel' class='prompt_button' type='button' value='Cancel' onclick='Video.hidePopUp()'/>";htmlCode+="</div>";CustomPopup.createPopUpUsingLayout1(htmlCode,400,500,'popup_dimmer','popup');}});},showDeleteCustomPopUp:function(videoID,type){var htmlCode="<div id='popup_confirm' class='confirm'>";htmlCode+="<center><img src='/images/loading.gif' /><br/>Loading</center>";htmlCode+="</div>";CustomPopup.createPopUpUsingLayout1(htmlCode,100,100,'popup_dimmer','popup');jQuery.ajax({url:"/ajaxpages/manage-videos.php",data:"videoID="+videoID+"&type="+type,success:function(json){CustomPopup.removePopup();var data=eval('('+json+')');var location='/video.php?';var ownerType=data['ownerType'];if('group_template'==ownerType)
location+='action=delete&vID='+data['id'];else{location+='action=deleteVideo&videoID='+data['id'];if('album'==data['type'])
location+='&albumID='+data['collectionID'];else{location+='&travelID='+data['collectionID'];if(0<data['entryID'])
location+='&travelLogID='+data['entryID']+'&jeVideos=1';}
if('traveler'==ownerType.toLowerCase())
location+='&travelerID='+data['ownerID'];else
location+='&gID='+data['ownerID'];location+='&type='+data['type'];}
CustomPopup.initialize('Delete Video ?','Are you sure you want to delete this video?',location,'Delete','1');CustomPopup.createPopup();}});}}
