	function setSearchCalendars() {
		var tim = new Date();
		var sd = tim.getDate();
		var sm = tim.getMonth()+1;
		var sy = tim.getFullYear();
		
		var ted = new Date(sy,sm,sd);
		
		if(sm < 10) {
			sm = "0"+sm;
		}
		if(sd < 10) {
			sd = "0"+sd;
		}
		
		
		
		var ed = ted.getDate();
		var em = ted.getMonth()+1;
		var ey = ted.getFullYear();
		if(em < 10) {
			em = "0"+em;
		}
		if(ed < 10) {
			ed = "0"+ed;
		}
		dijit.byId("sse").setValue(tim,true);
		dijit.byId("ese").setValue(ted,true);

				
	}


	function changeView(v) {
			var win = window.location.href;
			var tm = "";
			if(win.indexOf("t=") > -1) {
				tm = "&t="+win.substring(win.indexOf("t=")+2);
			}
			pg =win.substring(win.lastIndexOf("/")+1,win.indexOf(".jsp"));
        	if(pg != "calendars" ) {
            	pg = "view";
        	}

        	window.location.href = pg+".jsp?m="+v+tm;
		}

	function changeFilter(frm) {
		var win = window.location.href;
		if(win.indexOf("t=") > -1) {
			frm.t.value = win.substring(win.indexOf("t=")+2);
		}
		if(win.indexOf("m=") > -1) {
			frm.m.value = win.substring(win.indexOf("m=")+2).substring(0,1);
		}
		frm.submit();
	}

		function changeCalendarMonth() {
			eke = new Array();
			eke["January"]=0;
			eke["February"]=1;
			eke["March"]=2;
			eke["April"]=3;
			eke["May"]=4;
			eke["June"]=5;
			eke["July"]=6;
			eke["August"]=7;
			eke["September"]=8;
			eke["October"]=9;
			eke["November"]=10;
			eke["December"]=11;
			cmonthdiv = document.getElementById("cal").getElementsByTagName("thead")[0].getElementsByTagName("tr")[0].getElementsByTagName("th")[1].getElementsByTagName("div")[13];
			kee = cmonthdiv.innerHTML;
			cyeardiv = document.getElementById("cal").getElementsByTagName("tfoot")[0].getElementsByTagName("tr")[0].getElementsByTagName("h3")[0].getElementsByTagName("span")[1];

//			alert(cyeardiv);
			chris = new Date(cyeardiv.innerHTML, eke[kee], 1);
			
			window.location.href="view.jsp?m=m&t="+chris.getTime();

		}
		
    	function changeCalendarDay(evt) {
    		win = window.location.href;
			pg =win.substring(win.lastIndexOf("/")+1,win.indexOf(".jsp"));
        	if(pg != "calendars" ) {
            	pg = "view";
        	}

        	
    		node = evt.target;
			while(!node.dijitDateValue){
				node = node.parentNode;
			}
	    	if(node.className.indexOf("CurrentMonth") > -1) {
		    	window.location.href=pg+".jsp?m=d&t="+node.dijitDateValue;
	    	}
       	}

       	function UpdateTabs() {
			var s = window.location.href.indexOf("m=")+2;
			e = s+1;
			tab = window.location.href.substring(s,e);
			dt = document.getElementById("x");
			wt = document.getElementById("w");
			mt = document.getElementById("m");
			at = document.getElementById("a");
			dt.className="off";
			wt.className="off";
			mt.className="off";
			at.className="off";
			
			if(tab=="m") {
				mt.className="activeTab";
			} else if(tab == "w") {
				wt.className="activeTab";
			} else if(tab == "d") {
				dt.className="activeTab";
			} else {
				at.className="activeTab";
			}

       	}
	
	function changeTView(v,tc) {
			var win = window.location.href;
			var tm = "";
			if(win.indexOf("t=") > -1) {
				tm = "&t="+win.substring(win.indexOf("t=")+2);
			}
			pg =win.substring(win.lastIndexOf("/")+1,win.indexOf(".jsp"));
        	if(pg != "fortune" ) {
            	pg = "view";
        	}
//alert(pg+".jsp?m="+v+tm+"tcal="+tc);
		gto = pg+".jsp?m="+v+tm;
		if(gto.indexOf("tcal") < 0) {
			gto = gto +"&tcal="+tc;
		}
        	window.location.href = gto;

		}

