// JavaScript Document

var iCurrentIndex = 1; 
	
		function getCurrentIndex()
		{
			//debugger;
		   iCurrentIndex = parseInt(document.getElementById("hdnCurrentPage").value);	
		   return iCurrentIndex;  		
		}
		function getNextIndex()
		{
			//debugger;
			iCurrentIndex = parseInt(document.getElementById("hdnCurrentPage").value);		
			if (iCurrentIndex >= 3)
			{
				iCurrentIndex = 1;
				document.getElementById("hdnCurrentPage").value = iCurrentIndex;
			}
			else 
			{
				iCurrentIndex = iCurrentIndex + 1; 
				document.getElementById("hdnCurrentPage").value = iCurrentIndex;
			}
		    
			return iCurrentIndex;  
			
			
		}
		function getPriveousIndex()
		{
			//debugger;
     		iCurrentIndex = parseInt(document.getElementById("hdnCurrentPage").value);		
			if (iCurrentIndex <= 1)
			{
				iCurrentIndex = 3;
				document.getElementById("hdnCurrentPage").value = iCurrentIndex;
			}
			else 
			{
				iCurrentIndex = iCurrentIndex - 1; 
				document.getElementById("hdnCurrentPage").value = iCurrentIndex;
			}
			
			return iCurrentIndex;  		
 
		}
		
		function ApplyClass()
		{
			
			/* class names and Seq*/ 
			/* seq 1. Home 2. About 3. Contact*/
			/* current: home   btnPrev:Contact   btnNext:About*/
			/* current: About   btnPrev:Home   btnNext:Contact*/
			/* current: Contact   btnPrev:About   btnNext:Home*/
			//debugger;
			var i = parseInt(document.getElementById("hdnCurrentPage").value);	
			if (i == 1)
			{
				//$("#btnNext").addClass('About');
				//$("#btnPrivious").addClass('Contact');
				document.getElementById("btnNext").className  = "about";
				document.getElementById("btnPrivious").className = "contact"; 
			}
			
			if (i == 2)
			{
				//$("#btnNext").addClass('Contact');
				//$("#btnPrivious").addClass('Home');
				//alert( document.getElementById("btnNext").className);
			    document.getElementById("btnNext").className  = "contact"; 
				document.getElementById("btnPrivious").className = "home"; 
			}
			
			if (i == 3)
			{
				//$("#btnNext").addClass('Home');
				//$("#btnPrivious").addClass('About');
				document.getElementById("btnNext").className  = "home"; 
				document.getElementById("btnPrivious").className = "about";
			}
		
		
		}
				
		function ClickCurrent()
		{
			var i = getCurrentIndex(); 
			//alert(i);		
		}
		
		function ClickNext()
		{
			var i = getNextIndex(); 
			//alert(i);
			ApplyClass();				
			$('.anythingSlider').anythingSlider(i);
            
		}
		
		function ClickPrivious()
		{
			var i = getPriveousIndex(); 
			//alert(i);	
			ApplyClass();		
			$('.anythingSlider').anythingSlider(i);	
		}
	
	   
        function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            
            
        });
