function getPopLeft(_1){
var _2=50;
if(screen.availWidth){
_2=(screen.availWidth-_1)/2+(screen.availLeft==undefined?0:screen.availLeft);
}
return _2;
};
function getPopTop(_3){
var _4=50;
if(screen.availHeight){
_4=(screen.availHeight-_3)/2;
}
return _4;
};
function popReminder(_5,_6){
window.open("EditReminder.html?cal_item_id="+_5+"&integral="+_6,"EditReminder_"+(new Date().getTime()),"scrollbars=yes,status=no,location=no,menubar=no,toolbar=no,width=800,height=400,left="+getPopLeft(800)+",top="+getPopTop(500));
};
function popItem(_7,_8,_9,_a,_b){
if(_b==undefined){
if(!(typeof style_sheet=="undefined")){
_b=style_sheet;
}
}
if(_a==undefined){
if(!(typeof checkafter=="undefined")){
_a=checkafter;
}
}
if(_9==undefined){
if(!(typeof integral=="undefined")){
_9=integral;
}
}
window.open("ViewItem.html?integral="+(_9==undefined?0:(_9?1:0))+"&detail="+(_9?1:0)+"&cal_item_id="+_7+(((_8==undefined)||(_8<0))?"":"&dtwhen="+_8)+(_b==undefined?"":"&style_sheet="+_b)+(_a==undefined?"":"&checkafter="+_a),"ViewItemWin_"+(new Date().getTime()),"scrollbars=yes,resizable=yes,status=no,location=no,menubar=no,toolbar=no,width=670,height=500,left="+getPopLeft(620)+",top="+getPopTop(500));
};
var pWidth,pHeight,pZ;
function widenDiv(_c){
var _d=document.getElementById(_c);
if(_d){
with(_d.style){
pWidth=width;
pHeight=height;
pZ=zIndex;
zIndex=99;
width="auto";
height="auto";
}
}
};
function shrinkDiv(_e,_f,_10){
var _11=document.getElementById(_e);
if(_11){
with(_11.style){
zIndex=pZ;
width=pWidth;
height=pHeight;
}
}
};
function sizeWindow(){
var _12=document.getElementById("ContentDiv");
var _13=navigator.userAgent.toLowerCase().indexOf("msie")>0;
var _14=document.body.scrollWidth;
var _15=document.body.scrollHeight;
var _16;
if(_13){
_16=_15-document.documentElement.clientHeight+30;
}else{
_16=_15-window.innerHeight+30;
}
if(screen.availHeight){
if(_16>screen.availHeight){
_16=screen.availHeight;
}
}
if(window.moveTo){
window.moveTo((screen.availWidth-_14)/2,(screen.availHeight-_15)/2);
}
window.resizeBy(0,_16);
};
function sizeWindowOld(){
var _17,_18,_19,_1a;
var _1b=navigator.userAgent.toLowerCase().indexOf("msie")>0;
if(_1b){
_19=document.body.clientWidth;
_1a=document.body.clientHeight;
alert(document.body.scrollHeight+" clientHeight="+document.body.scrollHeight);
}else{
_1a=window.innerHeight;
_19=window.innerWidth;
_1a=document.body.scrollHeight;
_19=document.body.scrollWidth;
}
if(screen.availHeight){
}
window.resizeTo(_19+30,_1a+40);
if(window.moveTo){
window.moveTo((screen.availWidth-_18)/2,(screen.availHeight-_17)/2);
}
};
function popObjectLogEntries(_1c,_1d){
window.open("ViewLogEntriesForObject.html?object_type_id="+_1c+"&object_id="+_1d,"ViewLEObj_"+(new Date().getTime()),"scrollbars=yes,status=no,location=no,menubar=no,toolbar=no,width=800,height=400,left="+getPopLeft(800)+",top="+getPopTop(500));
};
function getReqObj(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}else{
try{
return new ActiveXObject("Microsoft.XMLHttp");
}
catch(finalFailure){
return false;
}
}
};
function getRemoteText(_1e,_1f){
var _20=getReqObj();
var _21=_1f;
var _22=_1e;
if(_20){
try{
_20.open("GET",_22);
_20.onreadystatechange=function(){
if(_20.readyState==4){
if(_20.status==200){
_1f(_20.responseText,_20.status);
}else{
_1f(_20.statusText+" URL: ["+_22+"]",_20.status);
}
delete _20;
_20=null;
}
};
_20.send(null);
}
catch(eOpen){
_1f((eOpen.description?eOpen.description:eOpen)+" URL: ["+_22+"]",400);
return;
}
}
};
function getRemoteXML(_23,_24){
var _25=getReqObj();
var _26=_24;
var _27=_23;
if(_25){
try{
_25.open("GET",_27);
_25.onreadystatechange=function(){
if(_25.readyState==4){
if(_25.status==200){
_24(_25.responseXML,_25.status);
}else{
_24(_25.statusText+" URL: ["+_27+"]",_25.status);
}
delete _25;
_25=null;
}
};
_25.send(null);
}
catch(eOpen){
_24((eOpen.description?eOpen.description:eOpen)+" URL: ["+_27+"]",400);
return;
}
}
};
function getNode(_28,_29){
var o=_28.firstChild;
while(o!=null){
if(o.nodeName==_29){
return o;
}
o=o.nextSibling;
}
return null;
};
function getNodeValue(_2b,_2c){
var o=getNode(_2b,_2c);
if(o==null){
return null;
}
return o.firstChild.nodeValue;
};
function convertDisplayTypeToPath(_2e){
var s;
switch(_2e){
case 0:
s="calendar_id";
break;
case 1:
s="resource_id";
break;
case 2:
s="resource_type_id";
break;
case 3:
s="item_type_id";
break;
default:
s="calendar_id";
break;
}
return s;
};
function setDayDiv(_30,_31){
if(_31==200){
	var _32=_30.getElementsByTagName("item");
	var s="";
//	alert('_32.length='+_32.length);
	for(var i=0;i<_32.length;i++){
		var _35=_32[i];
		s=s+renderItem(_35);
	}
//	document.getElementById(ContentID).content=s;
	dijit.byId(ContentID).attr('content',"<DIV STYLE='width: 540px; height: 390px; overflow:auto;'>"+s+"</DIV>");
	dijit.byId(ContentID).show();
} else {
	alert(_30);
}
};
function setCalendarDivText(_36,_37){
if(_37==200){
document.getElementById(CalendarID).innerHTML=_36;
}else{
alert(_36);
}
};
function createProxyURL(_38){
return ProxyURL+"?URL="+encodeURIComponent(_38);
};
function navigateDay(_39){
var _3a=CalendarURL+"rss/"+convertDisplayTypeToPath(DisplayBy)+"/"+DisplayID+".xml?start="+_39+"&dayspan=0";
if(ProxyURL){
_3a=createProxyURL(_3a);
}
getRemoteXML(_3a,setDayDiv);
};
function navigateCalendar(_3b){
var _3c=CalendarURL+"ViewMini.html?"+convertDisplayTypeToPath(DisplayBy)+"="+DisplayID;
if(_3b!=0){
_3c=_3c+"&start="+_3b;
}
if(ProxyURL){
_3c=createProxyURL(_3c);
}
getRemoteText(_3c,setCalendarDivText);
};
function getNextDays(_3d){
var _3e=CalendarURL+"rss/"+convertDisplayTypeToPath(DisplayBy)+"/"+DisplayID+".xml?dayspan="+_3d;
if(ProxyURL){
_3e=createProxyURL(_3e);
}
getRemoteXML(_3e,setDayDiv);
};
function simpleList(_3f){
var _40=CalendarURL+"rss/"+convertDisplayTypeToPath(DisplayBy)+"/"+DisplayID+".xml?dayspan=14&maxcount="+_3f;
if(ProxyURL){
_40=createProxyURL(_40);
}
getRemoteXML(_40,renderSimpleList);
};
function makeURLsClickable(_41){
return _41.replace(/(ftp|http|https|file):\/\/[\S]+(\b|$)/gim,"<a href=\"$&\" class=\"AjaxLink\" target=\"_blank"+(new Date().getTime())+"\">$&</a>").replace(/([^\/])(www[\S]+(\b|$))/gim,"$1<a href=\"http://$2\" class=\"AjaxLink\" target=\"_blank"+(new Date().getTime())+"\">$2</a>");
};
function formatDescription(_42){
var s=makeURLsClickable(_42);
s=s.replace(/(\r\n|[\r\n])/g,"<br>");
return s;
};
function formatRFCDate(s){
var _45;
var _46=new Date(Date.parse(s));
if(_46.getHours()==0&&_46.getMinutes()==0&&_46.getSeconds()==0){
_45=_46.toLocaleDateString();
}else{
_45=_46.toLocaleString();
}
return _45;
};
function renderItem(_47){
var s="<H3 Class=AjaxItem>";
var _49,_4a;
_49=getNodeValue(_47,"title");
s=s+_49;
s=s+"</H3><DL Class=AjaxItem>";
_49=getNodeValue(_47,"cdaily:eventStartDate");
s=s+"<DT>When<DD>"+formatRFCDate(_49);
_49=getNodeValue(_47,"cdaily:addlInfoURL");
if(_49!=null){
s=s+"<DT>URL<DD><A CLASS=AjaxLink TARGET=_BLANK HREF=\""+_49+"\">"+_49+"</A>";
}
_49=getNodeValue(_47,"cdaily:contactName");
var _4b=_49;
if(_49!=null){
s=s+"<DT>Contact<DD>"+_49;
}
_49=getNodeValue(_47,"cdaily:contactInfo");
if(_49!=null){
if(_4b==null){
s=s+"<DT>Contact<DD>";
}
s=s+" ";
if(_49.indexOf("@")>0){
s=s+"<A HREF=\"MAILTO:"+_49+"\">"+_49+"</A>";
}else{
s=s+_49;
}
}
_49=getNodeValue(_47,"description");
if(_49!=null){
s=s+"<DT>Description<DD>"+formatDescription(_49);
}
s=s+"</DL>";
return s;
};
function renderSimpleList(_4c,_4d){
if(_4d==200){
var _4e=_4c.getElementsByTagName("item");
var s="<UL Class=AjaxItemList>";
for(var i=0;i<_4e.length;i++){
var _51=_4e[i];
var _52=getNodeValue(_51,"link"),_53=getNodeValue(_51,"title");
s=s+"<LI><A _TARGET=_AJAXITEM Class=AjaxLink HREF=\""+_52+"\">"+_53+"</A>";
renderItem(_51);
}
s=s+"</UL>";
document.getElementById(ContentID).innerHTML=s;
}else{
alert(_4c);
}
};


