// JavaScript Document
var SITE_ROOT = "http://www.pbs.org/pbshare/";
function callModule(org_id, pipeline_id, page){
var params = ("&org_id="+org_id+"&pipeline_id="+pipeline_id+"&page="+page) +"&"+ location.search.substring(1);
document.write("
"); // Added this so Netscape 7.2 would work
var html_str = '';
document.write(html_str);
window.onload = function(){ // IE6 FIX
if(!document.getElementById('pbshare_dyn_div').innerHTML){
history.go(0);
}
}
};
function charLimit(o,div,tot) {
var currRemain = tot - o.value.length;
if(currRemain<0){
div.style.color = "#FF0000";
var overBy = o.value.length - tot;
div.innerHTML= ("(Exceeded limit by "+ overBy +")");
}else{
div.style.color = "#000000";
div.innerHTML= ("("+currRemain+" remaining)");
};
}
function popUp(center,url,winName,width,height,features) {
//'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'
if (center) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
}
var newWin = window.open(url,winName,'scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+','+features);
newWin.focus();
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i
message_str = "";
if(allGood==true){
return true;
}else{
alert("Some of the required fields in this page were not filled out."+message_str);
return false;
};
};
function checkFormPage6(site_root){
allGood=true;
if(document.formPage6.submission_title.value==''){
MM_swapImage('required01','',site_root+'images/page_parts/white_required_arrow.gif',1);
document.formPage6.required01.width = 10;
allGood=false;
}else{
MM_swapImage('required01','',site_root+'images/page_parts/white_required_blank.gif',1);
document.formPage6.required01.width = 1;
};
if(document.formPage6.submission_short_desc.value==''){
MM_swapImage('required02','',site_root+'images/page_parts/white_required_arrow.gif',1);
document.formPage6.required02.width = 10;
allGood=false;
}else{
MM_swapImage('required02','',site_root+'images/page_parts/white_required_blank.gif',1);
document.formPage6.required02.width = 1;
};
if(document.formPage6.submission_type_id.value==1){
if(document.formPage6.submission_full_story.value==''){
MM_swapImage('required03','',site_root+'images/page_parts/white_required_arrow.gif',1);
document.formPage6.required03.width = 10;
allGood=false;
}else{
MM_swapImage('required03','',site_root+'images/page_parts/white_required_blank.gif',1);
document.formPage6.required03.width = 1;
};
};
// INIT STRING - - - - - - - - >
message_str = "";
if(allGood==true){
return true;
}else{
alert("Some of the required fields in this page were not filled out."+message_str);
return false;
};
};
function checkFormPage7(site_root){
allGood=true;
message_str="";
var img1 = new Image();
img1.src = document.formPage7.browse_image.value;
var img1width = parseInt(img1.width);
var img1height = parseInt(img1.height);
//alert("This is image Test \n Width : " + img1width + "\n Height : " + img1height );
if(document.formPage7.browse_image.value!=''){
//alert("document.formPage7.browse_image.value!=''");
if(document.formPage7.browse_image.value.indexOf(".jpg", 0) == -1){
message_str += "\n\nAdditionally your digital photo must be a Jpeg with a lowercase '.jpg' file extension.";
allGood=false;
};
if(document.formPage7.privacy.checked==false){
MM_swapImage('required01','',site_root+'images/page_parts/white_required_arrow.gif',1);
document.formPage7.required01.width = 10;
allGood=false;
}else{
MM_swapImage('required01','',site_root+'images/page_parts/white_required_blank.gif',1);
document.formPage7.required01.width = 1;
};
};
// INIT STRING - - - - - - - - >
//message_str = "";
if(allGood==true){
return true;
}else{
alert("Some of the required fields in this page were not filled out."+message_str);
return false;
};
};
//**************************************************************************************************************
//**************************************************************************************************************
//**************************************************************************************************************
/*********************************************************************************
dw_cookies.js - cookie functions for www.dyn-web.com
Recycled from various sources
**********************************************************************************/
// Modified from Bill Dortch's Cookie Functions (hidaho.com)
// (found in JavaScript Bible)
function setCookie(name,value,days,path,domain,secure) {
var expires, date;
if (typeof days == "number") {
date = new Date();
date.setTime( date.getTime() + (days*24*60*60*1000) );
expires = date.toGMTString();
}
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
// Modified from Jesse Chisholm or Scott Andrew Lepera ?
// (found at both www.dansteinman.com/dynapi/ and www.scottandrew.com/junkyard/js/)
function getCookie(name) {
var nameq = name + "=";
var c_ar = document.cookie.split(';');
for (var i=0; ithis.maxSize||sizethis.maxSize||size0){if(this.curSize+n>this.maxSize)n=this.maxSize-this.curSize;}else if(n<0){if(this.curSize+n