

function moveMenu()
{

	var minS = 0;
	var sc=document.body.scrollTop;

	if(sc>minS)
	{
		document.getElementById('leftpane').style.pixelTop = sc - minS; 
	}
	else if(sc<minS && document.getElementById('leftpane').style.pixelTop >0)
	{
	document.getElementById('leftpane').style.pixelTop=0;
	}
}
window.onscroll = moveMenu;

function hovver(elt)
{
	document.getElementById(elt).style.backgroundColor = "Gainsboro";

}
function hovveroff(elt)
{
	document.getElementById(elt).style.backgroundColor = 'white';
}

//following script for search

var currentPanel;
var num;

function showPanel(panelNum)
{
       if (currentPanel != null) 
	{	hidePanel();	}
	document.getElementById('panel'+panelNum).style.visibility = 'visible';
	currentPanel = panelNum;
//	setState(panelNum);
}
function hidePanel()
{
  
	document.getElementById('panel'+currentPanel).style.visibility = 'hidden';
	document.getElementById('tab'+currentPanel).style.backgroundColor = "Gainsboro";
	document.getElementById('tab'+currentPanel).style.color = '#663300';
}
function setState(tabNum)
{
	if(tabNum !=currentPanel)
	{
			
		document.getElementById('panel'+tabNum).style.visibility = 'hidden';
		document.getElementById('tab'+tabNum).style.backgroundColor = "Gainsboro";
		document.getElementById('tab'+tabNum).style.color = '#663300';
	}
}
function hover(tab,num)
{
	setState(1);setState(2);
	//setState(3);setState(4);
	tab.style.backgroundColor = "white";
	showPanel(num);
}
function CheckValidity()
    { 
      
        var startDate=cbGetElement('ctlSearch1$txtCheckIn').value.toString();
        var endDate=cbGetElement('ctlSearch1$txtCheckOut').value.toString();
        var retCode=true; 
        var errorMsg1=isValidDate(startDate);
        var errorMsg2=isValidDate(endDate);
        
        if (errorMsg1.toString()!='true')
        {
            //alert(errorMsg1);
            retCode=false;
            //return retCode;
        }            
        if (errorMsg2.toString()!='true')
        {
            //alert(errorMsg2);
            retCode=false;
            //return retCode;
        }
        
        var daysDiff=dateDiff(startDate,endDate);
          alert(daysDiff);
        
        if(daysDiff < 0)
        {
            cbGetElement('msgDate').style.display = 'inline';
            cbGetElement('msgDate').innerText = 'End Date must be same or atleast 1 day after Start Date'; 
            alert('End Date must be same or atleast 1 day after Start Date'); 
            retCode=false;
             
        }
        else if(daysDiff > 31)
        {
            cbGetElement('msgDate').style.display = 'inline';
            cbGetElement('msgDate').innerText = 'Date range can not be more than 1 month'; 
                     
            retCode=false;
              
            
        }
        //alert(retCode+"diff="+daysDiff);
        
      // return retCode;
     
    }
    
    function cbGetElement(eName)
	{	
		return document.getElementById(eName); 	
	}

//script for search ends here

//script for testimonials animation
var arr = new Array(4);
arr[0] = "I came to India because its hospitals are among the best in the world.";
arr[1] = "The multicultural environment in India makes me feel at home and secure."
arr[2] = "The entire process of my healthcare trip to India was simple and comfortable";
arr[3] = "Getting myself operated in India was the best decision I took.";
function doit(i)
{
	i = i + 1;
	if(i == 4)
	{		
		i = 0;
	}

	document.getElementById('tmtext').innerHTML = arr[i];
	setTimeout("doit(" + i + ")",3000);
}
//script for testimonials animation ends here
function hide()
	{
		document.getElementById("table7").style.display = "none";
	}
function hovernew(tab,num)
{
	setState(1);setState(2);setState(3);setState(4);
	tab.style.backgroundColor = "white";
	showPanel(num);
}


//Forces specified submit button click when user presses enter
function forceButtonClick(evt,btnID){
  if (evt==null && window.event) evt=window.event;
  if (evt==null || evt.keyCode!=13) return;
  evt.cancelBubble=true;
  evt.returnValue=false;
  if (typeof(evt.stopPropagation)=='function') evt.stopPropagation();
  if (typeof(evt.preventDefault)=='function') evt.preventDefault();

  var obj=document.getElementById(btnID);
  if (!obj) return;
  if (obj.click) obj.click();
  else try{
   alert('here');
   var evt2=document.createEvent('Events');
   evt2.initEvent('click',false,false);
   obj.dispatchEvent(evt2);
  }catch(e){}
 }
