function logit(message) { loga = document.getElementById("log"); if(loga) { loga.innerHTML = loga.innerHTML + message + "
"; } } function make_gallink(el) { el.style.visibility = "visible"; logit("m_gallink applied to "+el.href); el.onclick = function() { open_gallery_window(el.href); return false; } } function open_gallery_window(url) { width = 800; height = 635; target = '_blank'; window.open(url, target, "width="+width+",height="+height+",scrollbars,resizable"); } function make_soundslides_gallink(el) { el.style.visibility = "visible"; logit("make_soundslides_gallink applied to "+el.href); el.onclick = function() { width = 800; height = 703; target = '_blank'; window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function make_formwidget_popup(theform) { theform.style.visibility = "visible"; logit("make_formwidget_popup applied to "+theform.selected_gallery.options[theform.selected_gallery.selectedIndex].value); theform.onsubmit = function() { var theurl = theform.selected_gallery.options[theform.selected_gallery.selectedIndex].value; width = 800; height = 615; target = '_blank'; window.open(theurl, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function make_popup(el) { logit("make_popup applied to "+el.href); el.onclick = function() { width = (window.outerWidth || window.screen.availWidth) * .75; height = (window.outerHeight || window.screen.availHeight) * .75; target = el.getAttribute('target') || '_blank'; window.open(el.href, target, "width="+width+",height="+height+",menubar,resizable,location,scrollbars,status,toolbar"); return false; } } function make_sharedinteractlink(el) { logit("make_sharedinteractlink applied to "+el.href); el.onclick = function() { width = 777; height = 750; target = el.getAttribute('target') || '_blank'; window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function make_castpopup(el) { el.onclick = function() { width = 525; height = 600; target = el.getAttribute('target') || '_blank'; window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function make_audioplayerpopup(el) { el.onclick = function() { width = 230; height = 330; target = el.getAttribute('target') || '_blank'; window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function make_singleaudiopopup(el) { el.onclick = function() { width = 300; height = 80; target = el.getAttribute('target') || '_blank'; window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable"); return false; } } function default_to(defaultimg, el) { el.style.background = "#fff url("+defaultimg+") no-repeat"; el.onfocus = function() { el.style.background = "#fff none"; } } var popups_init = { 'a.gallink': make_gallink, 'a.ssgallink': make_soundslides_gallink, 'a.apgallink': make_gallink, 'a.apinterlink': make_gallink, 'a.popup': make_popup, 'a.sharedinteract': make_sharedinteractlink, '.gallery_form_widget': make_formwidget_popup, 'a.castpopup': make_castpopup, //CMH added castpopup on 5/9/06 'a.audioplayer': make_audioplayerpopup, 'a.singleaudio': make_singleaudiopopup, //CB added singleaudiopopup 06/13/06 'input.default_to_Search': function(el) { default_to("http://alt.coxnewsweb.com/ajc/search.gif",el) } }; Behaviour.register(popups_init); function truncate_widget(el, length) { logit("truncate_widget applied to "+el.innerHTML); original = el.innerHTML; parts = original.split(" "); if(parts.length > 20) { shortened = parts.slice(0,30); el.innerHTML = shortened.join(" ") + "..."; el.className = "body_truncated"; } } var widget_rules = { ".cxnhdln .body":function(el) { truncate_widget(el, 20); } }; Behaviour.register(widget_rules); var behaviour_count = 0; logit("Initial: "+behaviour_count); function apply_behaviours() { loga = document.getElementById("log"); Behaviour.apply(); //Behaviour.apply(); if(behaviour_count == 0) { logit("If 0: "+behaviour_count); behaviour_count = behaviour_count + 1; } else if(behaviour_count == 1) { logit("If 1: "+behaviour_count); behaviour_count = behaviour_count + 1; } else { logit("else: "+behaviour_count); behaviour_count = behaviour_count + 1; } } /*** Flash/AJAX tracking code from SC/Sean Neal added by CMH: 6/21/06 ***/ function sendAnalyticsEvent(accnt) { accnt=accnt?accnt:s_account; void(s_gs(accnt)) } function sendLinkEvent(accnt,lnkname,type) { accnt=accnt?accnt:s_account; s_linkType=type?type:"o"; s_lnk=true; s_linkName=lnkname?lnkname:s_linkName?s_linkName:"Flash Link Event"; void(s_gs(accnt)) }