document.write("");
document.write("");
///////////////////////////////////////////////////////
//
// localendar.com - Common.js
//
///////////////////////////////////////////////////////
var ppcIE =((navigator.appName == "Microsoft Internet Explorer") || ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5)));
var ppcNN6 =((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5));
var ppcNN =((navigator.appName == "Netscape")&&(document.layers)) ;
var posX = 4;
var posY = 4;
var now = new Date(); //"<= startDate >");
function today()
{
var result = ""
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = (d.getFullYear()+"").substring(2,4);
if (curr_month<10)
result+="0";
result += curr_month + "-";
if (curr_date<10)
result+="0";
result+=curr_date + "-" + curr_year;
return result
}
function getPos(atImg)
{
// MO: Using jQuery to get position 2/1/10
var position=$('#'+atImg).offset();
posX=position.left;
posY=position.top;
/*
if ( ppcIE )
{
posX = getOffsetLeft(document.images[atImg]);
posY = getOffsetTop(document.images[atImg]) + document.images[atImg].height;
}
else if (ppcNN)
{
posX = document.images[atImg].x;
posY = document.images[atImg].y + document.images[atImg].height;
}
*/
}
function fn_chg_color(lcfield,pcolor){
fn_chk_color(lcfield,pcolor);
}
function fn_chk_color(lcfield,pcolor){
var numStr = "0123456789ABCDEFabcdef";
if (pcolor.length==0) return true;
for (i = 0; i < pcolor.length; i++) {
thisChar = pcolor.charAt(i);
if (numStr.indexOf(thisChar) == -1){
alert("Please enter a valid six character hexidecimal color value.");
lcfield.value = '';
return false;
}
}
if (pcolor.length!=6){
alert("Please enter a valid six character hexidecimal color value.");
lcfield.value = '';
return false;
}
lcfield.value = pcolor;
return true;
}
function validateNewUser(lcform){
if (( !isEmail(lcform)) || (! checkZip(lcform)) || (! isName(lcform)) || (! checkPassword(lcform)) || (! checkAgree(lcform)))
return false;
return true;
}
function checkSelect(lcform){
var w = eval("document." + lcform.name + ".event_category");
var count = 0;
for (var x = 0; x < w.length; x++)
{
if (lcform.event_category[x].checked)
{ count++ }
}
if (count == 0 )
{
alert("\No categories selected.\n\nPlease select at least one category.")
lcform.event_category[0].focus();
return false;
}
return true;
}
function category_check(lcform,pvalue){
var w = eval("document." + lcform.name + ".event_category");
for (var x = 0; x < w.length; x++) {
if (pvalue == 'all'){
w[x].checked = true;
}else {
w[x].checked = false;
}
}
}
function popup(info){
var view_window;
var lcf;
info=info.toUpperCase();
if (info=="HELP") lcf="FAQ";
if (info=="LEGAL") lcf="Legal";
if (info=="A1CLEGAL") lcf="A1CLEGAL";
if (info=="PRIVACY") lcf="Privacy";
if (info=="A1CPRIVACY") lcf="A1CPRIVACY";
// if (info=="PRINTCAL") lcf="PrintableCalendar";
view_window = window.open("/elsie?JSP="+lcf+"&context=None", "localendar", "width=500,height=500,scrollbars=yes,resizable=yes");
view_window.focus();
}
function popupEventAdd()
{
view_window = window.open("/elsie?JSP=EventEditorAnon", "localendar", "width=545,height=550,menubar=yes,scrollbars=yes,resizable=yes");
}
function popupPrintableCalendar()
{
var view_window = window.open("/elsie?JSP=PrintableCalendar&context=None", "printablelocalendar", "toolbar=yes,menubar=yes,width=700,height=600,scrollbars=yes,resizable=yes");
view_window.focus();
}
function lc_navjump(p_direction,p_menutype,p_startdate){
window.location.href="/elsie?JSP=Calendar&mode=MONTH_"+p_direction+"&menu_type="+p_menutype+"&start_date="+p_startdate;
}
function lc_dayjump(p_menutype,p_date){
window.location.href="/elsie?JSP=Calendar&menu_type="+p_menutype+"&start_date="+p_date;
}
function lc_weekjump(p_menutype,p_date){
window.location.href="/elsie?JSP=Calendar&menu_type="+p_menutype+"&start_date="+p_date;
}
function lc_monthjump(p_menutype,p_date){
window.location.href="/elsie?JSP=Calendar&menu_type="+p_menutype+"&start_date="+p_date;
}
/*
function lc_publishjump(p_menutype,p_date,p_calendarid,p_rsslink){
window.location.href="/elsie?JSP=PublishedCalendar&mode=PUBLISH_PUBLIC&search_type="+p_menutype+"&start_date="+p_date+"&calendar_id="+p_calendarid+"&rss_link="+p_rsslink;
}
*/
function lc_searchjump(p_zip,p_radius,p_date,p_type){
window.location.href="/elsie?JSP=SearchResults&mode=ADVSEARCH&zip="+p_zip+"&radius="+p_radius+"&start_date="+p_date+"&search_type="+p_type;
}
function lc_pubsearchjump(p_zip,p_radius,p_date,p_type){
window.location.href="/elsie?JSP=PublishedSearch&mode=PUBSEARCH&zip="+p_zip+"&radius="+p_radius+"&start_date="+p_date+"&search_type="+p_type;
}
function HelpWindow(vers){
var view_window;
view_window = window.open("/elsie?JSP="+vers+"FAQ&context=None", vers+"FAQ","width=500,height=500,scrollbars=yes,resizable=yes");
view_window.title = "FAQ";
view_window.focus();
}
function AddEvent(){
window.location.href="/elsie?DAM=EventEditor"
}
function Preferences(){
window.location.href="/elsie?JSP=PreferencesGeneral"
}
function Search(){
window.location.href="/elsie?JSP=Search"
}
function PublicEventDetail(m, calendar_id,event_id,more_info,exportDate,category)
{
var detail_window = window.open("http://www.localendar.com/event?DAM=PublishedEvent&m="+m+"&event_id="+event_id+"&calendar_id="+calendar_id+"&more_info="+more_info+"&export_date="+exportDate+"&category="+category, "previewevent","width=400,height=400,scrollbars=yes,resizable=yes");
detail_window.focus();
}
function zipSearchSubmit(lcform)
{
var c = lcform.city.value;
if (c.length < 3)
{
alert ("Please enter at least the first 3 characters of the city");
return false;
}
return true;
}
function checkAdvSearch(lcform)
{
if ((! checkZip(lcform)) || (! checkSelect(lcform)))
return false;
else
return true;
}
function prefsEventsSubmit(lcform)
{
if (checkZip(lcform))
return true;
else
return false;
}
function prefsGeneralSubmit(lcform)
{
if (checkDayViewRange(lcform))
return true;
else
return false;
}
function isNumber(data)
{
var numStr = "0123456789";
for (i = 0; i < data.length; i++)
{
thisChar = data.charAt(i);
if (numStr.indexOf(thisChar) == -1)
return false;
}
return true;
}
function checkZip(lcform)
{
var zipcode = lcform.zip.value;
if ((!isNumber(zipcode)) || zipcode == "" || zipcode.length != 5)
{
alert ("You must enter a valid 5 digit zipcode.");
lcform.zip.focus();
return false;
}
return true;
}
function checkDayViewRange(lcform)
{
var dayStart = lcform.dayStart.selectedIndex+1;
var dayEnd = lcform.dayEnd.selectedIndex+1;
if (dayEnd<=dayStart)
{
alert ("Please make sure the day-view 'To:' hour is later than the 'From:' hour.");
lcform.dayStart.focus();
return false;
}
return true;
}
// if you put one space in then it passes
function checkSubject(lcform)
{
var subject = lcform.event_title.value;
if (subject == "")
{
alert ("To schedule an event, you must enter an event title.");
lcform.event_title.select();
return false;
}
return true;
}
function checkChangeMemberLogon(lcform)
{
var str = lcform.username.value;
// Return false if characters are not a-z, A-Z, or 1-9.
for (var i = 0; i < str.length; i++)
{
var ch = str.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch)) || ch ==' ' && ch != '.')
{
if (ch!='_' && ch!='-')
{
alert("\nThe Member Name only accepts letters & numbers (spaces are not allowed).\n\nPlease change your member name.");
lcform.username.select();
lcform.username.focus();
return false;
}
}
}
return true;
}
function isName(lcform)
{
var str = lcform.username.value;
// Return false if name field is blank.
if (str == "")
{
alert("\nThe Member Name is blank.\n\nPlease enter your member name.")
lcform.username.focus();
return false;
}
return checkChangeMemberLogon(lcform);
}
function isEmail(lcform)
{
// Return false if e-mail field is blank.
var str = lcform.email.value;
if (str == "")
{
alert("\nThe Email Address is blank.\n\nPlease enter your email address.")
lcform.email.focus();
return false;
}
// Return false if e-mail field does not contain a '@' and '.' .
if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1){
alert("\nPlease enter a valid Email Address.")
lcform.email.select();
lcform.email.focus();
return false;
}
return true;
}
function checkPassword(lcform)
{
var pw1 = lcform.password.value;
var pw2 = lcform.confirmpw.value;
// Return false if pw don't match.
if (lcform.password.value == "")
{
alert("\nThe Password is blank.\n\nPlease enter your Password.")
lcform.password.focus();
return false;
}
if (lcform.confirmpw.value == "")
{
alert("\nThe Re-Enter Password field is blank.\n\nPlease re-enter your password.")
lcform.confirmpw.focus();
return false;
}
if (pw1 != pw2)
{
alert("\nPasswords don't match.\n\nPlease check your password.");
lcform.password.select();
lcform.password.focus();
return false;
}
// Return false if characters are not '0-9' or '.' .
for (var i = 0; i < pw1.length; i++)
{
var ch = pw1.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch)) || ch ==' ' && ch != '.')
{
if (ch!='_' && ch!='-')
{
alert("\nThe Password field only accepts letters & numbers (spaces are not allowed).\n\nPlease change your password.");
lcform.password.select();
lcform.password.focus();
return false;
}
}
}
return true;
}
function checkChangePassword(lcform)
{
var old_pw = lcform.password.value;
var new_pw1 = lcform.newpassword.value;
var new_pw2 = lcform.confirmpassword.value;
if (old_pw == "")
{
alert("\nThe Password is blank.\n\nPlease enter your Password.")
lcform.password.focus();
return false;
}
if (new_pw2 == "")
{
alert("\nThe Confirm Password field is blank.\n\nPlease re-enter your password.")
lcform.confirmpassword.focus();
return false;
}
if (new_pw1 != new_pw2)
{
alert("\nNew passwords don't match.\n\nPlease check your password.");
lcform.newpassword.select();
lcform.newpassword.focus();
return false;
}
// Return false if characters are not '0-9' or '.' .
for (var i = 0; i < new_pw1.length; i++)
{
var ch = new_pw1.substring(i, i + 1);
if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch)) || ch ==' ' && ch != '.')
{
if (ch!='_' && ch!='-')
{
alert("\nThe Password field only accepts letters & numbers (spaces are not allowed).\n\nPlease change your password.");
lcform.newpassword.select();
lcform.newpassword.focus();
return false;
}
}
}
return true;
}
function checkAgree(lcform)
{
if (!lcform.agree.checked)
{
alert("Please indicate that you accept the Terms of Service");
lcform.agree.focus();
return false;
}
return true;
}
function EditEvent(event_id,event_public)
{
window.location.href="/elsie?DAM=EventEditor&event_id="+event_id+"&public_event="+event_public;
}
function getRestaurants(zipcode)
{
var view_window;
view_window = window.open("http://www.usrg.com/script/nearzip.asp?ZIP="+zipcode,"localendar","width=800,height=500,scrollbars=yes,resizable=yes");
view_window.focus();
}
function trim(strValue)
{
var intLoop=0;
for(intLoop=0; intLoop=0; intLoop=strValue.length-1)
{
if(strValue.charAt(intLoop)==" ")
strValue=strValue.substring(0,intLoop);
else
break;
}
return strValue;
}
//
// Task-related functions
//
function addTask()
{
window.location.href="/elsie?DAM=EventEditor"
}
function deleteTask(index)
{
if (confirm("Are you sure you want to delete entry\n\""+taskList[index].title+"\" ?"))
window.location.href="/elsie?DAM=TaskEditor&task_id="+taskList[index].tId+"&action=D";
}
function editTask(task_id)
{
window.location.href="/elsie?DAM=TaskEditor&task_id="+task_id;
}
function AnonAddInfo()
{
var view_window;
view_window = window.open("/elsie?JSP=AnonAddInfo", "localendar", "width=475,height=565,scrollbars=no,resizable=yes");
view_window.focus();
}
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML .
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.7a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
**/
/*
PLEASE READ:
Absolutely everything in this script is SILLY. I know this. IE's rendering of certain pixels doesn't make sense, so neither does this code!
*/
var DD_belatedPNG = {
ns: 'DD_belatedPNG',
imgSize: {},
createVmlNameSpace: function() { /* enable VML */
if (document.namespaces && !document.namespaces[this.ns]) {
document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
}
if (window.attachEvent) {
window.attachEvent('onbeforeunload', function() {
DD_belatedPNG = null;
});
}
},
createVmlStyleSheet: function() { /* style VML, enable behaviors */
/*
Just in case lots of other developers have added
lots of other stylesheets using document.createStyleSheet
and hit the 31-limit mark, let's not use that method!
further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
*/
var style = document.createElement('style');
document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild);
var styleSheet = style.styleSheet;
if (styleSheet!=null)
{
try {
styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
styleSheet.addRule(this.ns + '\\:shape', 'position:absolute;');
styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */
} catch(r) {}
this.styleSheet = styleSheet;
}
},
readPropertyChange: function() {
var el = event.srcElement;
if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) {
DD_belatedPNG.applyVML(el);
}
if (event.propertyName == 'style.display') {
var display = (el.currentStyle.display == 'none') ? 'none' : 'block';
for (var v in el.vml) {
el.vml[v].shape.style.display = display;
}
}
if (event.propertyName.search('filter') != -1) {
DD_belatedPNG.vmlOpacity(el);
}
},
vmlOpacity: function(el) {
if (el.currentStyle.filter.search('lpha') != -1) {
var trans = el.currentStyle.filter;
trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */
el.vml.image.fill.opacity = trans; /* complete guesswork */
}
},
handlePseudoHover: function(el) {
setTimeout(function() { /* wouldn't work as intended without setTimeout */
DD_belatedPNG.applyVML(el);
}, 1);
},
/**
* This is the method to use in a document.
* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'
**/
fix: function(selector) {
var selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */
for (var i=0; i size.H) {
c.B = size.H;
}
el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)';
}
else {
el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)';
}
},
fixPng: function(el) {
el.style.behavior = 'none';
if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */
return;
}
el.isImg = false;
if (el.nodeName == 'IMG') {
if(el.src.toLowerCase().search(/\.png$/) != -1) {
el.isImg = true;
el.style.visibility = 'hidden';
}
else {
return;
}
}
else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) {
return;
}
var lib = DD_belatedPNG;
el.vml = {color: {}, image: {}};
var els = {shape: {}, fill: {}};
for (var r in el.vml) {
for (var e in els) {
var nodeStr = lib.ns + ':' + e;
el.vml[r][e] = document.createElement(nodeStr);
}
el.vml[r].shape.stroked = false;
el.vml[r].shape.appendChild(el.vml[r].fill);
el.parentNode.insertBefore(el.vml[r].shape, el);
}
el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */
el.vml.image.fill.type = 'tile'; /* Ze magic!! Makes image show up. */
el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */
lib.attachHandlers(el);
lib.giveLayout(el);
lib.giveLayout(el.offsetParent);
/* set up element */
lib.applyVML(el);
}
};
try {
document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */
} catch(r) {}
DD_belatedPNG.createVmlNameSpace();
DD_belatedPNG.createVmlStyleSheet();
document.write('');
document.write("