
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - duration_formfield.js - */
// http://criticalcommons.org/portal_javascripts/duration_formfield.js?original=1
function update_duration_field(field,hour,minute,second){var field=document.getElementById(field)
var hour=document.getElementById(hour)
var minute=document.getElementById(minute)
var second=document.getElementById(second)
if(0<=hour.value){field.value=hour.value+":"+minute.value+":"+second.value}
else{field.value=''
hour.options[0].selected=1
minute.options[0].selected=1
second.options[0].selected=1}}


/* - vpip.js - */
// http://criticalcommons.org/portal_javascripts/vpip.js?original=1
function vPIPPlay(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump){if(vpipPlayerRef==undefined||vpipPlayerRef==null){var vpipPlayer=new vPIPPlayer(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump);vpipPlayerRef=vpipPlayer}
else{var vpipPlayer=vpipPlayerRef;vpipPlayer.setStartup(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump)}
if(vpipPlayer.init()){vpipPlayer.show();return false}
else{if(vpipPlayer.oLink.href.toLowerCase().indexOf("http://")>-1)
window.open(vpipPlayer.oLink.href,"_self");return true}}
vPIPPlayer.DIVPOS=0;vPIPPlayer.DIVIDPOS=1;vPIPPlayer.ORIGHTMLPOS=2;vPIPPlayer.LINKSARRAYPOS=3;vPIPPlayer.OPENPOS=0;vPIPPlayer.HREFPOS=1;vPIPPlayer.WIDTHPOS=2;vPIPPlayer.HEIGHTPOS=3;vPIPPlayer.FLASHWIDTH=320;vPIPPlayer.FLASHHEIGHT=300;vPIPPlayer.AUTOSTARTPOS=4;vPIPPlayer.CONTROLLERPOS=5;vPIPPlayer.NAMEPOS=6;vPIPPlayer.QUALITYPOS=7;vPIPPlayer.BGCOLORPOS=8;vPIPPlayer.FLVPOS=9;vPIPPlayer.REVERTPOS=10;vPIPPlayer.SHOWCLOSEBTNPOS=11;vPIPPlayer.LINKIDPOS=12;vPIPPlayer.WIDTH=320;vPIPPlayer.HEIGHT=260;vPIPPlayer.AUTOSTART="true";vPIPPlayer.CONTROLLER="true";vPIPPlayer.NAME=""
vPIPPlayer.QUALITY="high"
vPIPPlayer.BGCOLOR="#FFFFFF";vPIPPlayer.FLV="false"
vPIPPlayer.REVERT="true";vPIPPlayer.SHOWCLOSEBTN="true";vPIPPlayer.FLVPLAYER450x340="cirneViewer450x340-025c.swf";vPIPPlayer.FLVPLAYER320x300="cirneViewer320x300-025c.swf";vPIPPlayer.WORKINGSAFARIBUILD=420;var vpipPlayerRef;var vPIPThickBoxCloseItem="close";
function vPIPPlayer(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump){this.setStartup(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump);this.aDIVs=new Array();this.iInitiator=0;this.vPIPpath=this.getvPIPPath()}
vPIPPlayer.prototype.setStartup=function(_oLink,_sParams,_sFlashVars,_sThickBox,_sJump){this.oLink=_oLink;this.sParams=_sParams;this.sFlashVars=_sFlashVars;this.sThickBox=_sThickBox;this.sJump=_sJump}
vPIPPlayer.prototype.init=function(){this.oDiv=this.oLink.parentNode;while(this.oDiv!=undefined&&this.oDiv!=null&&this.oDiv.nodeName.toLowerCase()!="div"&&(vPIPPlayer.findAttribute(this.oDiv,"class")==null||vPIPPlayer.findAttribute(this.oDiv,"class").toLowerCase()!="hvlog")){this.oDiv=this.oDiv.parentNode}
if(this.oDiv==undefined||this.oDiv==null||this.oDiv.nodeName.toLowerCase()!="div"||vPIPPlayer.findAttribute(this.oDiv,"class")==null||vPIPPlayer.findAttribute(this.oDiv,"class").toLowerCase()!="hvlog"){this.oDiv=this.constructDiv(this.oLink);if(this.oDiv!=undefined&&this.oDiv!=null&&this.oDiv.nodeName.toLowerCase()=="div"&&vPIPPlayer.findAttribute(this.oDiv,"class")!=null&&vPIPPlayer.findAttribute(this.oDiv,"class").toLowerCase()=="hvlog"){this.oLink.parentNode.replaceChild(this.oDiv,this.oLink);this.oLink=this.oDiv.firstChild}}
if(this.oDiv==undefined||this.oDiv==null||this.oDiv.nodeName.toLowerCase()!="div"||vPIPPlayer.findAttribute(this.oDiv,"class")==null||vPIPPlayer.findAttribute(this.oDiv,"class").toLowerCase()!="hvlog")
this.byDivExists=false;else
this.byDivExists=true;if(this.byDivExists){var byDivFound=false;this.iNextPos=this.findDIV(this.oDiv);if(this.iNextPos==-1)
this.iNextPos=this.aDIVs.length;else
byDivFound=true;this.sLinkid="";this.sHREF=vPIPPlayer.toAlphaNum(this.oLink.href,"~");if(!byDivFound){this.oDiv.setAttribute("id","vPIP"+this.iNextPos);this.sOnClick=vPIPPlayer.toAlphaNum(this.oLink.onclick.toString());this.sLinkid="vPIPMovie"+this.iInitiator;this.oLink.setAttribute("id",this.sLinkid);this.aDIVs[this.iNextPos]=new Array(3);this.aDIVs[this.iNextPos][vPIPPlayer.DIVPOS]=this.oDiv;this.aDIVs[this.iNextPos][vPIPPlayer.DIVIDPOS]="vPIP"+this.iNextPos;this.aDIVs[this.iNextPos][3]=new Array(vPIPPlayer.LINKIDPOS+1);this.aDIVs[this.iNextPos][3][vPIPPlayer.OPENPOS]=false;this.aDIVs[this.iNextPos][3][vPIPPlayer.HREFPOS]=this.sHREF;this.aDIVs[this.iNextPos][3][vPIPPlayer.LINKIDPOS]=parseInt(this.sLinkid.substring(9));this.iInitiator++}
else{this.byLinkFound=false;this.iNextLinkPos=-1;this.sLinkid=this.oLink.id;if(this.sLinkid!=undefined&&this.sLinkid!=null&&this.sLinkid.length>9){this.iLinkid=parseInt(this.sLinkid.substring(9));this.iNextLinkPos=this.findLinkInDiv(this.aDIVs[this.iNextPos],this.iLinkid);if(this.iNextLinkPos<3)
this.iNextLinkPos=3;else
this.byLinkFound=true}
else{this.iNextLinkPos=this.aDIVs[this.iNextPos].length;if(this.iNextLinkPos<3)
this.iNextLinkPos=3;this.sLinkid="vPIPMovie"+this.iInitiator;this.oLink.setAttribute("id",this.sLinkid);this.iInitiator++}
if(!this.byLinkFound){this.aDIVs[this.iNextPos][this.iNextLinkPos]=new Array(vPIPPlayer.LINKIDPOS+1);this.aDIVs[this.iNextPos][this.iNextLinkPos][vPIPPlayer.OPENPOS]=false;this.aDIVs[this.iNextPos][this.iNextLinkPos][vPIPPlayer.HREFPOS]=this.sHREF;this.aDIVs[this.iNextPos][this.iNextLinkPos][vPIPPlayer.LINKIDPOS]=parseInt(this.sLinkid.substring(9))}}}
return true}
vPIPPlayer.prototype.show=function(){this.iWidth=vPIPPlayer.WIDTH;this.iHeight=vPIPPlayer.HEIGHT;this.byAutostart=vPIPPlayer.AUTOSTART;this.byController=vPIPPlayer.CONTROLLER;this.sName=vPIPPlayer.NAME;this.sQuality=vPIPPlayer.QUALITY;this.sBGColor=vPIPPlayer.BGCOLOR;this.byFLV=vPIPPlayer.FLV;this.byRevert=vPIPPlayer.REVERT;this.byShowCloseBtn=vPIPPlayer.SHOWCLOSEBTN;var iPos;if(this.byDivExists){if(this.oLink!=undefined&&this.oLink!=null&&this.oLink.nodeName.toLowerCase()=="a"){this.iCurrDIVid=parseInt(this.oDiv.id.substring(4));this.iCurrLinkid=parseInt(this.oLink.id.substring(9));this.iCurrLink=this.findLinkID(this.aDIVs[this.iCurrDIVid],this.iCurrLinkid);this.sHREF=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.HREFPOS];if(this.sHREF==undefined||this.sHREF==null)
this.sHREF=this.oLink.href;if(this.sHREF!=undefined&&this.sHREF!=null){var movieType=vPIPPlayer.isMovieFile(this.oLink);this.sMimeType=movieType.sMimeType;this.sType=movieType.sType;this.sMediaFormat=movieType.sMediaFormat;this.sFileExt=movieType.sFileExt;if(this.sMediaFormat=="flash"){this.iWidth=vPIPPlayer.FLASHWIDTH;this.iHeight=vPIPPlayer.FLASHHEIGHT;if(this.sFileExt==".flv")
this.byFLV="true"}
var byInitArray=true;if(this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.WIDTHPOS]!=undefined){this.iWidth=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.WIDTHPOS];this.iHeight=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.HEIGHTPOS];this.byAutostart=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.AUTOSTARTPOS];this.byController=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.CONTROLLERPOS];this.sName=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.NAMEPOS];this.sQuality=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.QUALITYPOS];this.sBGColor=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.BGCOLORPOS];this.byFLV=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.FLVPOS];this.byRevert=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.REVERTPOS];this.byShowCloseBtn=this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.SHOWCLOSEBTNPOS];byInitArray=false}
else{if(this.sParams!=undefined&&this.sParams!=null){var aParams=this.sParams.split(",");var aMatch;for(var i=0;i<aParams.length;i++){if(aMatch=aParams[i].match(/(width\s*=\s*)(\d*)/i)){this.iWidth=aMatch[2]}
else if(aMatch=aParams[i].match(/(height\s*=\s*)(\d*)/i)){this.iHeight=aMatch[2]}
else if(aMatch=aParams[i].match(/(autostart\s*=\s*)(\w*)/i)){this.byAutostart=(aMatch[2].toLowerCase()==="true")}
else if(aMatch=aParams[i].match(/(controller\s*=\s*)(\w*)/i)){this.byController=(aMatch[2].toLowerCase()==="true")}
else if(aMatch=aParams[i].match(/(name\s*=\s*)(\w*)/i)){this.sName=aMatch[2]}
else if(aMatch=aParams[i].match(/(quality\s*=\s*)(\w*)/i)){this.sQuality=aMatch[2]}
else if(aMatch=aParams[i].match(/(bgcolor\s*=\s*)(\w*)/i)){this.sBGColor=aMatch[2]}
else if(aMatch=aParams[i].match(/(flv\s*=\s*)(\w*)/i)){this.byFLV=aMatch[2]}
else if(aMatch=aParams[i].match(/(revert\s*=\s*)(\w*)/i)){this.byRevert=(aMatch[2].toLowerCase()==="true")}
else if(aMatch=aParams[i].match(/(showclose\s*=\s*)(\w*)/i)){this.byShowCloseBtn=(aMatch[2].toLowerCase()==="true")}}}}
this.closeThisDiv(this.aDIVs,this.iCurrDIVid);var sInnerHTML=this.oDiv.innerHTML;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.OPENPOS]=false;if(this.sName==undefined||this.sName==null||this.sName==""){this.sName="Embed"+this.iCurrLinkid}
if(byInitArray){this.aDIVs[this.iCurrDIVid][vPIPPlayer.ORIGHTMLPOS]=sInnerHTML;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.WIDTHPOS]=this.iWidth;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.HEIGHTPOS]=this.iHeight;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.AUTOSTARTPOS]=this.byAutostart;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.CONTROLLERPOS]=this.byController;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.NAMEPOS]=this.sName;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.QUALITYPOS]=this.sQuality;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.BGCOLORPOS]=this.sBGColor;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.FLVPOS]=this.byFLV;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.REVERTPOS]=this.byRevert;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.SHOWCLOSEBTNPOS]=this.byShowCloseBtn}
this.sReplace="";if(this.sType=="video"||this.sType=="application"){if(this.sMediaFormat=="quicktime"){this.sReplace="<object class=\"vPIPEmbed\" width=\""+this.iWidth+"\" height=\""+this.iHeight+"\" id=\""+this.sName+"\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" ";if(this.sMimeType=="smil")
this.sReplace+="codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\"> <param name=\"src\" value=\""+this.vPIPpath+"InitSMIL.mov\"><param name=\"qtsrc\" value=\""+this.sHREF;else
this.sReplace+="codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\"> <param name=\"src\" value=\""+this.sHREF;this.sReplace+="\"><param name=\"autoplay\" value=\""+this.byAutostart+"\"><param name='scale' value='tofit' /><param name=\"controller\" value=\"";if(this.sMimeType=="smil")
this.sReplace+=this.byController+"\"><embed src=\""+this.vPIPpath+"InitSMIL.mov\" qtsrc=\""+this.sHREF+"\" width=\""+this.iWidth+"\" height=\""+this.iHeight;else
this.sReplace+=this.byController+"\"><embed src=\""+this.sHREF+"\" width=\""+this.iWidth+"\" height=\""+this.iHeight;this.sReplace+="\" name=\""+this.sName+"\" autoplay=\""+this.byAutostart+"\" controller=\""+this.byController;this.sReplace+="\"  scale=\"tofit\" pluginspage=\"http://www.apple.com/quicktime/download/\"></embed></object>"}
else if(this.sMediaFormat=="windowsmedia"){this.sReplace="<OBJECT class=\"vPIPEmbed\" CLASSID='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'  ";this.sReplace+="codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' ";this.sReplace+="standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'  ";this.sReplace+="width='"+this.iWidth+"' height='"+this.iHeight+"' id='"+this.sName+"' >";this.sReplace+="<PARAM NAME='fileName' VALUE='"+this.sHREF+"' ><PARAM NAME='autoStart' VALUE='"+this.byAutostart;this.sReplace+="'><PARAM NAME='showControls' VALUE='"+this.byController+"'>";this.sReplace+="<EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' id='";this.sReplace+=this.sName+"' name='"+this.sName+"' showcontrols='"+this.byController+"' width='"+this.iWidth+"' height='";this.sReplace+=this.iHeight+"' src='"+this.sHREF+"' autostart='"+this.byAutostart+"'></EMBED></OBJECT>"}
else if(this.sMediaFormat=="flash"){this.sReplace="<OBJECT class=\"vPIPEmbed\" classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";this.sReplace+="codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' ";this.sReplace+="WIDTH='"+this.iWidth+"' HEIGHT='"+this.iHeight+"' id='"+this.sName+"' >";this.sReplace+="<PARAM NAME='movie' VALUE='";if(this.byFLV=="true"){if(Number(this.iWidth)>320)
this.sFLVPlayer=this.vPIPpath+vPIPPlayer.FLVPLAYER450x340;else
this.sFLVPlayer=this.vPIPpath+vPIPPlayer.FLVPLAYER320x300;var sJumpFlashVars="";if(this.sJump!=null&&this.sJump.length>0){var aParams=this.sJump.split(",");var aMatch;for(var i=0;i<aParams.length;i++){if(aMatch=aParams[i].match(/(\w*)(\s*=\s*)(.*)/))
sJumpFlashVars+="&"+aMatch[1]+"="+aMatch[3]}}
this.sReplace+=this.sFLVPlayer+"'> <PARAM NAME='quality' VALUE='"+this.sQuality+"' > <PARAM NAME='bgcolor' VALUE='"+this.sBGColor+"'> ";this.sReplace+="<PARAM NAME='FlashVars' VALUE='flvURL="+this.sHREF+"&cvhome="+this.vPIPpath;if(this.sFlashVars!=undefined&&this.sFlashVars!=null&&this.sFlashVars.length>0)
this.sReplace+="&"+this.sFlashVars;this.sReplace+=sJumpFlashVars+"' > <EMBED src='"+this.sFLVPlayer+"' quality='"+this.sQuality+"' bgcolor='"+this.sBGColor+"' width='"+this.iWidth+"' height='"+this.iHeight+"' ";this.sReplace+="FlashVars='flvURL="+this.sHREF+"&cvhome="+this.vPIPpath;if(this.sFlashVars!=undefined&&this.sFlashVars!=null&&this.sFlashVars.length>0){this.sReplace+="&"+this.sFlashVars}
this.sReplace+=sJumpFlashVars+"' NAME='' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> "}
else{this.sReplace+=this.sHREF+"'> <PARAM NAME='quality' VALUE='"+this.sQuality+"' > <PARAM NAME='bgcolor' VALUE='"+this.sBGColor+"'> ";if(this.sFlashVars!=undefined&&this.sFlashVars!=null&&this.sFlashVars.length>0)
this.sReplace+="<PARAM NAME='FlashVars' VALUE='"+this.sFlashVars+"' > ";this.sReplace+="<EMBED src='"+this.sHREF+"' quality='"+this.sQuality+"' bgcolor='"+this.sBGColor+"' width='"+this.iWidth+"' height='"+this.iHeight+"' ";if(this.sFlashVars!=undefined&&this.sFlashVars!=null&&this.sFlashVars.length>0)
this.sReplace+="FlashVars='"+this.sFlashVars+"' ";this.sReplace+="NAME='' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> "}
this.sReplace+="</EMBED> </OBJECT>"}
if(this.sReplace.length>0){var sUserAgent=navigator.userAgent;this.bySafari=sUserAgent.indexOf('Safari')>-1;this.byOpera=sUserAgent.indexOf('Opera')>-1;this.byIE7=sUserAgent.indexOf("MSIE 7")>-1;this.byIE6=sUserAgent.indexOf("MSIE 6")>-1;this.nSafariBuild=-1;if(this.bySafari){this.nSafariBuild=Number(sUserAgent.substring(sUserAgent.indexOf('Safari')+7))}
this.byThickBox=false;if(this.sThickBox!=undefined&&this.sThickBox!=null&&this.sThickBox.length>0&&!this.bySafari&&!this.byIE6){var aParams=this.sThickBox.split(",");var aMatch;var sThickBoxActive="true";var sThickBoxCaption="";var sThickBoxBackground="#E1E1E1";for(var i=0;i<aParams.length;i++){if(aMatch=aParams[i].match(/(active\s*=\s*)(\w*)/i)){sThickBoxActive=aMatch[2]}
else if(aMatch=aParams[i].match(/(caption\s*=\s*)(.*)/i)){sThickBoxCaption=aMatch[2]}
else if(aMatch=aParams[i].match(/(background\s*=\s*)(\d*)/i)){sThickBoxBackground=aMatch[2]}}
if(sThickBoxActive.toLowerCase()=="true")
this.byThickBox=true}
if(this.byThickBox){this.revert(this.aDIVs);this.thickBox_show(sThickBoxCaption,this.sReplace,Number(this.iWidth),Number(this.iHeight),sThickBoxBackground)}
else{if(this.byShowCloseBtn){this.sReplace="<div style=\"padding-right: "+(this.iWidth-49)+"px\" ><a href=\"javascript: vPIPClose("+this.iCurrDIVid+", "+this.iCurrLink+");\" title=\"Close Movie\" onMouseOver=\"document.vPIPImage"+(this.iCurrDIVid * 10)+this.iCurrLink+".src='"+this.vPIPpath+"close_hover.gif';\" onMouseOut=\"document.vPIPImage"+(this.iCurrDIVid * 10)+this.iCurrLink+".src='"+this.vPIPpath+"close_grey.gif';\" style=\" background: transparent;\" ><img src=\""+this.vPIPpath+"close_grey.gif\" name=\"vPIPImage"+(this.iCurrDIVid * 10)+this.iCurrLink+"\" style=\"border: none;\"  /></a></div>"+this.sReplace}
if(!(this.bySafari&&this.nSafariBuild<vPIPPlayer.WORKINGSAFARIBUILD)){this.revert(this.aDIVs)}
this.sReplace=this.addOutsideTarget(sInnerHTML,this.sReplace);this.oDiv.innerHTML=this.sReplace;this.aDIVs[this.iCurrDIVid][this.iCurrLink][vPIPPlayer.OPENPOS]=true}}}
else{if(this.sMimeType!=undefined&&this.sMimeType!=null){setTimeout("Unsuported mime type: \""+this.sMimeType+"\".",0);if(this.oLink.href.toLowerCase().indexOf("http://")>-1)
window.open(this.oLink.href,"_self");else if(this.sHREF!=undefined&&this.sHREF!=null)
window.open(this.sHREF,"_self")}
else{setTimeout("Unsuported file extension: \""+this.sFileExt+"\".",0);if(this.oLink.href.toLowerCase().indexOf("http://")>-1)
window.open(this.oLink.href,"_self");else if(this.sHREF!=undefined&&this.sHREF!=null)
window.open(this.sHREF,"_self")}}}
else{setTimeout("Missing href=\"...\" attribute.",0);if(this.oLink.href.toLowerCase().indexOf("http://")>-1)
window.open(this.oLink.href,"_self");else if(this.sHREF!=undefined&&this.sHREF!=null)
window.open(this.sHREF,"_self")}}
else{setTimeout("video Playing In Place cannot execute because the link is not identified.",0);if(this.sHREF!=undefined&&this.sHREF!=null)
window.open(this.sHREF,"_self")}}
else{setTimeout("video Playing In Place cannot execute because the hVlog DIV is not identified.",0);if(this.oLink.href.toLowerCase().indexOf("http://")>-1)
window.open(this.oLink.href,"_self");else if(this.sHREF!=undefined&&this.sHREF!=null)
window.open(this.sHREF,"_self")}
return}
function MovieType(_MimeType,_sType,_sMediaFormat,_sFileExt){this.sMimeType=_MimeType;this.sType=_sType;this.sMediaFormat=_sMediaFormat;this.sFileExt=_sFileExt}
vPIPPlayer.isMovieFile=function(oLink){var movieType=null;if(oLink!=undefined&&oLink!=null&&oLink.nodeName.toLowerCase()=="a"){var sMimeType=oLink.type;if(sMimeType!=undefined&&sMimeType!=null&&sMimeType.length>0){var iPos=sMimeType.search(/\//);if(iPos>-1)
sMimeType=sMimeType.substring(iPos+1);else
sMimeType=null}
var sType="false";var sMediaFormat="";var sFileExt;var sHREF=vPIPPlayer.toAlphaNum(oLink.href,"~");var iURLGET=sHREF.indexOf('?');if(iURLGET>-1){var sHREFFile=sHREF.substring(0,iURLGET);sFileExt=sHREFFile.substring(sHREFFile.lastIndexOf('.'),iURLGET).toLowerCase()}
else{sFileExt=sHREF.substring(sHREF.lastIndexOf('.'),sHREF.length).toLowerCase()}
if(sMimeType!=undefined&&sMimeType!=null&&sMimeType.length>0){switch(sMimeType.toLowerCase()){case "quicktime":case "mp4":case "x-m4v":case "x-mp3":case "mp3":case "mpeg":case "smil":case "3gpp":sMediaFormat="quicktime";sType="video";break;case "x-msvideo":case "x-ms-wmv":case "x-ms-asf":case "x-ms-wma":sMediaFormat="windowsmedia";sType="video";break;case "x-shockwave-flash":case "x-flv":sMediaFormat="flash";sType="application";break}}
else{sMimeType="";switch(sFileExt.toLowerCase()){case ".mov":case ".mp4":case ".m4v":case ".mp3":case ".3gp":sMediaFormat="quicktime";sType="video";break;case ".smi":case ".smil":sMediaFormat="quicktime";sType="video";sMimeType="smil";break;case ".avi":case ".wmv":case ".asf":case ".wma":sMediaFormat="windowsmedia";sType="video";break;case ".swf":case ".flv":sMediaFormat="flash";sType="application";break}}
movieType=new MovieType(sMimeType,sType,sMediaFormat,sFileExt)}
return movieType}
vPIPPlayer.prototype.revert=function(aDIVs){for(var j=0;j<aDIVs.length;j++){for(var k=vPIPPlayer.LINKSARRAYPOS;k<aDIVs[j].length;k++){if(aDIVs[j][k][vPIPPlayer.REVERTPOS]){aDIVs[j][vPIPPlayer.DIVPOS].innerHTML=aDIVs[j][vPIPPlayer.ORIGHTMLPOS];aDIVs[j][k][vPIPPlayer.OPENPOS]=false}}}}
vPIPPlayer.prototype.closeThisDiv=function(aDIVs,iCurrDIVid){for(var k=vPIPPlayer.LINKSARRAYPOS;k<aDIVs[iCurrDIVid].length;k++){if(aDIVs[iCurrDIVid][k][vPIPPlayer.REVERTPOS]){aDIVs[iCurrDIVid][vPIPPlayer.DIVPOS].innerHTML=aDIVs[iCurrDIVid][vPIPPlayer.ORIGHTMLPOS];aDIVs[iCurrDIVid][k][vPIPPlayer.OPENPOS]=false}}}
vPIPPlayer.prototype.constructDiv=function(oLink){var oDiv=document.createElement("div");oDiv.setAttribute("class","hVlog");var oReplaceLink=document.createElement("a");oReplaceLink.setAttribute("href",oLink.href);if(oLink.type!=""){oReplaceLink.setAttribute("type",oLink.type)}
if(oLink.name!=""){oReplaceLink.setAttribute("name",oLink.type)}
if(oLink.href!=""){oReplaceLink.setAttribute("href",oLink.href)}
if(oLink.rel!=""){oReplaceLink.setAttribute("rel",oLink.rel)}
if(oLink.onclick.toString()!=""){oReplaceLink.onclick=oLink.onclick}
if(oLink.hasChildNodes()){var oLinkChildren=oLink.childNodes;for(var i=0;i<oLinkChildren.length;i++){oReplaceLink.appendChild(oLinkChildren[i])}}
if(oLink.innerHTML!=""){oReplaceLink.innerHTML=oLink.innerHTML}
oDiv.appendChild(oReplaceLink);return oDiv}
vPIPPlayer.prototype.addOutsideTarget=function(sInnerHTML,sRevert){var iTargetStart=sInnerHTML.toLowerCase().indexOf("hvlogtarget");if(iTargetStart>-1){iTargetStart=sInnerHTML.toLowerCase().substring(0,iTargetStart).lastIndexOf("<");var iTargetEnd=sInnerHTML.toLowerCase().indexOf("</a",iTargetStart);iTargetEnd=sInnerHTML.toLowerCase().indexOf(">",iTargetEnd);if(iTargetEnd>-1){var sPrior=sInnerHTML.substring(0,iTargetStart);var sAfter=sInnerHTML.substring(iTargetEnd+1);sRevert=sPrior+sRevert+sAfter}}
return sRevert}
function vPIPClose(sDivLoc,sLinkLoc){var sUserAgent=navigator.userAgent;var bySafari=sUserAgent.indexOf('Safari')>-1;var nSafariBuild=-1;if(bySafari){nSafariBuild=Number(sUserAgent.substring(sUserAgent.indexOf('Safari')+7))}
if(bySafari&&nSafariBuild<vPIPPlayer.WORKINGSAFARIBUILD){document.location.reload()}
else{if(Number(sDivLoc)!=NaN&&Number(sLinkLoc)!=NaN){var iDivLoc=Number(sDivLoc);var iLinkLoc=Number(sLinkLoc);vpipPlayerRef.aDIVs[iDivLoc][vPIPPlayer.DIVPOS].innerHTML=vpipPlayerRef.aDIVs[iDivLoc][vPIPPlayer.ORIGHTMLPOS];vpipPlayerRef.aDIVs[iDivLoc][iLinkLoc][vPIPPlayer.OPENPOS]=false;if(typeof vPIPIt=="function"){vPIPIt()}}}}
vPIPPlayer.prototype.findDIV=function(oDiv){var i;var iFound=-1;if(oDiv.id!=undefined&&oDiv.id!=null&&oDiv.id.length>0){for(i=0;i<this.aDIVs.length;i++){if(this.aDIVs[i][vPIPPlayer.DIVIDPOS]===this.oDiv.id){iFound=i;break}}}
return iFound}
vPIPPlayer.prototype.findLinkID=function(aDIV,iCurrLinkid){var iFound=-1;for(var i=3;i<aDIV.length;i++){if(aDIV[i][vPIPPlayer.LINKIDPOS]==iCurrLinkid){iFound=i;break}}
return iFound}
vPIPPlayer.prototype.findLinkInDiv=function(aDiv,iLinkid){var iLinkPosInDiv=-1;for(var i=3;i<aDiv.length;i++){if(aDiv[i][vPIPPlayer.LINKIDPOS]!=undefined){if(aDiv[i][vPIPPlayer.LINKIDPOS]==iLinkid){iLinkPosInDiv=i;break}}}
return iLinkPosInDiv}
vPIPPlayer.prototype.addEvent=function(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true} else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r} else{return false}}
vPIPPlayer.prototype.getvPIPPath=function(){var scripts=document.getElementsByTagName("script");var src;var index;var sVPIPpath="";for(var i=0;i<scripts.length;i++){src=scripts[i].getAttribute("src");if(src!=undefined&&src!=null){index=src.search(/vpip.js/i);if(index>-1){sVPIPpath=src.substring(0,index);break}}}
return sVPIPpath}
vPIPPlayer.findAttribute=function(oElement,sAttribute){var oValue=null;var attrs=oElement.attributes;if(attrs!=undefined&&attrs!=null){for(var i=attrs.length-1;i>=0;i--){if(attrs[i].name.toLocaleLowerCase()==sAttribute.toLocaleLowerCase()){oValue=attrs[i].value;break}}}
return oValue}
vPIPPlayer.toAlphaNum=function(sString,sAllowed){var i;var sNewString="";if(sString==undefined||sString==null){return sString}
else{for(i=0;i<sString.length;i++){ch=sString.charAt(i);if(ch>=" "&&ch<="z"){sNewString+=sString.charAt(i)}
else if(sAllowed!=undefined&&sAllowed!=null&&sAllowed.indexOf(ch)>-1){sNewString+=sString.charAt(i)}}
return sNewString}}
vPIPPlayer.prototype.thickBox_show=function(sCaption,sEmbed,vPIP_TB_WIDTH,vPIP_TB_HEIGHT,sBackground){try{jQuery("body").append("<div id='vPIP_TB_overlay'></div><div id='vPIP_TB_window'></div>");jQuery("#vPIP_TB_overlay").click(this.thickBox_remove);jQuery(window).scroll(this.thickBox_position);if(sCaption==undefined||sCaption==null)
sCaption='';vPIP_TB_WIDTH+=30;vPIP_TB_HEIGHT+=60;var sEntry="<div id='vPIP_TB_caption'>"+sCaption+"</div><div id='vPIP_TB_closeWindow'><a href='javascript: none' id='vPIP_TB_closeWindowButton'>"+vPIPThickBoxCloseItem+"</a></div><div id='vPIP_Object'>"+sEmbed+"</div>";jQuery("#vPIP_TB_window").html(sEntry);document.getElementById("vPIP_TB_window").style.backgroundColor=sBackground;document.getElementById("vPIP_TB_window").style.backgroundColor=sBackground;jQuery("#vPIP_TB_closeWindowButton").click(this.thickBox_remove);this.thickBox_position(vPIP_TB_WIDTH,vPIP_TB_HEIGHT);jQuery("#vPIP_TB_window").show()} catch(e){setTimeout(e,0)}}
vPIPPlayer.prototype.thickBox_remove=function(){jQuery("#vPIP_TB_window").html("");jQuery("#vPIP_TB_window").fadeOut("fast",function(){jQuery('#vPIP_TB_window,#vPIP_TB_overlay').remove()});if(typeof vPIPIt=="function"){vPIPIt()}
return false}
vPIPPlayer.prototype.thickBox_position=function(vPIP_TB_WIDTH,vPIP_TB_HEIGHT){var de=document.documentElement;var w=self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY} else if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight} else{yScroll=document.body.offsetHeight}
jQuery("#vPIP_TB_window").css({width:vPIP_TB_WIDTH+"px",height:vPIP_TB_HEIGHT+"px",left:((w-vPIP_TB_WIDTH)/2)+"px",top:((h-vPIP_TB_HEIGHT)/2)+"px"});jQuery("#vPIP_TB_overlay").css("height",yScroll+"px")}


/* - upload_form_spinner.js - */
// http://criticalcommons.org/portal_javascripts/upload_form_spinner.js?original=1
$(document).ready(function(){var loading_html='<div id="upload_form_spinner"><p><b>Please be patient while your file is uploading. It may take a long time. Thanks.</b> <p> <img id="loading" src="ajax-loader.gif"/></p></p></div>';$('form#atengagevideo-base-edit').find('#file_file').each(function(){$('#file_file').after(loading_html);$('#upload_form_spinner').hide()});$('form#atengagevideo-base-edit').submit(function(){$('form#atengagevideo-base-edit').find('#file_file').each(function(){$('#upload_form_spinner').show();alert("You are about to start uploading. Please be patient, as this may take some time. Don't close your browser or click 'Save' again. Thanks!");setTimeout('document.images["loading"].src = document.images["loading"].src',1)})})});
