//var current_cell_start_date; var cmd_c_result_just_checked = false; function jdcm_hiliteRow () { cmd_c_result_just_checked = true; } /*function goSearchExpandEmail( t ) { parent.f_content.location = "ctv_content_search_expand_email.php?type=" + t; }*/ function jdcm_commandCenterResultClick (r, e) { top.f_video.f_video_bottom.player_loaded = false; e = e - 1; if (document.commandCenter.elements[e].checked != 1) { document.commandCenter.elements[e].checked=1; } else { document.commandCenter.elements[e].checked=0; } if (r.className == 'jdcm_resultsItemSelectClicked_new') { r.className='jdcm_resultsItemSelect_new'; if (cmd_c_result_just_checked) { document.commandCenter.elements[e].checked=0; cmd_c_result_just_checked = false; } } else { r.className='jdcm_resultsItemSelectClicked_new'; if (cmd_c_result_just_checked) { document.commandCenter.elements[e].checked=1; cmd_c_result_just_checked = false; } } } function openAutoEmailListWin() { var winProps = 'width=600,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes'; var php_session_id = ""; var user_session_id = ""; var url = top.f_content.ctvHostName + "ctv_win_auto_email_list.php" + "?php_session_id=" + php_session_id + "&user_session_id=" + user_session_id; top.autoEmailListWindow = window.open( url, 'autoEmailListWin', winProps ); top.autoEmailListWindow.focus(); } function replaceSubstring(inputString, fromString, toString) { // Goes through the inputString and replaces every occurrence of fromString with toString var temp = inputString; if (fromString == "") { return inputString; } if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation) while (temp.indexOf(fromString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(fromString)); var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length); temp = toTheLeft + toString + toTheRight; } } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop var midStrings = new Array("~", "`", "_", "^", "#"); var midStringLen = 1; var midString = ""; // Find a string that doesn't exist in the inputString to be used // as an "inbetween" string while (midString == "") { for (var i=0; i < midStrings.length; i++) { var tempMidString = ""; for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; } if (fromString.indexOf(tempMidString) == -1) { midString = tempMidString; i = midStrings.length + 1; } } } // Keep on going until we build an "inbetween" string that doesn't exist // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string while (temp.indexOf(fromString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(fromString)); var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length); temp = toTheLeft + midString + toTheRight; } // Next, replace the "inbetween" string with the "toString" while (temp.indexOf(midString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(midString)); var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length); temp = toTheLeft + toString + toTheRight; } } // Ends the check to see if the string being replaced is part of the replacement string or not return temp; // Send the updated string back to the user } // Ends the "replaceSubstring" function ///////getSel is used to calculate the begin time, duration time and call videoframe.php to show it. function getSel(selected,entire){ style = '
'; entire_length = entire.length; text_begin = Math.round(entire.indexOf(selected)*60/entire_length); text_end = Math.round((entire.indexOf(selected)+selected.length)*60/entire_length); text_duration = text_end - text_begin; //////High Light the selected text text_replacing = "" + selected + ""; text_replaced = selected; output = replaceSubstring(entire,text_replaced,text_replacing); //parent.parent.d1.location = 'videoframe.php?Begin_time='+text_begin+'&Duration_time='+text_duration; parent.begin_time_array[parent.begin_time_array.length] = text_begin; parent.duration_time_array[parent.duration_time_array.length] = text_duration; //parent.parent.d1.document.forms[0].selectedtext.value = begin_time_array[begin_time_array.length-1] +'*****' + duration_time_array[duration_time_array.length-1]; //parent.parent.d1.document.forms[0].selectedtext.value = begin_time_array.length +'*****' + duration_time_array.length; s1.innerHTML = output; /* //parent.parent.d1.document.forms[0].selectedtext.value = 'Begin time:'+text_begin+' End time:'+text_end; //text_replacing = "" + selected.replace(/\'/igm,'\\\'') + ""; // text_replaced = new RegExp(selected.replace(/\'/igm,'\\\'')); // output = entire.replace(text_replaced,text_replacing); // parent.d2.ir1.document.write(style+output+''); // parent.d2.ir1.s1.innerHTML = output; // parent.d2.ir1.document.open(); // parent.d2.ir1.document.close(); // var oNewDoc = parent.d2.ir1.document.open("text/html", "replace"); // oNewDoc.write(style+output+'