(function($) {
$(document).ready(function() {
 showPanel(1);
});
})(jQuery);

var currentPanel = 1;
function showPanel(panelNum){
	//hide visible panel, show selected panel, set tab
	hidePanel();
	document.getElementById('panel-'+panelNum).style.visibility = 'visible';
	currentPanel = panelNum;
	if(panelNum != 1){
		document.getElementById('panels').style.height = '1000px';
	}
	if(panelNum == 3){
		document.getElementById('panels').style.height = '600px';
	}
	if(panelNum == 1){
		document.getElementById('panels').style.height = '450px';
	}
	
	setState(panelNum);
}
function hidePanel(){
	//hide visible panel, unhilite tab
	document.getElementById('panel-'+currentPanel).style.visibility = 'hidden';
}
function setState(tabNum){
  for(i = 1; i < 5; i++){
	if(tabNum == i){
		document.getElementById('token-tab-'+i).setAttribute("class", 'tab active'); //For Most Browsers
	}else{
		document.getElementById('token-tab-'+i).setAttribute("class", 'tab');
	}
  }
}
function languageChange(selectObj){
	// get the index of the selected option 
	 var idx = selectObj.selectedIndex; 
	 // get the value of the selected option 
	 var which = selectObj.options[idx].value;
	 window.location= "/" + which;
}
