//fl1-50 var adminUser = 'WFTV'; var user = ''; var commentsList = ""; var ka_token = "ZAI9+G6LSQ3PE2+4cTwuqtLMHq/Wiqdh"; var orig_token = "ZAI9+G6LSQ3PE2+4cTwuqtLMHq/Wiqdh"; var ka_as = "6696"; var useAnchorJump =false; var allowFavorite=false; //search request: http://api.kickapps.com/rest/externalmedia/6696?t=ZAI9+G6LSQ3PE2+4cTwuqtLMHq/Wiqdh&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html var ka_mediaId = "1234"; var alertBadLoginMsg = "Login Failed. If you previously signed up for Slantly, you will need to create a new profile for WFTV.com's community before leaving a comment."; var timezoneAbbr ='EDT'; var timezoneOffset = -4; var g_commentsJSON; var firstRate = false; if(typeof(st)=='undefined'){ st=''; } if(typeof(tid)=='undefined'){ tid=''; } if(typeof(uid)=='undefined'){ uid=''; } if(typeof(isLogout)=='undefined'){ var isLogout=false; } function ka_checkKeyPress(e) { if(window.event){ if(window.event.keyCode==13){ login(); } } else { if(e.which==13){ login(); } } return true; } function checkLoginSiteSide(theJson) { if(theJson.status == "1"){ st = theJson.st; tid = theJson.tid; uid = theJson.userid; token = theJson.token; user = theJson.username; email = theJson.email; createCookie("6696username",user); createCookie("6696loggedIn",st+","+tid+","+uid+","+token+","+email,1); paintCommentAdd(); paintLoggedInBox(); manualCommentsRefresh(ka_token); } else { if (alertBadLoginMsg!=""){ alert(alertBadLoginMsg); } paintLoginBox(true); manualCommentsRefresh(ka_token); } } function ka_user_loggedInSiteSide(json){ if(json.isLoggedIn=="true"){ //alert("json is logged in:"+json.isLoggedIn); var u = json.username; var request = 'http://clientapps.kickapps.com/coxtv/login.php?u=' +u+'&p=SiteSide&remember_me=false&callback=checkLoginSiteSide&as=6696'; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag(); } else { manualCommentsRefresh(ka_token); } } function isUserLoggedInKASide(){ aObj = new JSONscriptRequest("http://my.wftv.com/kickapps/service/isUserLoggedIn.kickAction?callback=ka_user_loggedInSiteSide"); aObj.buildScriptTag(); aObj.addScriptTag(); } function refresh() { //var sURL = unescape(window.location.pathname); //window.location.replace( sURL ); if (useAnchorJump==true){ window.location.hash = "#COMMENTTOP"; } window.location.reload(true); } function isFavorite(){ if (allowFavorite==true){ var username = readCookie('6696'+'username'); if (username == null || username == '') { favoriteAdd = document.getElementById('ka_favorite_area'); favoriteAdd.innerHTML='Login to Favorite this article!'; } else { aObj = new JSONscriptRequest('http://clientapps.kickapps.com/coxtv/favoriteCheck.php?url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html&callback=isFavoriteMediaCheck&u='+username+'&as=6696' ); aObj.buildScriptTag(); aObj.addScriptTag(); } } } function isFavoriteMediaCheck(theJson){ favoriteAdd = document.getElementById('ka_favorite_area'); favoriteAdd.innerHTML=''; if(theJson.status=="1"){ if (theJson.isFavorite=="1"){ favoriteAdd.innerHTML = 'One of your favorites!(click here to remove as a favorite)'; } else { paintFavoriteAdd(); } } else { //error just assume not favorite paintFavoriteAdd(); } } function writeContainer() { var container = document.getElementById('comment_content_container'); container.innerHTML = '

WFTV.com

The following are comments from our users. This is not content created by WFTV.com.
By posting your comments you agree to accept the Terms of Use
Close

By using WFTV.com I agree to the Terms of Use and Privacy Policy


'; } var pageSize = 5; var currentAverage = 0; var currentVotes = 0; var commentAddHTML = ''; var favAddHTML = ''; var moderatedComments = false; function paintCommentAdd() { commentsAdd = document.getElementById('ka_orig_button'); commentsAdd.innerHTML = ''; if (readCookie('6696'+'username') == null || readCookie('6696'+'username') == '') { commentAddHTML = '
Add your comment:
Register or log in here:

'; commentsAdd.innerHTML=commentAddHTML; } else { commentAddHTML = '
Add your comment:
Register or log in here:

'; commentsAdd.innerHTML=commentAddHTML; } } function paintFavoriteAdd() { favoriteAdd = document.getElementById('ka_favorite_area'); favoriteAdd.innerHTML=''; if (readCookie('6696'+'username') == null || readCookie('6696'+'username') == '') { //Not logged in - not going to allow fav favAddHTML = 'Login to Favorite this Article!'; } else { favAddHTML = 'Add To Favorites'; } favoriteAdd.innerHTML=favAddHTML; } var aObj; function manualCommentsRefresh(localToken) { var origURL = encodeURIComponent("http://api.kickapps.com/rest/externalmedia/6696?t="+ka_token+"&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html&callback=gotSocData"); aObj = new JSONscriptRequest("http://clientapps.kickapps.com/coxtv/fetchData.php?d="+origURL ); aObj.buildScriptTag(); aObj.addScriptTag(); } function addedFavoriteArticle(json){ favoriteAdd = document.getElementById('ka_favorite_area'); favoriteAdd.innerHTML=''; if (json.status==1){ favoriteAdd.innerHTML = 'One of your favorites!(click here to remove as a favorite)'; } else { favoriteAdd.innerHTML='Sorry unable to add to favorites at this time.'; } } function removedFavoriteArticle(json){ favoriteAdd = document.getElementById('ka_favorite_area'); favoriteAdd.innerHTML=''; if (json.status==1){ favoriteAdd.innerHTML='Add To Favorites'; } else { favoriteAdd.innerHTML='Sorry unable to add to favorites at this time.'; } } function favoriteArticle(localToken){ aObj = new JSONscriptRequest("http://api.kickapps.com/rest/favorite/add/emedia/1234/6696?t="+localToken+"&callback=addedFavoriteArticle&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html" ); aObj.buildScriptTag(); aObj.addScriptTag(); //setTimeout("refresh()", 1000); } function removeFavoriteArticle(localToken){ aObj = new JSONscriptRequest("http://api.kickapps.com/rest/favorite/remove/emedia/1234/6696?t="+localToken+"&callback=removedFavoriteArticle&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html" ); aObj.buildScriptTag(); aObj.addScriptTag(); //setTimeout("refresh()", 1000); } function paintLoggedInBox() { loginHTML = "You are logged in as " + user + " logout"; document.getElementById('ka_login').innerHTML = loginHTML; } function paintLoginBox(isAfterFailure) { if (isAfterFailure == false) { loginHTML = "Register or log in here: "; } else { loginHTML = "Login failed, try again or register: "; } document.getElementById('ka_login').innerHTML = loginHTML; } function gotToken(json) { if (json.token == ""|| typeof(json.token)=='undefined') { if (alertBadLoginMsg!=""){ alert(alertBadLoginMsg); } paintLoginBox(true); } else { st = json.st; tid = json.tid; uid = json.userid; token = json.token; //alert("values:"+st+","+tid+","+uid+","+token); createCookie("6696loggedIn",st+","+tid+","+uid+","+token,1); //ka_token = json.token; createCookie('6696'+'username', user, 7); paintCommentAdd(); paintLoggedInBox(); manualCommentsRefresh(ka_token); } } //Aug 1 2008 02:44:00 GMT function parseDateGMT(timeobj){ var timesplit = timeobj.split(" "); var date = timesplit[0]; var month = timesplit[1]; var year = timesplit[2]; var hhmm = timesplit[3]; var hours = timesplit[3].split(":"); var hh = hours[0]; var mm = hours[1]; var ss = hours[2]; var TimezoneOffset = -3; // adjust for time zone var timetime = month+" "+date+", "+year+" "+hh+":"+mm+":"+ss+ " GMT"; var localTime = new Date(timetime); var offset = (localTime.getTimezoneOffset()+(timezoneOffset*60))*60000; var timeInMillis = localTime.getTime()+offset; localTime.setTime(timeInMillis); return localTime; } function GetMonth(intMonth){ var MonthArray = ["Jan", "Feb", "Mar","Apr", "May", "Jun","Jul", "Aug", "Sep","Oct", "Nov", "Dec"]; return MonthArray[intMonth]; } function get_month(timeobj){ var localTime = parseDateGMT(timeobj); var time = localTime; var curTime = GetMonth(time.getMonth()); return curTime; } function get_year(timeobj){ var localTime = parseDateGMT(timeobj); var time = localTime; var curTime = time.getFullYear(); return curTime; } function get_day(timeobj){ var localTime = parseDateGMT(timeobj); var time = localTime; var date = time.getDate(); return date; } function get_time(timeobj){ var localTime = parseDateGMT(timeobj); var time = localTime; var hour = time.getHours() ; var minute = time.getMinutes(); var secs = time.getSeconds(); var curTime = ((hour > 12) ? hour - 12 : hour); if(hour==0) { curTime = "12"; } curTime += ((minute < 10) ? ":0" : ":") + minute; //curTime += ((secs < 10) ? ":0" : ":") + secs; curTime += (hour >= 12) ? "pm" : "am"; return curTime; } function paginationBarNew(pageNum) { var bar = ""; var numPages = g_commentsJSON.length / pageSize; var remainder = g_commentsJSON.length % pageSize; numPages = (g_commentsJSON.length-remainder)/pageSize; if (remainder > 0) { numPages++; } if (numPages==1){ } else { var max = numPages-1; var currentPlus = pageNum+3; if (currentPlus > (numPages-1)){ currentPlus = numPages-1; } var startPage = pageNum-1; if (startPage < 0){ startPage=pageNum; //currentPlus++; } if (currentPlus==(numPages-1)){ if (numPages>5){ startPage = numPages-5; } } if (pageNum!=0){ bar = bar + '«'; } if (pageNum>1){ bar = bar + '1   …'; } for (var i = startPage ; i <= currentPlus; i++) { if (i==pageNum){ if (i>=currentPlus){ bar = bar + '' + (i+1) + '   '; }else { bar = bar + '' + (i+1) + '   '; } } else { if (i>=currentPlus){ bar = bar + '' + (i+1) + '   '; } else { bar = bar + '' + (i+1) + '   '; } } } if (currentPlus<= (numPages-2)){ indexPage = numPages-1; bar = bar + '…' + numPages + '   '; } if (max>pageNum){ bar = bar + '»'; } } return bar; } function paginationBar(pageNum) { var bar = ""; var numPages = g_commentsJSON.length / pageSize; var remainder = g_commentsJSON.length % pageSize; numPages = (g_commentsJSON.length-remainder)/pageSize; if (remainder > 0) { numPages++; } for (var i = 0 ; i <= numPages - 1; i++) { var stuff = numPages-1; if (i==0 && pageNum!=0){ bar = bar + '«'; } if (i==pageNum){ if (i>=stuff){ bar = bar + '' + (i+1) + '   '; }else { bar = bar + '' + (i+1) + '   '; } } else { if (i>=stuff){ bar = bar + '' + (i+1) + '   '; } else { bar = bar + '' + (i+1) + '   '; } } if (i>=stuff&&stuff>pageNum){ bar = bar + '»'; } } return bar; } firstRate = false; function refreshCommentsWithPage(pageNum) { var myLoggedInKey = readCookie("6696loggedIn"); if(myLoggedInKey!==''&&myLoggedInKey!==null){ var keyArr = myLoggedInKey.split(","); st = keyArr[0]; tid=keyArr[1]; token = keyArr[3]; } else { token = ''; } commentsJSON = g_commentsJSON; var newComments = ""; document.getElementById('ka_commentCage').innerHTML = newComments; var bar = paginationBarNew(pageNum); document.getElementById('ka_commentCountItem').innerHTML = commentsJSON.length+" Comments"; document.getElementById('ka_paginate').innerHTML = bar; document.getElementById('ka_paginateBottom').innerHTML = bar; } function refreshComments() { refreshCommentsWithPage(0); } function clear_textbox() { var elemLocal = document.getElementById('ka_username'); if (elemLocal.value == "Username"){ elemLocal.value = ""; } } function clear_textbox_pass() { var elemLocal = document.getElementById('ka_password'); if (elemLocal.value == "Password"){ elemLocal = document.getElementById('password_box'); elemLocal.innerHTML = ""; setTimeout(function(){document.getElementById('ka_password').focus();},10); } } function flagComment(url,comment, spanId, t, commentId, usernameOfComment){ var username = readCookie('6696'+'username'); if (username == null || username == ''){ username = "anonymous"; } //alert("username: " + username +" url:" + url + " comment: " + comment); var request = 'http://clientapps.kickapps.com/coxtv/flagComment.php?as=6696&emails=hssports@wftv.com&fromUserId=225658&url='+escape(url)+'&comment='+escape(comment)+'&username='+usernameOfComment+'&t='+escape(t)+'&cId='+commentId; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag(); document.getElementById(spanId).innerHTML="Comment Has Been Flagged"; } function addedComment() { document.getElementById('ka_comment_text').value=''; //Flush cache var origURL = encodeURIComponent("http://api.kickapps.com/rest/externalmedia/6696?t="+ka_token+"&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html&callback=gotSocData"); aObj = new JSONscriptRequest("http://clientapps.kickapps.com/coxtv/flush.php?d="+origURL ); aObj.buildScriptTag(); aObj.addScriptTag(); //refresh(); } function flushComplete(){ manualCommentsRefresh(ka_token); } function checkedText(json){ if(json.result==0){ var myLoggedInKey = readCookie("6696loggedIn"); var token=''; if(myLoggedInKey!==''&&myLoggedInKey!==null){ var keyArr = myLoggedInKey.split(","); token = keyArr[3]; } else { token = ''; } var comment = document.getElementById('ka_comment_text').value; var request = 'http://api.kickapps.com/rest/comment/add/emedia/' + '1234' + '/' + ka_as + '?t=' + token + '&comment=' + comment + '&title=title&callback=addedComment&url='+'http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html'; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag(); } else { alert("Your comment contains a word or words which are considered inappropriate. Please edit the text of your comment and resubmit."); } } function addComment() { var comment = document.getElementById('ka_comment_text').value; comment = comment.replace(/ /g, "_"); var request = "http://clientapps.kickapps.com/coxtv/profanity_secure_js.php?texttocheck=" + escape(comment)+ "&callback=checkedText"; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag(); } var someJSON = null; function gotSocData(jsonStuff) { someJSON = jsonStuff; g_commentsJSON = jsonStuff.comments; refreshComments(); } function getToken(username) { aObj = new JSONscriptRequest("http://clientapps.kickapps.com/coxtv/login.php?u=" + username + "&callback=gotToken&as=" + ka_as); aObj.buildScriptTag(); aObj.addScriptTag(); } function checkLogin() { var username = readCookie('6696'+'username'); if (username == null || username == '') { //paintLoginBox(false); isUserLoggedInKASide(); } else { user = username; paintLoggedInBox(); getToken(username); } } function verifyDomain() { //place holder in case you need to check domain hosting js return true; } function ka_start() { if (!verifyDomain()){ } else { var comment_content_container = document.getElementById('comment_content_container'); if (comment_content_container == null) { var bod = document.body; comments = document.createElement('div'); comments.setAttribute("id", "comment_content_container"); bod.appendChild(comments); } writeContainer(); var commentsAdd = document.getElementById('ka_orig_button'); if (commentsAdd == null) { var bod1 = document.body; commentsAdd = document.createElement('div'); commentsAdd.setAttribute("id", "ka_comments_add"); bod1.appendChild(commentsAdd); } var commentsDiv = document.getElementById('ka_comments'); if (commentsDiv == null) { var bod2 = document.body; commentsDiv = document.createElement('div'); commentsDiv.setAttribute("id", "ka_comments"); bod2.appendChild(commentsDiv); } //aObj = new JSONscriptRequest("http://api.kickapps.com/rest/externalmedia/6696?t=ZAI9+G6LSQ3PE2+4cTwuqtLMHq/Wiqdh&url=http%3A%2F%2Fwww.wftv.com%2Fnews%2F19090082%2Fdetail.html&callback=gotSocData" ); //aObj.buildScriptTag(); //aObj.addScriptTag(); paintCommentAdd(); checkLogin(); } } function logout(){ var myLoggedInKey = readCookie("6696loggedIn"); var email = ''; var username = ''; if(myLoggedInKey!==''&&myLoggedInKey!==null){ var keyArr = myLoggedInKey.split(","); st = keyArr[0]; tid=keyArr[1]; } isLogout=true; document.getElementById('LogoutiFrame').src="http://my.wftv.com/user/logoutUser.kickAction?as=6696"; } function onLogoutIFrameLoad(){ if(isLogout){ isLogout=false; var myLoggedInKey = readCookie("6696loggedIn"); var email = ''; var username = ''; if(myLoggedInKey!==''&&myLoggedInKey!==null){ var keyArr = myLoggedInKey.split(","); st = keyArr[0]; tid=keyArr[1]; } eraseCookie("6696loggedIn"); eraseCookie("6696username"); refresh(); } } function getTokenPass(username, password) { user = username; pass = password; aObj = new JSONscriptRequest("http://clientapps.kickapps.com/coxtv/login.php?p=" + password + "&callback=gotToken&u=" + username + "&as=" + ka_as); aObj.buildScriptTag(); aObj.addScriptTag(); } function login() { user = document.getElementById('ka_username').value; pass = document.getElementById('ka_password').value; if (pass == "") { alert("Please enter a password."); return false; } else { getTokenPass(user, pass); } } function loginParams(username, password) { getTokenPass(username, password); } function callAPI(theUrl, callback) { var request = theUrl + "&callback=" + callback; aObj = new JSONscriptRequest(request); aObj.buildScriptTag(); aObj.addScriptTag(); } setTimeout('ka_start()',1500); function findPos(obj) { var curtop = 0; var curleft = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } return [curleft,curtop]; } function toggleRegForm() { var regForm = document.getElementById('ka_regform'); var pos = findPos(document.getElementById('registerlink')); regForm.style.top = pos[1] + 20+"px"; regForm.style.left = pos[0] + 5+"px"; var display = regForm.style.display; if (display == 'none' || display == '' || display == undefined) { regForm.style.display = 'block'; } else { regForm.style.display = 'none'; } } function clearRegForm(){ document.getElementById('dateofbirthmonth').selectedIndex=0; document.getElementById('dateofbirthday').selectedIndex=0; document.getElementById('dateofbirthyear').selectedIndex=0; document.getElementById('firstname').value=""; document.getElementById('reg_username').value=""; document.getElementById('ka_email').value=""; document.getElementById('reg_password').value=""; document.getElementById('confirmpassword').value=""; document.getElementById('register').value="Register"; } function userRegistered(registeredJSON) { if (registeredJSON.userId != null) { loginParams(document.getElementById('reg_username').value, document.getElementById('reg_password').value); toggleRegForm(); clearRegForm(); } else { alert("Registration error - please try again. Note this can occur if the username and/or password you have entered is already in use."); document.getElementById('register').value='Register'; //clearRegForm(); } } function registerAndLogin() { var monthVal = ''; monthVal = document.getElementById('dateofbirthmonth').options[document.getElementById('dateofbirthmonth').selectedIndex].value; var dayVal = ''; dayVal = document.getElementById('dateofbirthday').options[document.getElementById('dateofbirthday').selectedIndex].value; var yearVal = ''; yearVal = document.getElementById('dateofbirthyear').options[document.getElementById('dateofbirthyear').selectedIndex].value; var firstnameVal = ''; firstnameVal = document.getElementById('firstname').value; var usernameVal = ''; usernameVal = document.getElementById('reg_username').value; var emailVal = ''; emailVal = document.getElementById('ka_email').value; var passwordVal = '' passwordVal = document.getElementById('reg_password').value; var confirm_passwordVal = ''; confirm_passwordVal = document.getElementById('confirmpassword').value; var errorstr = ''; if (passwordVal != confirm_passwordVal){ errorstr = "Password and Confirm Password must match\n"; } if (monthVal.length==0){ errorstr = errorstr+"Date of Birth Month is a required field\n"; } if (dayVal.length==0){ errorstr = errorstr+"Date of Birth Day is a required field\n"; } if (yearVal.length==0){ errorstr = errorstr + "Date of Birth Year is a required field\n"; } if (firstnameVal.length==0){ errorstr = errorstr + "First Name is a required field\n"; } if (usernameVal.length==0){ errorstr = errorstr + "Username is a required field\n"; } if (passwordVal.length==0){ errorstr = errorstr + "Password must be at least 4 characters in length\n"; } //Check Date if (!isDate(monthVal+"/"+dayVal+"/"+yearVal)){ errorstr = errorstr + "Date of Birth does not appear to be a valid date\n"; } //Check Age if(!isOver13(monthVal, dayVal,yearVal)){ errorstr = errorstr + "You must be at least 13 years of age to use this service.\n"; } //Check email if (!echeck(emailVal)){ errorstr = errorstr + "Email address must be valid.\n"; } if(errorstr.length>0){ alert(errorstr); } else { document.getElementById('register').value='One moment...'; aObj = new JSONscriptRequest("http://clientapps.kickapps.com/coxtv/register.php?as=" + ka_as + "&month=" + monthVal + "&day=" + dayVal + "&year=" + yearVal + "&firstname=" + firstnameVal + "&email=" + emailVal + "&password=" + passwordVal + "&username=" + usernameVal + "&as=" + ka_as); aObj.buildScriptTag(); aObj.addScriptTag(); } return false; } var MAX_DUMP_DEPTH = 10; function dumpObj(obj, name, indent, depth) { if (depth > MAX_DUMP_DEPTH) { return indent + name + ": \n"; } if (typeof obj == "object") { var child = null; var output = indent + name + "\n"; indent += "\t"; for (var item in obj) { try { child = obj[item]; } catch (e) { child = ""; } if (typeof child == "object") { output += dumpObj(child, item, indent, depth + 1); } else { output += indent + item + ": " + child + "\n"; } } return output; } else { return obj; } }