function ShowImageKey(area){
	if(document.getElementById(area).style.display=='none'){
		Effect.SlideDown(area, { duration: 0.5 });
	}
}

function ChangeFlipSections(leftSide,rightSide){
	var allTags = document.getElementsByTagName('div');
	for(i=0; i<allTags.length; i++){
  		if(allTags[i].className == 'rightSectionActive'){
			allTags[i].className = 'rightSection';
			allTags[i].style.display = 'none';
		}
		if(allTags[i].className == 'keyregion'){
			allTags[i].style.display = 'none';
		}
	}
	
	var allTags = document.getElementsByTagName('a');
	for(i=0; i<allTags.length; i++){
  		if(allTags[i].className == 'leftSectionActive'){
			allTags[i].className = 'leftSection';
		}
	}
	
	document.getElementById(leftSide).className = 'leftSectionActive';
	document.getElementById(rightSide).className = 'rightSectionActive';
	Effect.Appear(rightSide);
}

function ShowPriceBox(){
	document.getElementById('priceBox').style.visibility='visible';
}

function HidePriceBox(){
	document.getElementById('priceBox').style.visibility='hidden';
}

function ShowTorchPriceBox(){
	document.getElementById('torchPriceBox').style.visibility='visible';
}

function HideTorchPriceBox(){
	document.getElementById('torchPriceBox').style.visibility='hidden';
}

function ChangeSectionOnURL(){
	var url = window.location.href;
	var urla = url.split("#");
	if(urla[1]){
		if(urla[1].length>0){
			if(document.getElementById('section' + urla[1])){
				ChangeFlipSections('section' + urla[1] + 'B','section' + urla[1]);
			}
		}
	}
}

function ChangeSelectionOnBack(){
	var mhash = window.location.hash.replace("#","");

	if(document.getElementById('section' + mhash)){
		if(document.getElementById('section' + mhash + 'B').className=='leftSection'){
			ChangeFlipSections('section' + mhash + 'B','section' + mhash);
		}	
	}else if(mhash==''){
		var allTags = document.getElementsByTagName('div');
		for(i=0; i<allTags.length; i++){
	  		if(allTags[i].className == 'leftSection'){
				var allAs = allTags[i].getElementsByTagName('a');

				if(allAs.length>0){
					if(allAs[0].className=='leftSection'){
						var newhash = allAs[0].id.slice(0,-1).slice(7);

						if(document.getElementById('section' + newhash)){
							if(document.getElementById('section' + newhash + 'B').className=='leftSection'){
								ChangeFlipSections('section' + newhash + 'B','section' + newhash);
							}
						}
					}
				}
			}
		}
	}
}


