
		var ifclick=false;
		 var startCellx=-1,startCelly=-1;
		 var prvTable=null;
		 var currentDate;
		 
		function bbimg(o)
		{
			//var oTable=o.getElementsByTagName("TABLE")[0];
			//var oDIV=o.getElementsByTagName("DIV")[0];
			
			var zoom=parseInt(o.style.zoom, 10)||100;
			zoom+=event.wheelDelta/12;
			if (zoom>0) 
				o.style.zoom=zoom+'%';
				
			
			return false;
		}
		
		 function openWin(id)
		 {
			if(id=='0')
			{
				drp = document.getElementById("drpAccessLevel");
				drpAccess = drp.options[drp.selectedIndex].value;

				sUrl="Appointment.aspx?CurrentDate="+currentDate+"&drpAccess="+drpAccess;
			}
			else
				sUrl="Appointment.aspx?ID="+id;
			newWin=window.open(sUrl,'Appointment','status=yes,menubar=no,address=no,scrollbars=no,resizable=yes,top=100,left=100,width=660,height=418');////
			newWin.focus();
		 }
		 
		 function initCal(selectedDate)
		 {
			if (document.all && document.getElementById)
			{  
				navRoot = document.getElementById("Calendar1");
				tbody = navRoot.childNodes[0];
				for (i = 2; i < tbody.childNodes.length; i++)
				{
					node = tbody.childNodes[i];
       				if (node.nodeName == "TR")
					{
						for(var j=0;j<node.cells.length;j++)
						{
							var cell=node.cells[j];
							cDate=cell.getAttribute("currentDate");
							if(cDate==selectedDate)
							{
								tableX=cell.getElementsByTagName("TABLE")[0];
								if(prvTable!=null)
								{
									tableBody=prvTable.childNodes[0];
									nodeX = tableBody.childNodes[0];
									nodeX.className =nodeX.className.replace(" selectedONHeader", "");
									nodeX.style["color"]="";
								}
								prvTable=tableX;
									
								//tableX=this.getElementsByTagName("TABLE")[0];
								if(tableX!=null)
									{
										tableBody=tableX.childNodes[0];
										//alert(tableBody.nodeName);
										nodeX = tableBody.childNodes[0];
										//alert(nodeX.nodeName);
										nodeX.className += " selectedONHeader";
										nodeX.style["color"]="white";
									}
								this.focus();
							
							}
						}
					}
				}
			}
			
		 }
		 
		 startHighlight= function()
		{
			if (document.all && document.getElementById)
			{  
			navRoot = document.getElementById("Calendar1");
		    tbody = navRoot.childNodes[0];
		    
		      node = tbody.childNodes[0].cells[0].childNodes[0];

					   var cell0=node.cells[0].childNodes[0];
					   //alert(cell0.innerHTML);
					   
					   if (cell0.tagName == "A")
					   {
					   
					    var hrefstring0 = cell0.href.split("'");

					   	cell0.onclick=function()
						{ 
							//alert(hrefstring0[3]);
							
							tarWin0=parent.document.getElementById('masterFrame').contentWindow;
							
							tarWin0.__doPostBack('Calendar1',hrefstring0[3]);
							
							tarWin1=parent.document.getElementById('iOneFrame').contentWindow;
							
							tarWin1.__doPostBack('Calendar1',hrefstring0[3]);
							


						}
					   }
					   
					   
					   var cell1=node.cells[2].childNodes[0];
					   //alert(cell1.innerHTML);
					   
					   if (cell1.tagName == "A")
					   {
					   
					    var hrefstring1 = cell1.href.split("'");

					   	cell1.onclick=function()
						{ 
							//alert(hrefstring1[3]);
							tarWin3=parent.document.getElementById('masterFrame').contentWindow;
							
							tarWin3.__doPostBack('Calendar1',hrefstring1[3]);
							
							tarWin4=parent.document.getElementById('iOneFrame').contentWindow;
							
							tarWin4.__doPostBack('Calendar1',hrefstring1[3]);
							


						}
					   }
					   
	
			for (i = 2; i < tbody.childNodes.length; i++)
			{
				node = tbody.childNodes[i];
       			if (node.nodeName == "TR")
				{
					for(var j=0;j<node.cells.length;j++)
					{
						var cell=node.cells[j];
						
						//var cellX=cell.getElementsByTagName("A");
						
						//alert(cell.nodeName);
						cell.onmouseover=function()
						{
							
							this.className += " TDOver"; 
												
							currentDate=this.getAttribute("currentDate");
							//txt1.value=cellx[0].innerHTML;//innerText;
							//cellx[0].innerHTML="<span style='BACKGROUND-COLOR: blue'>"+cellx[0].innerText+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>";
							
						}
				        
						cell.onmouseout=function()
						{
							this.className = this.className.replace(" TDOver", "");

							//cellx=this.getElementsByTagName("A");  
							//txt1=document.getElementById("TextBox1");
							//txt1.value=cellx[0].innerHTML;//innerText;
							//cellx[0].innerHTML=cellx[0].innerText;
							
							
						}
						
						cell.onmousedown=function()
						{
							ifclick=! ifclick;
							tableX=this.getElementsByTagName("TABLE")[0];
							if(prvTable!=null)
							{
								tableBody=prvTable.childNodes[0];
								nodeX = tableBody.childNodes[0];
								nodeX.className =nodeX.className.replace(" selectedONHeader", "");
							}
							prvTable=tableX;
								
							//tableX=this.getElementsByTagName("TABLE")[0];
							if(tableX!=null)
								{
									tableBody=tableX.childNodes[0];
									//alert(tableBody.nodeName);
									nodeX = tableBody.childNodes[0];
									//alert(nodeX.nodeName);
									nodeX.className += " selectedONHeader";
								}
							this.focus();
							
						}
						
						cell.onmouseup=function()
						{
							tarWin=parent.document.getElementById('iOneFrame').contentWindow;
							document.getElementById("txtCurrentDate").value=currentDate;
							parent.document.getElementById("txtCurrentDate").value=currentDate;
							sUrl="CalendarOne.aspx?CurrentDate="+currentDate;
							tarWin.location.replace(sUrl);
						}						
						
					}
				}
			}
		     
			}
		}
		
				  
		function addLoadEvent(func)
		{
			var oldonload = window.onload;
			if (typeof window.onload != 'function') 
			{
				window.onload = func;
				//alert("A");
			}
			else
			{
				window.onload = function()
				{
					oldonload();
					func();
					//alert("B");
				}
			}
		}
