//Added variables to supress errors in IE/PC on 4/5/07 CMH
//var tc_pvalue;
//var ca_ord;
//var tc_uid;
//var tc_urg;
//var tc_ura;
//var tc_urz;
//var tc_urn;
//var tc_ap;
//var tc_pg;
//var tc_sub;
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() {
//mywindow.moveTo(5, 5);
open_gallery_window(el.href);
return false;
}
}
function open_gallery_window(url) {
width = 990;
height = 670;
target = '_blank';
window.open(url, target, "width="+width+",height="+height+",scrollbars,resizable");
}
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';
mywindow = 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';
mywindow = window.open(el.href, target, "width="+width+",height="+height+",menubar,resizable,location,scrollbars,status,toolbar");
mywindow.moveTo(5, 5);
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';
mywindow = window.open(el.href, target, "width="+width+",height="+height+",scrollbars,resizable");
mywindow.moveTo(5, 5);
return false;
}
}
var popups_init = {
'a.gallink': make_gallink,
'a.apgallink': make_gallink,
'a.apinterlink': make_gallink,
'a.popup': make_popup,
'a.sharedinteract': make_sharedinteractlink,
'.gallery_form_widget': make_formwidget_popup
};
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);
s_prop24 = ''; //Setting prop since sc doesn't.
function keyword_extraction() {
var meta_keywords = document.getElementsByName('KEYWORDS')[0];
if(!meta_keywords) { return false; }
var special_keywords = [];
keyword_parts = meta_keywords.content.split(",");
for(var index in keyword_parts) {
var kw = keyword_parts[index];
kw = kw.replace(" ", "");
var kw_start = kw.charAt(0);
var kw_stop = kw.charAt(kw.length-1);
if(kw_start == "~" && kw_stop == "~") {
special_keywords[special_keywords.length] = kw.replace(/~/g, ''); // /~/g is a regex for all occurences of ~
}
}
var prop_string = '';
if(special_keywords.length > 1) {
for(var index in special_keywords) {
kw = special_keywords[index];
prop_string = kw + " | " + prop_string;
}
}
else {
prop_string = special_keywords[0];
}
s_prop24 = prop_string;
}
s_prop23_author = "Writer Unknown";
s_prop23_source = "Source Unknown";
s_prop23 = '';
function byline_extraction(el) {
var byline = el.innerHTML;
byline = byline.replace("", '');
byline = byline.replace("", '');
byline = strip(byline).toUpperCase();
if(s_prop23_author.indexOf(byline) != -1) {
//We've got a duplicate
return false;
}
else if(s_prop23_author != "Writer Unknown") {
s_prop23_author = byline + " | " + s_prop23_author;
}
else {
s_prop23_author = byline;
}
}
function strip(sInString) {
sInString = sInString.replace( /^\s+/g, "" );// strip leading
return sInString.replace( /\s+$/g, "" );// strip trailing
}
function source_extraction(el) {
s_prop23_source = strip(el.innerHTML);
}
function blog_source_extraction(el) {
try {
document.getElementById("blog");
}
catch(e) {
return false;
}
source_extraction(el);
}
function author_source_setting(el) {
s_prop23 = s_prop23_author + " || " + s_prop23_source;
}
var metrics_rules = {
"#flag": keyword_extraction,
"span.byline a": byline_extraction,
"p.byline a": byline_extraction,
"span.source": source_extraction,
"p.dateline": blog_source_extraction,
"#cwell": author_source_setting
}
Behaviour.register(metrics_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;
}
}
//Global Functions below
function openMP(the_url) {
var the_height_width = "height=600,width=890" + ",menubar=no,location=no,toolbar=no,resizable=no,scrollbars=no,status=no";
if (navigator.appName.indexOf("Microsoft") != -1) {
the_height_width += ",left=" + ((screen.availWidth - 890) *.5) + ",top=" + ((screen.availHeight - 600) *.5);
}
else if (navigator.appName.indexOf("Netscape") != -1) {
the_height_width += ",screenX=" + ((screen.availWidth - 890) *.5) + ",screenY=" + ((screen.availHeight - 600) *.5);
}
window.open(the_url,"_blank",the_height_width);
}
//SWFOBJECT code for embedding flash items on pages
/**
* SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
* legal reasons.
*/
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="