


var myBrowserValue = 0;
var myTimer = null;
var mySwf = 0;
var myQt = 0;
myPlugins();
whichBrowser();
// IMAGE INITIALIZATION
imag = new Array();
imag[0] = "http://www.ithacaevents.com/images/spacer.gif";
imag[1] = "http://www.ithacaevents.com/images/nav_home_off.gif";
imag[2] = "http://www.ithacaevents.com/images/nav_home_on.gif";
imag[3] = "http://www.ithacaevents.com/images/nav_help_off.gif";
imag[4] = "http://www.ithacaevents.com/images/nav_help_on.gif";
imag[5] = "http://www.ithacaevents.com/images/nav_terms_off.gif";
imag[6] = "http://www.ithacaevents.com/images/nav_terms_on.gif";
imag[7] = "http://www.ithacaevents.com/images/nav_visitor_off.gif";
imag[8] = "http://www.ithacaevents.com/images/nav_visitor_on.gif";
imag[9] = "http://www.ithacaevents.com/images/nav_search_off.gif";
imag[10] = "http://www.ithacaevents.com/images/nav_search_on.gif";
imag[11] = "http://www.ithacaevents.com/images/nav_home_browse_off.gif";
imag[12] = "http://www.ithacaevents.com/images/nav_home_browse_on.gif";
imag[13] = "http://www.ithacaevents.com/images/nav_home_more_off.gif";
imag[14] = "http://www.ithacaevents.com/images/nav_home_more_on.gif";
imag[15] = "http://www.ithacaevents.com/images/csda.gif";
imag[16] = "http://www.ithacaevents.com/images/ceda.gif";
imag[17] = "http://www.ithacaevents.com/images/cseda.gif";
imag[18] = "http://www.ithacaevents.com/images/nav_previous_off.gif";
imag[19] = "http://www.ithacaevents.com/images/nav_previous_on.gif";
imag[20] = "http://www.ithacaevents.com/images/nav_helpcontext_off.gif";
imag[21] = "http://www.ithacaevents.com/images/nav_helpcontext_on.gif";
imag[22] = "http://www.ithacaevents.com/images/nav_logout_off.gif";
imag[23] = "http://www.ithacaevents.com/images/nav_logout_on.gif";
imag[24] = "http://www.ithacaevents.com/images/nav_administration_home_off.gif";
imag[25] = "http://www.ithacaevents.com/images/nav_administration_home_on.gif";
imag[26] = "http://www.ithacaevents.com/images/nav_producer_home_off.gif";
imag[27] = "http://www.ithacaevents.com/images/nav_producer_home_on.gif";
imag[28] = "http://www.ithacaevents.com/images/dy.gif";
im = new Array();
for (var i = 0; i < imag.length; i++) {
	im[i] = new Image()
	im[i].src = imag[i]
}
function myChangeImage(num,imgname,divname){
	if ((divname)&&(myBrowserValue==2)) {
		if (divname=="cbuttons") { document.cback.document.images[imgname].src = im[num].src; }
	}
	else { document.images[imgname].src = im[num].src }
}
function myPop(myFile, myWidth, myHeight, myToolbar, myStatusbar, myScrollbars, myResizeable, myLocationbar, myMenubar) {
	myInsert="";
	if (myWidth == null) {myWidth = 300;}
	if (myHeight == null) {myHeight = 300;}
	if (myStatusbar==1) {myInsert+="status=1,";} else {myInsert+="status=0,";}
	if (myLocationbar==1) {myInsert+="location=1,";} else {myInsert+="location=0,";}
	if (myScrollbars==1) {myInsert+="scrollbars=1,";} else {myInsert+="scrollbars=0,";}
	if (myMenubar==1) {myInsert+="menubar=1,";} else {myInsert+="menubar=0,";}
	if (myResizeable==1) {myInsert+="resizable=1,";} else {myInsert+="resizable=0,";}
	if (myToolbar==1) {myInsert+="toolbar=1,";} else {myInsert+="toolbar=0,";}
	myInsert += "width="+myWidth+",height="+myHeight;
	if(myFile.search(/clndr.php/)!=-1) {
		calWin = window.open(myFile,'calWin',myInsert);
		calWin.focus();
	}
	else {
		newWin = window.open(myFile,'newWin',myInsert);
		newWin.focus();
	}
}
function whichBrowser() {
	var platforminfo = new Array()
	if (navigator.userAgent.search(/MSIE/) != -1) {
		platformInfo = navigator.appVersion.split(';');
		myBrowser = navigator.appName + " " + platformInfo[1].substr(6);
		myPlatform = platformInfo[2];
		myBrowserValue = 1;
	}
	else if(navigator.userAgent.search(/Netscape6/) != -1){
		platformInfo = navigator.appVersion.split(' ');
		myBrowser = navigator.appName + " " + platformInfo[0];
		myPlatform = platformInfo[1].substr(1);
		myBrowserValue = 3;
	}
	else if(navigator.userAgent.search(/Gecko/) != -1){
		platformInfo = navigator.appVersion.split(' ');
		myBrowser = navigator.appName + " " + platformInfo[0];
		myPlatform = platformInfo[2].substr(1);
		myBrowserValue = 4;
	}
	else if (navigator.userAgent.search(/Mozilla/) != -1) {
		platformInfo = navigator.appVersion.split(' ');
		myBrowser = navigator.appName + " " + platformInfo[0];
		myPlatform = platformInfo[2].substr(1);
		myBrowserValue = 2;
	}
	else {
		document.write("NEITHER<br>");
		myBrowser=navigator.appName;
		myPlatform = navigator.userAgent;
		myBrowserValue = 4;
	}
}
function changeLayer(myLayer, myAction) {
	if (myBrowserValue == 2) {
		document.layers[myLayer].visibility = myAction;
	}
	else if (myBrowserValue == 1) {
		if (myAction=="show") { myAction = "visible"; }
		else { myAction = "hidden"; }
		document.all[myLayer].style.visibility = myAction;
	}
	else if (myBrowserValue == 3) {
		if (myAction=="show") { myAction = "visible"; }
		else { myAction = "hidden"; }
		document.getElementById(myLayer).style.visibility = myAction;
	}
	else {
		//alert("Browser Unknown");
		if (myAction=="show") { myAction = "visible"; }
		else { myAction = "hidden"; }
		document.getElementById(myLayer).style.visibility = myAction;
	}
}
function myWatcher(myLayer, myTimer) {
	myTimer = setTimeout("changeLayer(myLayer,\"hide\")", 1250);
}
function myCancel() {
	self.clearTimeout(theTimer);
}
function myVerify() {
	for (i=0;i<document.myForm.elements.length;i++) {
		if ((document.myForm.elements[i].name=="username")&&(document.myForm.elements[i].value=="demo")) {
			location = "/~ithacamed/client/index.php4";
			return false;
		}
	}
}
function myV() {
	var myError = "";
	for(i=0;i<document.myForm.elements.length;i++) {
		for(c=0;c<myElementCheckList.length;c++) {
			if ((document.myForm.elements[i].name==myElementCheckList[c])&&(document.myForm.elements[i].value=="")) {
					if(ereport[i]) { myError += ereport[i]+"\n"; }
					else { myError += document.myForm.elements[i].name.replace(/_/g, " ")+"\n"; }
			}
		}
	}
	if (myError != "") {
		alert("Please fill out the following field(s):\n"+myError);
		return false
	}
	else {
		return true
	}
}
function myScreen() {
	//I like to design to 750 X 550 or even 520, but let me know what standards you have?
	if (myBrowserValue == 1) { myWidth = 750 - document.body.clientWidth; myHeight = 550 -
	document.body.clientHeight; resizeBy(myWidth,myHeight); }
	else if ((myBrowserValue == 2) || (myBrowserValue ==3)) { resizeTo(750,550); }
}
function myPlugins() {
	if (navigator.mimeTypes) {
		for (i = 0; i < navigator.mimeTypes.length; i++) {
			if (navigator.mimeTypes[i].suffixes.search('swf') != -1) { mySwf = 1; }
			if (navigator.mimeTypes[i].suffixes.search('mov') != -1) { myQt = 1; }
		}
	}
}
function myClientLogout() {
	location="http://www.ithacaevents.com/logout.php";
}
function checkDelete(thisCheck) {
	var theCheck  = "document.myForm."+thisCheck+".checked";
	if(theCheck) {
		if(confirm("Are you sure?")==false) { return false; }
	}
}
function editJump(thisId) {
	document.editForm.prid.value=thisId;
	document.editForm.submit();
}
function viewP(thisId) {
	document.viewForm.prid.value=thisId;
	document.viewForm.submit();
}
function clndr(thisVar,thatVar) {
	myLoc="http://www.ithacaevents.com/clndr.php";
	if(thisVar=="pc") { myLoc+="?pc=1"; }
	else if(thisVar!=null) { myLoc+="?osd="+thisVar; }
	if(thatVar!=null) { myLoc+="&oed="+thisVar; }
	myPop(myLoc,232,202);
}
function ati(thisEvent) {
	var etime = new Date();
	etime.setHours(etime.getHours() + 1);
	allTheCookies = document.cookie;
	if(allTheCookies) {
		if(allTheCookies.search("tineven=")!=-1) {
			//append ie in cookie
			var dtime = new Date();
			dtime.setFullYear(dtime.getFullYear() - 1);
			var ycook = new Array();
			ycook=allTheCookies.split("; ");
			for(x=0;x<ycook.length;x++) {
				if(ycook[x].search("tineven")!=-1) {
					thecook=ycook[x].substr(8,ycook[x].length);
					myNewCookie = thecook+"db9p"+thisEvent+";";
					document.cookie = "tineven="+myNewCookie+";expires=" + etime.toGMTString() + ";path=/;";
				}
			}
		}
		else {
			//add ie to cookie
			document.cookie = "tineven=" + thisEvent + ";expires=" + etime.toGMTString() + ";path=/;";
		}
	}
	else {
		//set new cookie
		document.cookie = "tineven=" + thisEvent + ";expires=" + etime.toGMTString() + ";path=/;";
	}
}
function letmeclearmythroat(thisBite) {
	allTheCookies = document.cookie;
  	var dtime = new Date();
	var etime = new Date();
	myNewCookie='';
	myCookie='';
	dtime.setFullYear(dtime.getFullYear() - 1);
	etime.setHours(etime.getHours() + 1);
	var ccook = new Array();
	ccook=allTheCookies.split("; ");
	for(x=0;x<ccook.length;x++) {
		if(ccook[x].search("tineven")!=-1) {
			myCookie=ccook[x].substr(8,ccook[x].length);
			if(thisBite) {
				myAlmostNewCookie = myCookie.replace(thisBite,'');
				myNewCookie = myAlmostNewCookie.replace("db9pdb9p","db9p");
				myncookie = "tineven="+myNewCookie+";expires=" + etime.toGMTString() + ";path=/;";
			  	document.cookie = myncookie;
			}
			else {
			  	document.cookie = "tineven="+myCookie+"; expires=" + dtime.toGMTString() + ";path=/;";
			}
		}
		myUrl = location;
		location=myUrl;
	}
}