
function LoadApproachTab(index)
{
	var selectedIndex = 0;
	var found = false;
	var list = document.getElementById('approach_tabs');
	for( var i = 0; i < list.childNodes.length; i++)
	{
		
		if(list.childNodes[i].className != undefined )
		{
			if(list.childNodes[i].className.indexOf('Off') < 0)
				list.childNodes[i].className = list.childNodes[i].className + 'Off';
			
			if(selectedIndex == index && !found)
			{
				list.childNodes[i].className = list.childNodes[i].className.replace('Off','');
				found = true;
			}
			if(!found)
				selectedIndex ++;
			
		}
	}
	var container = document.getElementById('tab-container');
	if(selectedIndex == 0)
		container.style.height = "760px";
	else if(selectedIndex == 1)
		container.style.height = "500px";
	else if(selectedIndex == 2)
		container.style.height = "1100px";
	else if(selectedIndex == 3)
		container.style.height = "500px";
	document.getElementById('middle').style.height = (Number(container.style.height.replace('px','')) + 350) + 'px';
	document.getElementById('page').style.height = (Number(container.style.height.replace('px','')) + 300) + 'px';
	
	showPanel(selectedIndex);
}
function showPanel(index){
      var l = ($(".tab-container")[0].clientWidth)*index;
      $(".panels").animate({left:"-"+l+"px"},"slow","easeboth");
   }
function getQueryParam(paramName)
{
	if(hasQueryString())
	{
		
		var queryString = document.location.search.replace('?','');
		var params = queryString.split('&')
		for(var i = 0; i < params.length ;i ++)
		{
			var valuePair = params[i].split('=');
			if(valuePair[0] == paramName)
			{
				return valuePair[1];
			}
		}
	}
	return undefined;
}
function hasQueryString()
{
	return document.location.search != '';
}
