	/******* JavaScript Document *****/
	var newW,newH,orgH,orgW;
	
	function ImagePopUp(theImage)
	{
		
		if(window.ImagePopUp.opened){ImagePopUp.close;}
		resizeimage = new Image;
		resizeimage.src = theImage.src;

		newH= resizeimage.height;
		newW= resizeimage.width;

		orgH=theImage.offsetHeight;
		orgW=theImage.offsetWidth;

		/************************* Center image to screen *************************/
		posl = ((screen.Width-newW)/2);
		post =((screen.Height-newH)/3);
		/***************************************************************************/	
		/************************ center image to browser ***************************		
		posl = ((window.document.body.clientWidth/2)-orgW)+window.screenLeft; 
		post =((window.document.body.clientHeight/2)-orgH)+window.screenTop;
		****************************************************************************/	
		newWindow=window.open(resizeimage.src,'ImagePopUp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizeable=1, top='+post+',left='+posl+', width='+newW+',height='+newH);
	//	newWindow.document.write('<html><head><title>Image in full size!<\/title><\/head><body background="'+resizeimage.src+'"><\/body><\/html>');
	//	newWindow.resizeTo(newW-newWindow.document.body.clientWidth, newH-newWindow.document.body.clientHeight);
		newWindow.moveTo(posl,post);
		newWindow.focus();
	}


	function fnOpenFile(file)
	{
		window.open(file);
	}

	function fnErrorBoxClose()
	{
		if(errorbox.style.display == 'none')
		{
			ErrorBox = 'block';
		}
		else
		{
			ErrorBox = 'none';
		}
		errorbox.style.display = ErrorBox;
	}



	var StartSlide = 0;
	var StartSlideCurr = 0;
	var alertTimerId ;
	var childrencount=0;
	function fnSlide(id)
	{
		var divPath = document.getElementById(id); 
		var currPos = divPath.style.left; 
		if(currPos!=''){currPos=parseInt(currPos);}else {currPos=0;}
		divPath.style.position = "relative";

		if(StartSlide == 0) {StartSlide=StartSlide = event.clientX;}		
		

		if (StartSlide-event.clientX > 2) 
		{
			if (StartSlide-event.clientX > 3) 
			{
				if(StartSlideCurr<3)
				{
					clearTimeout ( alertTimerId );
					StartSlideCurr = 3;
					fnTheSlide(id,1);
				}
			}
			else
			{
				clearTimeout ( alertTimerId );
				StartSlideCurr = 0;

			}
		}
		
		else if (StartSlide-event.clientX < -2) 
		{
			if (StartSlide-event.clientX < -3)
			{
				if(StartSlideCurr>-3)
				{
					clearTimeout ( alertTimerId );
					StartSlideCurr = -3;
					fnTheSlide(id,-1);
				}
			}
			else
			{
				clearTimeout ( alertTimerId );
				StartSlideCurr = 0;

			}


		}
			StartSlide = event.clientX;
			childrencount = 0;
			var children = document.getElementById(id).childNodes;
			for (var i=0; i < children.length; i++) 
			{
				childrencount= childrencount + children[i].offsetWidth+10;				

			}
			divPath.style.width = childrencount;	

	}	


	function fnTheSlide(id,SlideCurr)
	{
		var divPath = document.getElementById(id); 
		var currPos = divPath.style.left; 
		if(currPos!=''){currPos=parseInt(currPos);}else {currPos=0;}	
		currPos = currPos + SlideCurr;
		if(currPos>=10){currPos=10;}

		MaxSlide = divPath.offsetWidth-divPath.parentNode.offsetWidth;
		if(MaxSlide <0) {MaxSlide=0;}  
		if(currPos<= -(MaxSlide)){currPos=-MaxSlide;}
	
		divPath.style.left = currPos;
		window.status = id+' '+SlideCurr+' '+currPos+' '+divPath.parentNode.offsetWidth+' '+divPath.offsetWidth+' '+childrencount;
		alertTimerId = setTimeout('fnTheSlide("'+id+'",'+StartSlideCurr+')',20);
		
		
	}

//********************************** Update Calendar *******************************
	function fnCalendar(month,year)
	{ 
		
		var url = window.location; 
		document.getElementById('calendarmonth').value = month;
		document.getElementById('calendaryear').value = year;
		document.getElementById('calendarform').action = url;
		document.getElementById('calendarform').submit();
	}

	//********************************** Update Calendar ****** END **********************
	
	
//******************************** Set Action to X *********************************************************************
	function fnChangeAction(Control,NewAction,ID)
	{
		document.getElementById('Action').value = NewAction;
		document.getElementById(Control).value = ID;
	}
//******************************** Set Action to X ************* END ********************************************************	
