function audio_popup(id, has_ad) { // new style audio popup var swidth = 790; var sheight = 450; var adheight = 120; if ( has_ad == 1 ) { sheight = sheight + adheight; } url = '/audioplayer/' + id + '.html'; newwindow = window.open(url, 'stuffaudioplayer', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function video_popup(id, has_ad) { // new style video popup var swidth = 790; var sheight = 450; var adheight = 120; if ( has_ad == 1 ) { sheight = sheight + adheight; } url = '/videoplayer/' + id + '.html'; newwindow = window.open(url, 'stuffvideoplayer', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function rugby_video_popup(id, has_ad) { // new style video popup var swidth = 790; var sheight = 560; var adheight = 120; if ( has_ad == 1 ) { sheight = sheight + adheight; } url = '/videoplayer/' + id + '.html'; newwindow = window.open(url, 'stuffvideoplayer', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function audio_popup(id) { // new style video popup var swidth = 400; var sheight = 300; url = '/audioplayer/' + id + '.html'; newwindow = window.open(url, 'stuffvideoplayer', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function menulink_popup(title, url, width, height) { // general menu link popup newwindow = window.open(url, title, 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } /* Story Comment Functions -reordering and posting comment functions as well as cookie stuff */ function get_comment_cookie() { var name = "comment_order_cookie="; var allcookies = document.cookie.split(';'); for(var i = 0 ; i < allcookies.length; i++) { var cookie = allcookies[i]; while (cookie.charAt(0)==' ') cookie = cookie.substring(1,cookie.length); if (cookie.indexOf(name) == 0) { return cookie.substring(name.length,cookie.length); } } return 'desc'; // return default if cookie doesn't exist } function get_display_cookie() { var name = "comment_display_cookie="; var allcookies = document.cookie.split(';'); for(var i = 0 ; i < allcookies.length; i++) { var cookie = allcookies[i]; while (cookie.charAt(0)==' ') cookie = cookie.substring(1,cookie.length); if (cookie.indexOf(name) == 0) { return cookie.substring(name.length,cookie.length); } } return 'top'; // return default if cookie doesn't exist } function check_comment_order() { var cookie = get_comment_cookie(); if ( cookie == 'asc' ) {//only reorder if we have asc since desc is default reorder_comments(); } else { //default desc document.cookie = "comment_order_cookie=desc;"; } } function reorder_comments_desc() { if ( get_comment_cookie() == 'asc' ) { document.cookie = "comment_order_cookie=desc;"; reorder_comments(); } } function reorder_comments_asc() { if ( get_comment_cookie() == 'desc' ) { document.cookie = "comment_order_cookie=asc;"; reorder_comments(); } } function show_all_comments() { if ($('commentlist') == undefined) return; Element.cleanWhitespace($('commentlist')); var children = $('commentlist').childNodes; for (var i = children.length - 1; i >=0 ; i--) { Element.removeClassName($(children[i].id), 'hide'); } document.cookie = "comment_display_cookie=all;"; } function show_top_comments() { if ($('commentlist') == undefined) return; Element.cleanWhitespace($('commentlist')); var children = $('commentlist').childNodes; for (var i = 0; i < children.length; i++) { if ( i >= 5 ) { Element.addClassName($(children[i].id), 'hide'); } } document.cookie = "comment_display_cookie=top;"; } function reorder_comments() { Element.cleanWhitespace($('commentlist')); var elems = new Array(); var children = $('commentlist').childNodes; for (var i = 0; i < children.length; i++) { Element.removeClassName($(children[i].id), 'hide'); elems.push(children[i]); } for (var i = 0; i < children.length; i++) { var parent = document.getElementById('commentlist'); var temp = document.createElement("p"); temp.id = 'new-comment-' + i; parent.replaceChild(temp, document.getElementById(children[i].id)); } var children = $('commentlist').childNodes; for (var i = 0; i < children.length; i++) { var child = elems.pop(); $('commentlist').replaceChild(child, document.getElementById('new-comment-' + i)); } if ( get_display_cookie() == 'top' ) { show_top_comments(); } else { show_all_comments(); } } function reply_to_comment(comment_id, comment_number) { $('response').innerHTML = 'In response to #' + comment_number + ''; $('parent_comment_id').value = comment_id; return true; } function post_story_comment(comment_id, comment_number) { if ( !$('name').value || !$('email').value ) { alert("Please complete all required the fields."); return false; } if ( ! $('comment_text').value ) { alert("Please type a comment."); return false; } if ( !$('approveterms').checked ) { alert("Please confirm that you have agreed to the terms and conditions."); return false; } $('comments_form').submit(); } /* End of story comment functions */ function confirm_blog_comment(thisform) { if ( ! thisform.author.value || ! thisform.email.value ) { alert("Please complete all required the fields."); return false; } if ( ! thisform.comment.value ) { alert("Please type a comment."); return false; } if ( ! thisform.approveterms.checked ) { alert("Please confirm that you have agreed to the terms and conditions."); return false; } return true; } function livescore(id) { // livescoring popup var swidth = 727; var sheight = 355; url = '/livescoring/' + id + '.html'; newwindow = window.open(url, 'stufflivescoring', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function vPopup(url, has_ad) { // old style video popup for backward compatablity var swidth = 790; var sheight = 450; var adheight = 120; if ( has_ad == 1 ) { sheight = sheight + adheight; } newwindow = window.open(url, 'stuffvideoplayer', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = 100,top = 100'); if (window.focus) {newwindow.focus()} } function pointerPopup(url, pWidth, pHeight) { if ( ! pWidth ) { pWidth = 640; } if ( ! pHeight ) { pHeight = 480; } popupwindow = window.open(url,'name','width=' + pWidth + ',height=' + pHeight + ',left = 100,top = 100,resizable=1'); if (window.focus) {popupwindow.focus()} return false; } function galleryPopup(url, has_ad) { var swidth = 778; var sheight = 614; var adheight = 120; var sLeft = 100; var sTop = 100; var sScroll = 0; if ( screen.height <= 800 ) { sTop = 0; } if ( screen.height <= 600 ) { sLeft = 0; sTop = 0; sScroll = 1; } if ( has_ad == 1 ) { sheight = sheight + adheight; } newwindow = window.open(url, 'stuffphotoslideshow', 'toolbar=0,scrollbars=' + sScroll + ',location=0,status=0,menubar=0,resizable=0,width=' + swidth + ',height=' + sheight + ',left = ' + sLeft + ',top = ' + sTop); if (window.focus) {newwindow.focus()} } function mostViewedPanel(panel) { // show the passed panel, hide the others. if ( panel == 'emails' ) { document.getElementById('mostviewedstorieslinks').style.display = 'none'; document.getElementById('mostviewedstories').style.display = 'none'; document.getElementById('mostviewedemailslinks').style.display = 'block'; document.getElementById('mostviewedemails').style.display = 'block'; } else { document.getElementById('mostviewedemailslinks').style.display = 'none'; document.getElementById('mostviewedemails').style.display = 'none'; document.getElementById('mostviewedstorieslinks').style.display = 'block'; document.getElementById('mostviewedstories').style.display = 'block'; } } function classifiedPanel(panel) { if ( panel == 'jobs' ) { document.getElementById('right_col_classifieds_motors').style.display = 'none'; document.getElementById('right_col_classifieds_jobs').style.display = 'block'; document.getElementById('right_col_classifieds_property').style.display = 'none'; } else if ( panel == 'property' ) { document.getElementById('right_col_classifieds_motors').style.display = 'none'; document.getElementById('right_col_classifieds_jobs').style.display = 'none'; document.getElementById('right_col_classifieds_property').style.display = 'block'; } else { document.getElementById('right_col_classifieds_motors').style.display = 'block'; document.getElementById('right_col_classifieds_jobs').style.display = 'none'; document.getElementById('right_col_classifieds_property').style.display = 'none'; } }