
//RUN ALL STRUCTURE BOX FUNCTIONS 
//(each time pagestructure option gets changed)

function structureFunctions(boxType) {

	//decide which bits to show/hide:
	if (boxType == 'none') {
		showHideLayer('mycontentboxes', 'hide'); 
		showHideLayer('alltablesbordersrounded', 'hide'); 
		showHideLayer('mytablebordersnotrounded', 'show'); 
		showHideLayer('mytablebordersrounded', 'hide'); 
	}
	else if (boxType == 'anchor') { 
		showHideLayer('mycontentboxes', 'show'); 
		showHideLayer('alltablesbordersrounded', 'hide'); 
		showHideLayer('mytablebordersnotrounded', 'show'); 
		showHideLayer('mytablebordersrounded', 'hide'); 
	}
	else if (boxType == 'scrollbox') {
		showHideLayer('mycontentboxes', 'show'); 
		showHideLayer('alltablesbordersrounded', 'hide'); 
		showHideLayer('mytablebordersnotrounded', 'show'); 
		showHideLayer('mytablebordersrounded', 'hide'); 
	}
	else if (boxType == 'rounded') {
		showHideLayer('mycontentboxes', 'show'); 
		showHideLayer('alltablesbordersrounded', 'show'); 
		showHideLayer('mytablebordersnotrounded', 'hide'); 
		showHideLayer('mytablebordersrounded', 'show'); 
	}
	//swapboxtype for all
	swapBoxType(boxType);
}



//SWAP BOX STYLE OPTIONS 
//(depending which type of box is selected, anchor/ rounded etc)

function swapBoxType(toType) {

	var boxTypeContainer = document.getElementById('structureboxtype');	
	var note = ''
	
	//toggle boxtype div on or off
	if (toType == 'none') { boxTypeContainer.style.display = 'none'; } 
	else { 
		boxTypeContainer.style.display = 'block'; 
		
		//display the right info:
		if (toType == 'anchor') { 
			var boxTitle = 'Anchor'; 
			var boxType2 = 'Navs on Right ';
			var boxType3 = 'Navs Above '; 
			var boxType4 = 'Navs Below ';
		} else {
			var boxType2 = 'Style 2 '; 
			var boxType3 = 'Style 3 ';
			var boxType4 = 'Style 4 ';
			if (toType == 'scrollbox') { var boxTitle = 'Scroll'; }
			else { 
				var boxTitle = 'Rounded'; 
				var note = '<br /><i> &nbsp; Nb, rounded boxes have graphic corners so page background<br /> &nbsp; may only be black or white</i>';
			}
		}
		document.getElementById('structureboxtitle').innerHTML = ' &nbsp; <b>What Type of '+boxTitle+' Box?</b>'+note;

		document.getElementById('boxtype2').innerHTML = boxType2;	
		document.getElementById('boxtype3').innerHTML = boxType3;	
		document.getElementById('boxtype4').innerHTML = boxType4;
		
		document.getElementById('sboxtype1').src = 'cultgenerator/grafix/'+ toType +'1.gif';	
		document.getElementById('sboxtype2').src = 'cultgenerator/grafix/'+ toType +'2.gif';
		document.getElementById('sboxtype3').src = 'cultgenerator/grafix/'+ toType +'3.gif';
		document.getElementById('sboxtype4').src = 'cultgenerator/grafix/'+ toType +'4.gif';	
	}	
}


