// Taxonomies Value Objects ..... function Taxonomy(catName,catId,taxName) { // Setters .... this._catName = catName; this._catId = catId; this._taxName = taxName; // Getters .... this.getCatName = function() { return this._catName; }; this.getCatId = function() { return this._catId; }; this.getTaxName = function() { return this._taxName; }; } //To delete selected items function delete_items(objectType) { var pId=0; var collectionId=0; if(getParameter("pId")){ pId = getParameter("pId"); pId = pId.replace("#",""); } if(getParameter("collectionId")){ collectionId = getParameter("collectionId"); //alert(collectionId); } var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_delete = new Array(); for(i=0;i0) { var name=confirm(ValidatorsM[2]); if(name ==true) { //alert("total_to_delete"+total_to_delete); var url = "a1deleteobject_p2.do?odl="+total_to_delete+"&oType="+objectType+"&pId="+escape(pId)+"&collectionId="+collectionId; showLoading('rootcontainer'); simplePost(url,"reloadBodyAfterDelete(common_request)"); } } else { alert("Please select an item to delete."); } } document.write(""); document.write(""); //To Edit selected items var receivingUnderProcess = false; var total_to_edit; var uAgent = navigator.userAgent; function edit_items(Show,Query,ResultContainer,paginationAreaId,ApplyTo) { var total_selected_objs = document.getElementsByName("selected_obj[]"); total_to_edit = new Array(); for(i=0;i0) { layerOn('copy_menu'+position); layerOn('menu_background_b'+position); cpmv_removeFilterProjects('copy',position); } else { alert("Please select an item to copy."); } } function move_items(position) { var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_delete = new Array(); for(i=0;i0) { layerOn('move_menu'+position); layerOn('menu_background_a'+position); cpmv_removeFilterProjects('move',position); } else { alert("Please select an item to move."); } } //AJAX CALL var currentItem = 0; var DisplayTagArr = new Array(); function receive_Edit_Datas(Show,Query,ResultContainer,paginationAreaId,ApplyTo,Ids) { DisplayTagArr = new Array(); layerOn(Show); if(ResultContainer!="") document.getElementById(ResultContainer).innerHTML = ""; var ie=document.all; var request=ie?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var url=base_Url+"/editobjects.do?query="+Query+"&query_val="+getValuesForGivenIds(Ids); request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { var headers = request.responseXML.getElementsByTagName('displaynames'); for(i=0;iSelect Tags from a Taxonomy:

"; var taxonomyArr = new Array(); //alert(request.responseXML.getElementsByTagName('displaynames')); var headers = request.responseXML.getElementsByTagName('displaynames'); //alert(headers.length+","+headers); for(i=0;i0) taxonomyArr[taxonomyArr.length] = request.responseXML.getElementsByTagName(temp[i]); //alert(request.responseXML.getElementsByTagName(temp[i])) } //alert(taxonomyArr.length+","+taxonomyArr); if(taxonomyArr.length==0) { document.getElementById(setTax).innerHTML = "

No taxonomy is linked to this site.

"; document.getElementById(taxSel).style.display = 'none'; return; } var taxonomy_selection="

Select a Taxonomy: "+ ""+taxonomyArr[2].item(i).firstChild.nodeValue+"

"; } else{ //alert("u r in linkedWith else loop"+i+" times"); taxonomyInnerContent += "

"+taxonomyArr[2].item(i).firstChild.nodeValue+"

"; } if(tempCount>5 || lastId!=parseInt(taxonomyArr[1].item(i+1).firstChild.nodeValue)) { //alert("u r in tempCount loop"+i+" times"); taxonomyInnerContent += ""; tempCount = 0; newTd = true; } if(lastId!=parseInt(taxonomyArr[1].item(i+1).firstChild.nodeValue)) { //alert("u r in last if loop"+i+" times"); taxonomyInnerContent += ""; tempCount = 0; } } }catch(e){taxonomyInnerContent += ""; } taxonomy_selection+="

"; taxonomyInnerContent += ""; //alert(taxonomy_selection); document.getElementById(taxSel).style.display = 'block'; document.getElementById(taxSel).innerHTML=taxonomy_selection; document.getElementById(containerName).innerHTML = taxonomyInnerContent; contName = containerName; } var contName; var selectedValue=""; function selectionOn(selectedvalue,window) { selectedValue=selectedvalue; if(selectedValue=="none") { document.getElementById(contName).style.display = "none"; }else { document.getElementById(contName).style.display = "block"; document.getElementById(selectedValue+'_seltr1'+window).style.display=''; document.getElementById(selectedValue+'_seltr2'+window).style.display=''; } selectionOff(window); } function selectionOff(window) { for(var t=0;t0 && paginationAreaId!="") { both = true; prevHTML = "Previous"; //document.getElementById(PrevId).style.visibility = "visible"; //document.getElementById(PrevId).href = "javascript:manageeditpagination('"+(parseInt(pageNo)-1)+"','"+ResultContainer+"','"+PrevId+"','"+NextId+"','"+ApplyTo+"')"; } else if(paginationAreaId!="") { both = false; prevHTML = "Previous"; //document.getElementById(PrevId).style.visibility = "hidden"; } if( paginationAreaId!="" && pageNo<(total_to_edit.length-1)) { if(both) both = true; nxtHTML = "Next"; //document.getElementById(NextId).style.visibility = "visible"; //document.getElementById(NextId).href = "javascript:manageeditpagination('"+(parseInt(pageNo)+1)+"','"+ResultContainer+"','"+PrevId+"','"+NextId+"','"+ApplyTo+"')"; } else if(paginationAreaId!="") { both = false; nxtHTML = "Next"; //document.getElementById(NextId).style.visibility = "hidden"; } try{ if(both) { finalHTML = prevHTML+""+nxtHTML }else{ finalHTML = prevHTML+""+nxtHTML; } document.getElementById(paginationAreaId).innerHTML = finalHTML; }catch(e){} var elementsIds = Split_into_Array(ApplyTo,","); var tt; for(i=0;i255)&& (str.charCodeAt(j)<7680)) { strTest +="%u0"+str.charCodeAt(j).toString(16).toUpperCase(); } else { strTest +="%u"+str.charCodeAt(j).toString(16).toUpperCase(); } } return strTest; } function handleSpecialChars(input){ input = input.replace(/%/g,"%25"); //input = input.replace(/\$/gi,"%24"); input = input.replace(/&/g,"%26"); input = input.replace(/\?/gi,"%3F"); input = input.replace(/`/gi,"%60"); input = input.replace(/~/g,"%7E"); input = input.replace(/!/g,"%21"); input = input.replace(/#/g,"%23"); input = input.replace(/\^/g,"%5E"); input = input.replace(/\(/g,"%28"); input = input.replace(/\)/g,"%29"); return input; } function getValuesForGivenIds(ids) { //alert(ids); var result = ""; var testStr = ""; var fullStr = ""; var fieldsArray = Split_into_Array(ids,","); for(i=0;i"); testStr += escape(""); } } return result; } function Split_into_Array(input,seperator) { var temp = new Array(); while(input.indexOf(seperator)!=-1) { temp[temp.length] = input.substring(0,input.indexOf(seperator)); input = input.substring(input.indexOf(seperator)+1,input.length); } temp[temp.length] = input; return temp; } /* End of Save Code Functionalities ..... */ function copy_item(which) { var sy=document.getElementById('start_yyyy').value; var sd=document.getElementById('start_dd').value; var sm=document.getElementById('start_mm').value; var em=document.getElementById('end_mm').value; var ed=document.getElementById('end_dd').value; var ey=document.getElementById('end_yyyy').value; var site=document.getElementById('channelSite').value; receive_copy_items(sy,sd,sm,em,ed,ey,site,"asst",which); } function receive_copy_items(syear,sdate,smonth,emonth,edate,eyear,siteId,asset,which) //function receive_copy_items(syear,sdate,smonth,emonth,edate,eyear) { var objIds = 0; var captions; document.getElementById('tags_result_container').innerHTML = ""; var ie=document.all; var request=ie?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var url=base_Url+"/searchProject_p2.do?ajax=Ajax&start_yyyy="+syear+"&start_mm="+smonth+"&start_dd="+sdate+"&end_yyyy="+eyear+"&end_mm="+emonth+"&end_dd="+edate+"&assetType="+asset+"&site="+siteId+""; request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { objIds = request.responseXML.getElementsByTagName('objectId'); captions = request.responseXML.getElementsByTagName('objectCaption'); var inner_Text = ""; //alert(objIds.item(0).firstChild.nodeValue); for(i=0;i"+ ""+ ""; } inner_Text += "

"+captions.item(i).firstChild.nodeValue+"

"; document.getElementById('pckle_whitebackground').innerHTML = inner_Text; document.getElementById('pckle_whitebackground0').innerHTML = inner_Text; } else if(request.status==500) alert("You found an opportunity for improvement! Please try again later"); else alert("There appears to be a connectivity problem. Please check your internet connection and try again."); } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(''); } function highlightRow(el, color) { color=el.checked?color:''; while (el.tagName.toUpperCase() != 'TR' && el != null) el = el.parentNode; if (el) el.style.backgroundColor = color; } function check_uncheck_all(obj,param) { if(param==true){ obj.checked = true; }else if(param==false){ obj.checked = false; } var objCheck = obj.checked; if(objCheck ) { var total_selected_objs = document.getElementsByName("selected_obj[]"); for(i=0;i0) { if(which=="copy"){ var url = "/copyobjects.do?"+parameters; showLoading('rootcontainer'); simplePost(url,"reloadBody()"); } else { var url = "/moveobjects.do?"+parameters; showLoading('rootcontainer'); simplePost(url,"reloadBody()"); } } else alert("Nothing has been selected."); } function change_status(statusId,objectType) { var collectionId=0; if(getParameter("collectionId")){ collectionId = getParameter("collectionId"); //alert(collectionId); } var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_change = new Array(); for(i=0;i0) { var url = "changestatusaction.do?obid="+total_to_change+"&obstatl="+statusId+"&obtype="+objectType+"&collectionId="+collectionId; simplePost(url,"reloadBodyAfterChangeStatus(common_request)"); } else { alert("Please select an item to change."); } } function change_status2(position) { var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_change = new Array(); for(i=0;i0) { layerOn('status'+position); layerOn('menu_background_a'+position); } else { alert("Please select an item to change."); } } function trim(str){ return str.replace(/^\s*|\s*$/g,'')} /* Collection Body Javascript Methods Starts here .... */ /*function get_page(obj){ var page_no = obj.options[obj.selectedIndex].value; document.getElementById("pageNumber").value = page_no; document.getElementById("pageablebody").submit(); } function sort_column(sort_by){ document.getElementById("sortBy").value = sort_by; document.getElementById("sortOrder").value =1; document.getElementById("collectionsbody").submit(); } function toggle_order(){ if(document.getElementById("sortOrder").value == 1) { document.getElementById("sortOrder").value =2; } else { document.getElementById("sortOrder").value =1; } document.getElementById("collectionsbody").submit(); }*/ function highlightRow(el, color) { color=el.checked?color:''; while (el.tagName.toUpperCase() != 'TR' && el != null) el = el.parentNode; if (el) el.style.backgroundColor = color; } function checkrow(e,name){ document.getElementById(name).checked = (document.getElementById(name).checked ? false : true); highlightRow(document.getElementById(name), '#D2FDB7'); } function rolling(inTherow,inTherow2,inColor) { var a = Split_into_Array(inTherow,"_"); try { if(document.getElementById("selected_obj_"+a[1]).checked) return; document.getElementById(inTherow).style.backgroundColor = inColor; document.getElementById(inTherow2).style.backgroundColor = inColor; }catch(e){} } function rollingSingleRow(inTherow,inColor) { var a = Split_into_Array(inTherow,"_"); try { if(document.getElementById("SetSelected_"+a[1]).checked) return; document.getElementById(inTherow).style.backgroundColor = inColor; }catch(e){} } function submitCollection(userId,siteId,parentId,listIndex,userName){ var caption = ''; caption = document.getElementById('new_collection_caption').value; var tags = document.getElementById('new_collection_tags').value; var desc = document.getElementById('new_collection_description').value; var collectionstatus=document.getElementById('select__collection_object_state').value; //alert("collectionstatus : :"+collectionstatus); if(document.getElementById('new_collection_caption').value=='') { alert('Please Enter Title.'); document.getElementById('new_collection_caption').focus(); } else { // AJAX CALL var request=document.all?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var url="createCollection_p2.do?userDisplayName="+escape(userName); //var params = 'caption=' +escape(formatStringSpecialChars(caption))+ '&tags=' +tags+ '&desc=' +escape(formatStringSpecialChars(desc))+ '&userId='+userId+'&siteId='+siteId+'&parentId='+parentId+"&userEmail="+userName+"&objectStatus=2"; var params = 'caption=' +handleSpecialChars(formatStringSpecialChars(caption))+ '&tags=' +tags+ '&desc=' +handleSpecialChars(formatStringSpecialChars(desc))+ '&userId='+userId+'&siteId='+siteId+'&parentId='+parentId+"&userEmail="+userName+"&objectStatus="+collectionstatus; request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { //alert("Collectionidupload :"+request.responseText); document.getElementById('objectId').value = trim(request.responseText); document.getElementById('uploadedbycollectionid').value = trim(request.responseText); document.getElementById("next_collection_url").value= 'a1aCollection_p2.do?collectionId=' +escape(request.responseText)+ '&listIndex='+escape(listIndex); document.getElementById('uploadCaption_lbl').innerHTML = caption; if( document.getElementById("hid_upload_tags") ) document.getElementById("hid_upload_tags").value = tags; if( document.getElementById("hid_upload_description") ) document.getElementById("hid_upload_description").value = desc; displayOn('newcollection2'); displayOff('newcollection'); layerOn('collection_next'); //list index needs to be get from request Attribute. .... } else alert(request.status); } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(params); // END OF AJAX CALL document.getElementById('new_collection_caption').value = ''; document.getElementById('new_collection_tags').value = ''; document.getElementById('new_collection_description').value = ''; displayOff('newcollection'); displayOn('newcollection2'); } } function toggle_nextPage(radio_button){ if(radio_button==0){ document.getElementById("collection_next").href = "javascript:new_continue('upload');receive_upload_id();"; } else { document.getElementById("collection_next").href = "javascript:new_continue('reload');reloadBodyWithPagination()"; } } //checkallandclearall is test in nitro function layerOn(menuID) { if (document.getElementById) { document.getElementById(menuID).style.visibility = 'visible'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'visible'; } else if (document.all) { document.all[menuID].style.visibility = 'visible'; } } function layerOff(menuID) { try{ if (document.getElementById) { document.getElementById(menuID).style.visibility = 'hidden'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'hidden'; } else if (document.all) { document.all[menuID].style.visibility = 'hidden'; } }catch(e){} } function CheckandClear(startIndex,endIndex){ var k = 0; temp = document.test.elements.length ; for (i=startIndex; i <= endIndex; i++){ if(checkall.checked == 1) { document.test.elements[k].checked = 1; highlightRow(document.getElementById("SetSelected_"+i),'#D2FDB7'); } else { document.test.elements[k].checked = 0; highlightRow(document.getElementById("SetSelected_"+i),'#FFFFFF'); } k++; } } function CheckAllmails(startIndex,endIndex) { var k = 0; for (var i=startIndex;i<=endIndex;i++) { var e=document.test.elements[k]; e.checked = true; document.getElementById("checkall").checked = true; highlightRow(document.getElementById("SetSelected_"+i),'#D2FDB7'); k++; } } function ClearAllmails(startIndex,endIndex) { var k = 0; for (var i=startIndex;i<=endIndex;i++) { var e=document.test.elements[k]; e.checked = false; document.getElementById("checkall").checked = false; highlightRow(document.getElementById("SetSelected_"+i),'#FFFFFF'); k++; } } /* Collection Body Javascript Methods Ends Here .... */ /* Comments Body Javascript Methods Starts Here ..... */ /*function get_page(obj){ var page_no = obj.options[obj.selectedIndex].value; document.getElementById("pageNumber").value = page_no; document.getElementById("photovideobody").submit(); } function sort_column(sort_by){ document.getElementById("sortBy").value = sort_by; document.getElementById("sortOrder").value =1; document.getElementById("photovideobody").submit(); } function toggle_order(){ if(document.getElementById("sortOrder").value == 1) { document.getElementById("sortOrder").value =2; } else { document.getElementById("sortOrder").value =1; } document.getElementById("photovideobody").submit(); }*/ /* Commnets Body Javascript Methods Ends Here ..... */ /* PhotoVideo Body Javascript Methods Starts Here ..... */ /* function get_page(obj){ var page_no = obj.options[obj.selectedIndex].value; document.getElementById("pageNumber").value = page_no; document.getElementById("photovideobody").submit(); } function sort_column(sort_by){ document.getElementById("sortBy").value = sort_by; document.getElementById("sortOrder").value =1; document.getElementById("photovideobody").submit(); } function toggle_order(){ if(document.getElementById("sortOrder").value == 1) { document.getElementById("sortOrder").value =2; } else { document.getElementById("sortOrder").value =1; } document.getElementById("photovideobody").submit(); }*/ //checkallandclearall is test in nitro function layerOn(menuID,isCenter) { if (document.getElementById) { document.getElementById(menuID).style.visibility = 'visible'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'visible'; } else if (document.all) { document.all[menuID].style.visibility = 'visible'; } if(isCenter) { document.getElementById(menuID).style.position = "absolute"; var obj_width = screen.Width/2 - (document.getElementById(menuID).offsetWidth/2); var obj_height = screen.Height/2 - (document.getElementById(menuID).offsetHeight/2); //alert("Object Left :"+obj_width+" ::::: Screen Width : "+screen.Width); if(obj_width>screen.Width) obj_width = screen.Width - (document.getElementById(menuID).offsetWidth/2); if(obj_height>screen.Height) obj_height = screen.Height - (document.getElementById(menuID).offsetHeight/2); document.getElementById(menuID).style.left = obj_width; document.getElementById(menuID).style.top = obj_height; } } function displayOn(objId,isCenter){ if(document.getElementById(objId)){ document.getElementById(objId).style.display = "block"; } if(isCenter) { var obj_width = screen.Width; var obj_height = screen.Height; if(document.getElementById(objId)){ document.getElementById(objId).style.left = obj_width/2 - (document.getElementById(objId).offsetWidth/2); document.getElementById(objId).style.top = obj_height/2 - (document.getElementById(objId).offsetHeight/2); } } } function displayOff(objId){ try{ if(document.getElementById(objId)){ document.getElementById(objId).style.display = "none"; } }catch(e){} } function showItAndPlaceIt(objId,obj) { displayOn(objId); setPosition(obj,document.getElementById(objId)); } function setPosition(fr_om,t_o) { var l = findPosX(fr_om) - (t_o.offsetWidth/2); var t = findPosY(fr_om)- (t_o.offsetHeight/2); if(fr_om.id=="downDesc"){ t_o.style.left = findPosX(fr_om); t_o.style.top = findPosY(fr_om); return; } //if the left position is more than the screen resolution if((l+t_o.offsetWidth)>screen.width) l = screen.width - t_o.offsetWidth-30; if(l<0) l =0; if((t+t_o.offsetHeight)>screen.height) t = screen.width - t_o.offsetHeight-30; if(t<0) t = 0; if(fr_om.id=="uptxt"){ l = findPosX(document.getElementById('topSelectedDiv')); //l = l-330; if(ie) t = t-15; else t = t-5; } t_o.style.left = l; t_o.style.top = t; } function layerOff(menuID) { try{ if (document.getElementById) { document.getElementById(menuID).style.visibility = 'hidden'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'hidden'; } else if (document.all) { document.all[menuID].style.visibility = 'hidden'; } }catch(e){} } function CheckandClear(startIndex,endIndex){ var k = 0; temp = document.test.elements.length ; for (i=startIndex; i <= endIndex; i++){ if(checkall.checked == 1) { document.test.elements[k].checked = 1; highlightRow(document.getElementById("SetSelected_0"+i),'#D2FDB7'); } else { document.test.elements[k].checked = 0; highlightRow(document.getElementById("SetSelected_0"+i),'#FFFFFF'); } k++; } } function CheckAllmails(startIndex,endIndex) { var k = 0; for (var i=startIndex;i<=endIndex;i++) { var e=document.test.elements[k]; e.checked = true; document.getElementById("checkall").checked = true; highlightRow(document.getElementById("SetSelected_"+i),'#D2FDB7'); k++; } } function ClearAllmails(startIndex,endIndex) { var k = 0; for (var i=startIndex;i<=endIndex;i++) { var e=document.test.elements[k]; e.checked = false; document.getElementById("checkall").checked = false; highlightRow(document.getElementById("SetSelected_"+i),'#FFFFFF'); k++; } } var last_object ; function highlightRow(el, color) { color=el.checked?color:''; while (el.tagName.toUpperCase() != 'TR' && el != null) el = el.parentNode; if (el) el.style.backgroundColor = color; } function checkrow(e,name){ document.getElementById(name).checked = (document.getElementById(name).checked ? false : true); highlightRow(document.getElementById(name), '#D2FDB7'); } function newlabel() { if (document.getElementById("eaccess").value == "Turned Off") { document.getElementById("eaccess").value = ""; document.getElementById("eaccess").disabled = "false"; document.getElementById("ch").disabled = "false"; }else{ document.getElementById("eaccess").value = "Turned Off"; document.getElementById("eaccess").disabled = "true"; document.getElementById("ch").enable; } } function layerOnOff(layerName, layerState) { if (layerState == "on") { if (document.getElementById) { document.getElementById(layerName).style.visibility = 'visible'; } else if (document.layers && document.layers[layerName]) { document.layers[layerName].visibility = 'visible'; } else if (document.all) { document.all[layerName].style.visibility = 'visible'; } } else { if (document.getElementById) { document.getElementById(layerName).style.visibility = 'hidden'; } else if (document.layers && document.layers[layerName]) { document.layers[layerName].visibility = 'hidden'; } else if (document.all) { document.all[layerName].style.visibility = 'hidden'; } } } function buttonchange(inImage, inLocation) { document.getElementById(inLocation).src = inImage; } //--> function insertAtCursor(inTextField, inTextToAd) { //IE var inString = inTextField.value; var intIndexOfMatch = inString.indexOf(inTextToAd); if (intIndexOfMatch >= 0) { while (intIndexOfMatch != -1) { inString = inString.replace(inTextToAd, ""); intIndexOfMatch = inString.indexOf(inTextToAd); } inTextField.value = inString; } else if (document.selection) { inTextField.focus(); sel = document.selection.createRange(); sel.text = inTextToAd; } //FF else if (inTextField.selectionStart || inTextField.selectionStart == 0) { var startPos = inTextField.selectionStart; var endPos = inTextField.selectionEnd; inTextField.value = inTextField.value.substring(0, startPos) + inTextToAd + inTextField.value.substring(endPos, inTextField.value.length); } else { inTextField.value += inTextToAd; } } /* PhotoVideo Body Javascript Mthods Ends Here ..... */ function rotate_objects_a1(rotate_direction) { var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_rotate = new Array(); var videoStatus=0; for(i=0;i0 ) { //var url = "/rotateobject_p2.do?odl="+total_to_rotate+"&direction="+rotate_direction+"&loct_return="+escape(document.location+""); var url = "/rotateobject_p2.do?odl="+total_to_rotate+"&direction="+rotate_direction; showLoading('rootcontainer'); simplePost(url,"reloadBody()"); } else { alert("Please select an item to rotate."); } } function rotate_objects(object_id,rotate_direction) { //showLoading('img_showing_now'); showLoading('image_container'); //document.getElementById('imgSpinning').style.display = "block"; var url = "/rotateobject_p2.do?odl="+object_id+"&direction="+rotate_direction; simplePost(url,"A3ReloadPhoto()"); } function rotate_objects_widget(object_id,rotate_direction,objSubType,purgeId) { //showLoading(fromObjId); if(objSubType=="VIDEO" || objSubType=="video"){ alert("Videos can't be rotated."); return; } var realUrl = document.getElementById("image_"+object_id).src; document.getElementById("image_"+object_id).src = document.getElementById('loading_image').src; var url = etsBaseUrl+"/rotateobject_p2.do?odl="+object_id+"&direction="+rotate_direction+"&purgeId="+purgeId+"&objType="+objSubType; simplePost(url,"emptyMethod('"+object_id+"','"+escape(realUrl)+"')"); } function emptyMethod(objId,realImageUrl){ document.getElementById("image_"+objId).src = unescape(realImageUrl)+"?"+new Date(); } function A3ReloadPhoto() { swithWithImageSize(lastval); } /* ..... New Upload Code for all pages ....*/ var val = ""; var currentCount = 0; var uploadedCount = 0; var ajaxCount = 0; var currentStatus = "Pickle has finished uploading your files."; function getBarOld(done,total,imageUrl) { //alert('done :'+done+', total'+total+', uploadedCount'+uploadedCount); done=done.replace('Processing ',''); if (uploadedCount==0) return ""; remainingBox=""; if (done=="P" || done=="F" || parseInt(done)==parseInt(total)) { remainingPercentage = 0; donePercentage = 100; } else { remainingPercentage = parseInt((total-done)/total*100); donePercentage = parseInt(100-remainingPercentage); remainingBox = "
" ; } //document.getElementById('alertText').innerHTML = "Done :"+ done+", Total :"+total; if(((uploadDone && !processingStarts) || done=="P") && isCompleted>1){ remainingBox = "
" ; donePercentage = 0; //uploadDone=false; processingStarts=true; } //alert('remainingPercentage :'+remainingPercentage+', donePercentage'+donePercentage); bar="
"+remainingBox +"
"; return bar; } function getBar(done,total,imageUrl) { //alert('done :'+done+', total'+total+', uploadedCount'+uploadedCount); done=done.replace('Processing ',''); if (uploadedCount==0) return ""; remainingBox=""; if (done=="P" || done=="F" || parseInt(done)==parseInt(total)) { remainingPercentage = 0; donePercentage = 100; } else { remainingPercentage = parseInt((total-done)/total*100); donePercentage = parseInt(100-remainingPercentage); remainingBox = "
" ; } //document.getElementById('alertText').innerHTML = "Done :"+ done+", Total :"+total; if(((uploadDone && !processingStarts) || done=="P") && isCompleted>1){ remainingBox = "
" ; remainingPercentage = 100; donePercentage = 0; //uploadDone=false; processingStarts=true; } //alert('remainingPercentage :'+remainingPercentage+', donePercentage'+donePercentage); //bar="
"+remainingBox +"
"; bar="
"+remainingBox +"
"; //newdiv.style.width = "100%"; if(uplProcessStatus==false){ donePercentage = uplPercentage; remainingPercentage = parseInt(uplTotal)-parseInt(uplPercentage); if( document.getElementById("test") ){ document.getElementById("test").innerHTML = "Latest Done :"+donePercentage+", Remain :"+remainingPercentage; } } if(newUploadLayer){ if( imageUrl !='' ){ if(parseInt(donePercentage)>0){ var bImg = document.getElementById('proS-done-div').style.backgroundImage; if(trim(escape(bImg))=="") document.getElementById('proS-done-div').style.backgroundImage="url('"+base_Url+imageUrl+"')"; }else{ document.getElementById('proS-done-div').style.backgroundImage = ""; //alert("backgroundImage :"+document.getElementById('proS-done-div').style.backgroundImage); } } document.getElementById("proS-done-div").style.width = donePercentage+"%"; document.getElementById("proS-done-img").width = donePercentage+"%"; document.getElementById("proS-remain-div").style.width = remainingPercentage+"%"; document.getElementById("proS-remain-img").width = remainingPercentage+"%"; if(trim(remainingBox)==""){ displayOff('proS-remain-div'); } } return bar; } var uploadstatusUrl = ""; var alreadyInQueue = false; function checkStatus(val) { if(alreadyInQueue) return; alreadyInQueue = true; if(isCancel==true) { return false; } uploadstatusUrl = document.getElementById('uploadstatusUrl').value; var browLoca = document.location+""; if(browLoca.indexOf(":80/") == -1){ uploadstatusUrl = uploadstatusUrl.replace(":80/","/"); } if(val=="" || val==undefined){ uploadstatusUrl += "=0&ajaxCount=0" } else{ if(document.getElementById("upload_file_count")){ uploadstatusUrl += "="+document.getElementById("upload_file_count").value+"&"+val; }else{ uploadstatusUrl += val; } } if( uploadDone==true){ uploadstatusUrl = uploadstatusUrl.replace( "step=upload","step=processing" ); } //alert( uploadstatusUrl ); //document.getElementById('alertText').innerHTML = uploadstatusUrl; simplePost(uploadstatusUrl,"reDrawProegressBar(common_request,"+val+")"); } var notsmell = false; var uploadDone = false; var processingStarts = false; var isCompleted = 0; var isCancel = false; var iFrameId = ""; var oldStatus = ""; var uplProcessStatus = false; var uplPercentage = 0; var uplTotal = 100; var remainingPercentage = 100; var donePercentage = 0; var isPhotoVideo = false; function reDrawProegressBar(request,isWidget) { if(document.getElementById("ispv")){ if(document.getElementById("ispv").value == "1"){ isPhotoVideo = true; } } alreadyInQueue = false; var trClassName = "copy12_noul"; if(uploadFromWidget){ trClassName = "copy12_noul"; } if(notsmell){return;}; //alert( request.responseText); //document.getElementById('alertText').innerHTML = request.responseText; var responseArray = request.responseText.split(";"); currentCount = responseArray[0]; uploadedCount = responseArray[1]; currentStatus = responseArray[2]; if(isWidget){ currentStatus = currentStatus.replace( adminBaseUrl,base_Url); } if( currentCount=='P' ){ uploadDone = true; } if(currentCount=='null' && currentCount!='F'){ var subTextVal = currentStatus; var ofIndex = trim(subTextVal).indexOf("of"); if(ofIndex!=-1){ currentCount = subTextVal.substring(0,ofIndex); } } currentUploadPerc = responseArray[3]; if(currentUploadPerc==undefined){ uplProcessStatus = true; remainingPercentage = 100; donePercentage = 0; }else{ uplPercentage = currentUploadPerc; } val = "="+currentCount+"&ajaxCount="+(new Date()).getTime(); if (currentCount==0 && currentStatus.indexOf('uploaded') !=-1) { //currentStatus = "Processing 0 of "+uploadedCount+" files"; //currentStatus = "We're uploading your files now "; currentStatus = "

We're uploading your files now

"; } var uploadNewLayer = false; var uploadLimit = "5GB"; if(isWidget) uploadLimit = "250MB"; if(uploadedCount==0 && trim(currentStatus)=="Your upload failed to complete. Please try again."){ if(!isWidget){ currentStatus = "You cannot upload more than "+uploadLimit+".
"; currentStatus += "Please select under "+uploadLimit+" and upload again."; currentStatus += "
"; }else{ //uploadNewLayer = true; currentStatus = "You can't upload more than 250 MB. Please reduce the size of your upload and try again."; //displayOn('cgp-id-page-itemsaved'); //document.getElementById('errorTextMsg').innerHTML = "You can't upload more than 100 MB. Please reduce the size of your upload and try again."; //clearProcessingStatus(); } } else if (uploadedCount==0) { //currentStatus = "
No files were uploaded. Please try again."; if(!isWidget){ currentStatus = "

Please select a file.

"; } } document.getElementById("processingStatus").style.display = 'block'; if(uploadFromWidget && document.getElementById('progressbarstatuscontrol')){ alignPageCenter('progressbarstatuscontrol'); } //alert('currentStatus :'+currentStatus); //var procstat = document.getElementById("processingStatus"); var processContent = ""; if(!isWidget){ var getProgressBarWidget = ""; if(((uploadDone && !processingStarts) || currentCount=="P")){ isCompleted++; } if(((uploadDone && !processingStarts) || currentCount=="P") && isCompleted>1){ currentStatus="Now optimizing the files you uploaded"; //getProgressBarWidget = "

"+getBar(currentCount,uploadedCount,'/skins/main/images/account/widget_upload_bar.gif')+"
Now optimizing the files you uploaded

"; uploadstatusUrl = uploadstatusUrl.replace( "step=upload","step=processing" ); } //getProgressBarWidget = getBar(currentCount,uploadedCount,'/skins/main/images/account/upload_bar.gif');//+"

"+currentStatus+"

"; getProgressBarWidget = getBar(currentCount,uploadedCount,'/skins/main/images/account/upload_bar.gif');//+"

"+currentStatus+"

"; if(currentStatus.indexOf("been uploaded")!=-1 && currentStatus.indexOf("upload/e_ani.gif")==-1 ){ currentStatus += ""; } if( escape(trim(oldStatus)) != escape(trim(currentStatus)) ){ try{ document.getElementById("proS-status").innerHTML = currentStatus; }catch(e){} oldStatus = currentStatus; } }else{ var getProgressBarWidget = ""; if(((uploadDone && !processingStarts) || currentCount=="P")){ isCompleted++; } if(((uploadDone && !processingStarts) || currentCount=="P") && isCompleted>1){ currentStatus="Now optimizing the files you uploaded"; //getProgressBarWidget = "
"+getBar(currentCount,uploadedCount,'/skins/main/images/account/widget_upload_bar.gif')+"
Now optimizing the files you uploaded

"; uploadstatusUrl = uploadstatusUrl.replace( "step=upload","step=processing" ); }else{ //getProgressBarWidget = "
"+getBar(currentCount,uploadedCount,'/skins/main/images/account/widget_upload_bar.gif')+"
"+currentStatus+"

"; } var projectSiteId = 2; if(document.getElementById("projectSiteId")){ projectSiteId = document.getElementById("projectSiteId").value; } if(parseInt(projectSiteId) == 2){ getProgressBarWidget = getBar(currentCount,uploadedCount,'/skins/main/images/account/widget_upload_bar.gif');//+"

"+currentStatus+"

"; }else if( parseInt(projectSiteId) == 4){ getProgressBarWidget = getBar(currentCount,uploadedCount,'/skins/main/images/diy/widget_upload_bar.gif');//+"

"+currentStatus+"

"; }else{ getProgressBarWidget = getBar(currentCount,uploadedCount,'');//+"

"+currentStatus+"

"; } if(currentStatus.indexOf("been uploaded")!=-1 && currentStatus.indexOf("upload/e_ani.gif")==-1 ){ currentStatus += ""; } if( escape(trim(oldStatus)) != escape(trim(currentStatus)) ){ try{ document.getElementById("proS-status").innerHTML = currentStatus; }catch(e){} oldStatus = currentStatus; } } /* getProgressBarWidget = getBar(currentCount,uploadedCount,'/skins/main/images/account/widget_upload_bar.gif')+"

"+currentStatus+"

"; document.getElementById("uploadStatusTD").innerHTML = ""; document.getElementById("uploadStatusTD").innerHTML = getProgressBarWidget; */ //old code document.getElementById("uploadStatusTD").appendChild(getProgressBarWidget); //} /* Exist admin code now admin and public pages use ths same popup if(!isWidget){ document.getElementById("uploadStatusBar").innerHTML = ""; var newdiv = document.createElement("div"); newdiv.setAttribute('id','processingStatus'); newdiv.setAttribute('align','center'); newdiv.style.width = "100%"; newdiv.className = "copy12_noul"; newdiv.style.zIndex = "40000"; newdiv.innerHTML = processContent; document.getElementById("uploadStatusBar").appendChild(newdiv); } */ /*if (currentCount!="F") { setTimeout('checkStatus()',1000); } else { updateUploadedObjects(); }*/ if(currentCount=="F") { alreadyInQueue = true; } if (currentCount!="F") { //setTimeout('checkStatus('+isWidget+')',1000); } else { //alert(isWidget); if(request.responseText.indexOf("
")!=-1) { notsmell = true; try{ //document.getElementById('canbutton').style.display = 'block'; }catch(e){} } else if(!isWidget){ if(uploadedCount==0 || trim(currentStatus)=="Your upload failed to complete. Please try again."){ try{ //document.getElementById('canbutton').style.display = 'block'; }catch(e){} }else{ updateUploadedObjects(); } }else{ if(document.getElementById('afterUpload')) { if(uploadedCount==0 || trim(currentStatus)=="Your upload failed to complete. Please try again."){ try{ //document.getElementById('canbutton').style.display = 'block'; }catch(e){} }else{ if(isPhotoVideo){ updatePhotoVideoMetaData(); }else{ // clear cookie if( document.getElementById('gProjectType') && document.getElementById('gProjectType').value=='8' ){ SNI.Community.Widgets.Delete_Cookie('USER_TITLE', '/', ''); SNI.Community.Widgets.Delete_Cookie('USER_DESC', '/', ''); SNI.Community.Widgets.Delete_Cookie('USER_TAGS', '/', ''); SNI.Community.Widgets.Delete_Cookie('USER_SPACE', '/', ''); delete_nour_preserveData(); } document.location = document.getElementById('afterUpload').value; } } //uploadStatusTD } else{ //alert('Inside Else After Upload'); if(uploadedCount==0 || trim(currentStatus)=="Your upload failed to complete. Please try again."){ try{ //document.getElementById('canbutton').style.display = 'block'; }catch(e){} }else{ document.location = base_Url+"/collectionafterupload.do?uid="+uploadId+"&wid="+document.getElementById('wid').value+"&cid="+document.getElementById('cid').value; alert( document.location ); } } } } setTimeout('checkStatus('+isWidget+')',1000); } function clearProcessingStatus() { if(uploadFromWidget){ isCancel = true; displayOff('progressbarstatuscontrol'); displayOff('processingStatus'); displayOff('grey_background'); try{document.getElementById(iFrameId).document.execCommand('Stop');}catch(e){} try{document.getElementById(iFrameId).window.stop();}catch(e){} for( var i=0;i<11;i++){ try{ document.getElementsByName('up-search'+i)[0].value = ""; }catch(e){} } /* var img = ""; document.getElementsByTagName('head')[0].innerHTML += img; */ var delUrl = base_Url+"/deleteuploaded.do?uid="+uploadId; simplePost(delUrl,"afterUploadCancel()"); }else{ layerOn('grey_background'); displayOff('progressbarstatuscontrol'); displayOff('processingStatus'); receive_upload_id(); displayOn('a1_upload'); } } function afterUploadCancel(){ if( document.getElementById('gProjectType') && document.getElementById('gProjectType').value=='8' ){ // write the cookies var user_title = document.getElementById('caption').value; var user_description = document.getElementById('desc').value; var user_tags = document.getElementById('public_tags').value; var typeOfSpace = ''; if( document.getElementById('spacetypelist') ) typeOfSpace = document.getElementById('spacetypelist').value; SNI.Community.Widgets.Set_Cookie( "USER_TITLE",user_title, '365', '/', '', '' ); SNI.Community.Widgets.Set_Cookie( "USER_DESC",user_description, '365', '/', '', '' ); SNI.Community.Widgets.Set_Cookie( "USER_TAGS",user_tags, '365', '/', '', '' ); SNI.Community.Widgets.Set_Cookie( "USER_SPACE",typeOfSpace, '365', '/', '', '' ); preserverNoURUserInputs(); var a = document.location + ""; if(a.indexOf("#")!=-1) a = a.substring(0,a.indexOf("#")); if( a.indexOf("iscancel")==-1 ) document.location = a+"?iscancel=true"; else document.location = a; } else{ var a = document.location + ""; if(a.indexOf("#")!=-1) a = a.substring(0,a.indexOf("#")); document.location = a; } } function preserverNoURUserInputs(){ // delete old and load again delete_nour_preserveData(); if( document.getElementById('userEmail_txt') && document.getElementById('userEmail_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "userEmail_txt",document.getElementById('userEmail_txt').value, '365', '/', '', '' ); if( document.getElementById('displayName_txt') && document.getElementById('displayName_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "displayName_txt",document.getElementById('displayName_txt').value, '365', '/', '', '' ); if( document.getElementById('firstName_txt') && document.getElementById('firstName_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "firstName_txt",document.getElementById('firstName_txt').value, '365', '/', '', '' ); if( document.getElementById('lastName_txt') && document.getElementById('lastName_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "lastName_txt",document.getElementById('lastName_txt').value, '365', '/', '', '' ); if( document.getElementById('streetAddress_txt') && document.getElementById('streetAddress_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "streetAddress_txt",document.getElementById('streetAddress_txt').value, '365', '/', '', '' ); if( document.getElementById('streetAddress2_txt') && document.getElementById('streetAddress2_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "streetAddress2_txt",document.getElementById('streetAddress2_txt').value, '365', '/', '', '' ); if( document.getElementById('city_txt') && document.getElementById('city_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "city_txt",document.getElementById('city_txt').value, '365', '/', '', '' ); if( document.getElementById('state_txt') && document.getElementById('state_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( "state_txt",document.getElementById('state_txt').value, '365', '/', '', '' ); if( document.getElementById('statelist') && document.getElementById('statelist').value !='' ) SNI.Community.Widgets.Set_Cookie( "statelist",document.getElementById('statelist').value, '365', '/', '', '' ); if( document.getElementById('country_txt') && document.getElementById('country_txt') !='' ) SNI.Community.Widgets.Set_Cookie( "country_txt",document.getElementById('country_txt').value, '365', '/', '', '' ); if( document.getElementById('countrylist') && document.getElementById('countrylist') !='' ) SNI.Community.Widgets.Set_Cookie( "countrylist",document.getElementById('countrylist').value, '365', '/', '', '' ); if( document.getElementById('zipCode_txt') && document.getElementById('zipCode_txt') !='' ) SNI.Community.Widgets.Set_Cookie( 'zipCode_txt',document.getElementById('zipCode_txt').value, '365', '/', '', '' ); if( document.getElementById('phone_txt') && document.getElementById('phone_txt') !='' ) SNI.Community.Widgets.Set_Cookie( 'phone_txt',document.getElementById('phone_txt').value, '365', '/', '', '' ); if( document.getElementById('phone2_txt') && document.getElementById('phone2_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'phone2_txt',document.getElementById('phone2_txt').value, '365', '/', '', '' ); if( document.getElementById('gender_txt') && document.getElementById('gender_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'gender_txt',document.getElementById('gender_txt').value, '365', '/', '', '' ); if( document.getElementById('genderlist') && document.getElementById('genderlist').value !='' ) SNI.Community.Widgets.Set_Cookie( 'genderlist',document.getElementById('genderlist').value, '365', '/', '', '' ); if( document.getElementById('aboutme_txt') && document.getElementById('aboutme_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'aboutme_txt',document.getElementById('aboutme_txt').value, '365', '/', '', '' ); if( document.getElementById('custom_txt') && document.getElementById('custom_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'custom_txt',document.getElementById('custom_txt').value, '365', '/', '', '' ); if( document.getElementById('custom2_txt') && document.getElementById('custom2_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'custom2_txt',document.getElementById('custom2_txt').value, '365', '/', '', '' ); // drop down fields if( document.getElementById('month_txt') && document.getElementById('month_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'month_txt',document.getElementById('month_txt').value, '365', '/', '', '' ); if( document.getElementById('monthlist') && document.getElementById('monthlist').value !='' ) SNI.Community.Widgets.Set_Cookie( 'monthlist',document.getElementById('monthlist').value, '365', '/', '', '' ); if( document.getElementById('date_txt') && document.getElementById('date_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'date_txt',document.getElementById('date_txt').value, '365', '/', '', '' ); if( document.getElementById('datelist') && document.getElementById('datelist').value !='' ) SNI.Community.Widgets.Set_Cookie( 'datelist',document.getElementById('datelist').value, '365', '/', '', '' ); if( document.getElementById('year_txt') && document.getElementById('year_txt').value !='' ) SNI.Community.Widgets.Set_Cookie( 'year_txt',document.getElementById('year_txt').value, '365', '/', '', '' ); if( document.getElementById('yearlist') && document.getElementById('yearlist').value !='' ) SNI.Community.Widgets.Set_Cookie( 'yearlist',document.getElementById('yearlist').value, '365', '/', '', '' ); var ids= ''; var nameArr = document.getElementsByTagName("input"); for( var i=0;i"; //alert( url ); simplePost(url,"doA2AfterUpload("+colId+")"); } function doA2AfterUpload(colId) { //var url= "/editsaveobjects.do?query=UPDATE_FEATURED_ITEM&query_val="+colId+""; //var name=prompt("doa2after",url) //simplePost(url,""); //var name1=prompt("url in doA2AfterUpload : "+url); //var url = base_Url+"/detailedEdit.do?uid="+document.getElementById('uid').value+"&pId="+getParameter("pId")+"&loc_return="+escape((document.location+"").replace(/&forceCache=true/g, ""));; //window.location = url; var objectType; var documentUrl=(document.location+"").replace(/&forceCache=true/g, ""); var url = base_Url+"/detailedEdit.do?uid="+document.getElementById('uid').value+"&pId="+getParameter("pId"); if ( document.getElementById('upload_taglist_coll')!=null ){ url += "&tags="+document.getElementById('upload_taglist_coll').value; } else if ( document.getElementById('upload_taglist')!=null ){ url += "&tags="+document.getElementById('upload_taglist').value; } url +="&collectionName="+document.getElementById('uploadCaption_lbl').innerHTML; if(document.getElementById('setObjectType'))//To display the relevant Tab in A1 Page { documentUrl=(document.location+"").replace(/&forceCache=true/g, ""); objectType=document.getElementById('setObjectType').value; if(documentUrl.indexOf("&ot")!=-1) { documentUrl = documentUrl.substring(0,documentUrl.indexOf("&ot")); } url +="&loc_return="+escape(documentUrl+"&ot="+objectType); }else { url +="&loc_return="+escape(documentUrl); } //url +="&loc_return="+escape((document.location+"").replace(/&forceCache=true/g, "")+"&ot=2"); //alert(url); //var name2=prompt("url in doA2AfterUpload+detailedEdit : "+url); window.location = url; } function edit_items(obj){ var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_edit = new Array(); for(i=0;i0) { var temp_url = document.location+""; if(temp_url.indexOf("?")!=-1) { temp_url = temp_url.substring(temp_url.indexOf("?")+1,temp_url.length); } var url = base_Url+"/detailedEdit.do?form=edittags&odl="+total_to_edit+"&"+temp_url+"&loc_return="+escape((document.location+"").replace(/&forceCache=true/g, ""));; //obj.href = url; window.location = url; } else{ alert("Please select an item to edit."); } } function collection_edit_items(obj){ var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_edit = new Array(); for(i=0;i0) { var temp_url = document.location+""; if(temp_url.indexOf("?")!=-1) { temp_url = temp_url.substring(temp_url.indexOf("?")+1,temp_url.length); } var url = base_Url+"/detailedEdit.do?form=edittags&page=collections&odl="+total_to_edit+"&"+temp_url+"&loc_return="+escape((document.location+"").replace(/&forceCache=true/g, ""));; //obj.href = url; window.location = url; } else{ alert("Please select an item to edit."); } } function cms_edit_items(obj){ var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_edit = new Array(); for(i=0;i0) { var temp_url = document.location+""; if(temp_url.indexOf("?")!=-1) { temp_url = temp_url.substring(temp_url.indexOf("?")+1,temp_url.length); } var url = base_Url+"/cmsEdit.do?odl="+total_to_edit+"&"+temp_url+"&loc_return="+escape((document.location+"").replace(/&forceCache=true/g, ""));; //obj.href = url; window.location = url; } else{ alert("Please select an item to edit."); } } function cancel_cms_edit(url) { url=base_Url+"/"+url; window.location=url; } function remove(this_value,from_text) { str = str.replace(/&forceCache=true/g, ""); } function save_edit_object( obj ){ var total_edit_objs = document.getElementsByName("save_edit_obj[]"); var total_to_edit = new Array(); for(i=0;i0 ) { //showLoading('detail_edit_container'); var url = base_Url + "/rotateobject_p2.do?odl="+total_to_rotate+"&direction="+rotate_direction+"&loc_return="+escape(document.location+""); //var url = base_Url + "/rotateobject_p2.do?odl="+total_to_rotate+"&direction="+rotate_direction; //obj.href=url; window.location = url; } else { alert("Please select an item to rotate."); } } function select_edit_all() { var total_selected_objs = document.getElementsByName("selected_obj[]"); for(i=0;i0) { if (document.getElementById) { document.getElementById(menuID).style.visibility = 'visible'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'visible'; } else if (document.all) { document.all[menuID].style.visibility = 'visible'; } currEditObj = "tag_selected"; if( document.getElementById('detailedEditcollectionFinalTags') !=null ){ document.getElementById('detailedEditcollectionFinalTags').value=""; } } else{ alert("Please select an item to tag."); } } function detail_edit_layerOn(menuID,obj){ currEditObj = document.getElementById(obj); currHidEditObj = document.getElementById("disabled_"+obj); if (document.getElementById) { document.getElementById(menuID).style.visibility = 'visible'; } else if (document.layers && document.layers[menuID]) { document.layers[menuID].visibility = 'visible'; } else if (document.all) { document.all[menuID].style.visibility = 'visible'; } // update the current value if( document.getElementById('detailedEditcollectionFinalTags') !=null ){ document.getElementById('detailedEditcollectionFinalTags').value=currEditObj.value; } } function detail_edit_apply_selected(){ if( currEditObj != null && currEditObj!="tag_selected"){ if( document.getElementById('detailedEditcollectionFinalTags') !=null ){ currEditObj.value = document.getElementById('detailedEditcollectionFinalTags').value; currHidEditObj.value = document.getElementById('detailedEditcollectionFinalTags').value; } currEditObj=null currHidEditObj = null; } else if( currEditObj=="tag_selected"){ var total_selected_objs = document.getElementsByName("selected_obj[]"); var total_to_edit = new Array(); for(i=0;i0) { var url = base_Url+"/savechangefeaturephoto.do?sdl="+total_to_save+"&collectionid="+collectionId+"&loc_return="+escape(locReturn); window.location.href=url; }else { alert("Please select an item."); } } function formatString(str) { str = str.replace(/%0A/g, "
"); str = str.replace(/%20/g, " "); str = unescape(str); return str; } //Formatting the string specially for MS Word function formatStringSpecialChars(str) { if(str.length>0) { str=ConvertSpecialChars(str); str=ConvertLatin2ToAsciiChars(str); } return str; } function ConvertSpecialChars(str) { if(str.length > 0){ str = str.replace(new RegExp(String.fromCharCode(8216),"g"),"'"); str = str.replace(new RegExp(String.fromCharCode(8217),"g"),"'"); str = str.replace(new RegExp(String.fromCharCode(8220),"g"),"\""); str = str.replace(new RegExp(String.fromCharCode(8221),"g"),"\""); return str; } } function ConvertLatin2ToAsciiChars(str) { str = str.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < str.length; n++) { var c = str.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 str; } /* function ConvertAsciiToLatin2Chars(eid, heid) { if(document.getElementById(heid) != undefined){ utftext = document.getElementById(heid).value; 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; } } document.getElementById(eid).innerHTML = string; } } */ function processHTMLLink (str) { var finalHTML = ""; var tt = str.split(" "); for(i=0;i"+tt[i]+""; }else { if(i!=0) finalHTML += " "; finalHTML += tt[i]; } } return finalHTML; } function performAfterPost(pos) { try{ var descText=""; //alert("you ar in postperform function"); //alert(pos); if(document.getElementById('objectcaptioncontainer')) document.getElementById('objectcaptioncontainer').innerHTML = formatString(document.getElementById('title_field'+pos).value); if(document.getElementById('labelId')) document.getElementById('labelId').innerHTML = formatString(document.getElementById('title_field'+pos).value); if(document.getElementById('colName')) document.getElementById('colName').innerHTML = formatString(document.getElementById('title_field'+pos).value); //document.getElementById('objectdesccriptioncontainer').innerHTML = formatString(escape(document.getElementById('desc_field').value)); if(document.getElementById('desc_field'+pos)) { descText=document.getElementById('desc_field'+pos).value; descText=replaceAll(descText,"\n","
") } //document.getElementById('objectdesccriptioncontainer').innerHTML = formatString(document.getElementById('desc_field').value); document.getElementById('objectdesccriptioncontainer').innerHTML = formatString(descText); if(document.getElementById('edittitle').style.visibility == "visible" && document.getElementById('edittitle').style.display != "block") layerOff('edittitle'); else displayOff('edittitle'); }catch(e){ //alert(e.message); } //displayOff('edittitle'); } function load_a3_page( urlParameter){ //alert("url:" + urlParameter ); var url = base_Url + "/" + urlParameter; if( document.getElementById('objectcaptioncontainer') != null ) //url += "&collection_name=" + escape(document.getElementById('objectcaptioncontainer').innerHTML); //url += "&collection_name=" + escape(document.getElementById('labelId').innerHTML); url += "&collection_name=" + document.getElementById('labelId').innerHTML; //alert( "url:" + url ); document.location.href = url; } function load_change_diaplay( obj, urlParameter){ if( document.getElementById("collectionId") !=null){ document.getElementById("collectionId").value = getParameter("collectionId"); } if( document.getElementById("loc_return") !=null){ document.getElementById("loc_return").value = document.location; } if( document.getElementById("pageNumber") !=null){ document.getElementById("pageNumber").value ="1"; } document.photovideobody.method="POST"; document.photovideobody.action="changeDisplayOrder.do?pId="+getParameter("pId")+"&listIndex="+getParameter("listIndex")+"&channelPno="+getParameter("channelPno"); document.photovideobody.submit(); } function openInNewWindow(url,title,wtype){ if(wtype == 1){ var table=document.getElementById('destChannelListTbody'); //alert( table.rows.length ); if( table.rows.length <=1 ) { alert("Please select at least one channel."); return; } } window.open(url,title); } function openWPPreviewWindow(url,title){ window.open(url,title); } function replaceAll(OldString,FindString,ReplaceString) { var SearchIndex = 0; var NewString = ""; while (OldString.indexOf(FindString,SearchIndex) != -1) { NewString += OldString.substring(SearchIndex,OldString.indexOf(FindString,SearchIndex)); NewString += ReplaceString; SearchIndex = (OldString.indexOf(FindString,SearchIndex) + FindString.length); } NewString += OldString.substring(SearchIndex,OldString.length); return NewString; } function moderation_change_status(baseUrl, objId,statusId,objectType,collectionId) { var ie=document.all; var request=ie?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var url= baseUrl+"/changestatusaction.do?obid="+objId+"&obstatl="+statusId+"&obtype="+objectType+"&collectionId="+collectionId; request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { var htmlContent = ""; if(trim(collectionId)=="0"){ htmlContent = "This comment is now archived."; if(trim(statusId)==2){ htmlContent = "This comment is now live."; } }else{ htmlContent = "This collection is now archived."; if(trim(statusId)==2){ htmlContent = "This collection is now live."; } } document.getElementById('processing').innerHTML = htmlContent; } else if(request.status==500) alert("You found an opportunity for improvement! Please try again later"); else alert("There appears to be a connectivity problem. Please check your internet connection and try again."); } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(''); } function moderation_deleteComments(baseUrl,commentIds,cObjId) { var ie=document.all; var request=ie?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var val = commentIds+""; var updateKey = commentIds ; var object_type = "CommentsDAO"; var url = baseUrl+"/editsaveobjects.do?query=COM_EDIT_DELETE_QUERY&query_val="+escape(val)+"&update_key="+escape(updateKey)+"&object_type="+object_type+"&ht="+cObjId; request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { document.getElementById('processing').innerHTML = "This comment has been deleted."; } else if(request.status==500) alert("You found an opportunity for improvement! Please try again later"); else alert("There appears to be a connectivity problem. Please check your internet connection."); } } request.open("POST",url,true); request.setRequestHeader("content-type","application/x-www-form-urlencoded"); request.send(''); } function a3change_status(total_to_change,statusText,statusId,objectType,collectionId) { var url = "changestatusaction.do?obid="+total_to_change+"&obstatl="+statusId+"&obtype="+objectType+"&collectionId="+collectionId; var callBack="reloadBodyForA3DeleteChangeStatus(common_request,'"+statusText+"');" simplePost(url,callBack); } function reloadBodyForA3DeleteChangeStatus(request,statusText) { /*var featureItemBoolean=request.responseXML.getElementsByTagName('isFeatureItem'); var deleteArr = new Array(); for(i=0;i"; } }*/ alert("The status has been changed to " +statusText+"."); document.getElementById('statusid').innerHTML= "Status: "+statusText+""; }