// Showme
var stopflag = 0;
var oldmenu = '';
var dnav = '';

function showme(ID){
	stopnoshow('');
	if (oldmenu != ''){
		document.getElementById(oldmenu).style.display='none';
		//$(oldmenu+'_nav').removeClassName('hov');
	}
	
	document.getElementById(ID).style.display='block';
	
	// oldmenu = ID;
}


function startnoshow(ID){
	stopflag = 1;
	oldmenu = ID;
	setTimeout("noshow()",'500');
}

function noshow(){
	if (stopflag == 1){
		if (oldmenu != ''){
			document.getElementById(oldmenu).style.display='none';
			//document.getElementById(oldmenu+'_nav').removeClassName('hov');
		}
		oldmenu = '';
		stopflag = 0;
		if (dnav != ''){
			showme(dnav);
		}
	}
}

function stopnoshow(){
	stopflag = 0;
}



//hide show div slideshow
<!--
var PauseBetween = 5000;
var fadeSpeed = 10;
var fadeout = 100;
var fadein = 0;
var ThisSlideID = 0;
var NextSlideID = 0;
var SlideName = '';
var ThisSlide = '';
var NextSlide = '';
var SlideAmt = 0;

function StartShow(SlideName,ThisSlideID,SlideAmt) {
	SlideAmt = SlideAmt;
	if (ThisSlideID < SlideAmt)
		NextSlideID = ThisSlideID + 1;
	else
		NextSlideID = 1;
	ThisSlide = SlideName+ThisSlideID;
	NextSlide = SlideName+NextSlideID;
	fadein = 0;
	fadeout = 100;
	setOpacity(NextSlide, fadein);
	document.getElementById(NextSlide).style.display='block';
	setOpacity(ThisSlide, fadeout);
	document.getElementById(ThisSlide).style.display='block';
	window.setTimeout("fadeIt('"+SlideName+"',"+NextSlideID+","+SlideAmt+")", PauseBetween);
}

function fadeIt(SlideName,NextSlideID,SlideAmt) {
	if (fadeout >= 0) {
		setOpacity(ThisSlide, fadeout);
		setOpacity(NextSlide, fadein);
		fadeout -= fadeSpeed;
		fadein += fadeSpeed;
		window.setTimeout("fadeIt('"+SlideName+"',"+NextSlideID+","+SlideAmt+")", 100);
		}
	else {
	document.getElementById(ThisSlide).style.display='none';
	StartShow(SlideName,NextSlideID,SlideAmt);
		}
}

function setOpacity(objID, opacity) {
	obj = document.getElementById(objID);
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
// -->


	function selectLayout(val){
	
		if (val == 'show'){
			$('form').show();
			$('button').show();
		} else if (val == 'hide') { 
			$('form').hide();
			$('button').hide();
		} else if (val == 'show0') { 
			$('form0').show();
			$('button0').show();
		} else if (val == 'hide0') { 
			$('form0').hide();
			$('button0').hide();
		} else if (val == 'show1') { 
			$('form1').show();
			$('button1').show();
		} else if (val == 'hide1') { 
			$('form1').hide();
			$('button1').hide();
		} else if (val == 'show2') { 
			$('form2').show();
			$('button2').show();
		} else if (val == 'hide2') { 
			$('form2').hide();
			$('button2').hide();
		} else if (val == 'show3') { 
			$('form3').show();
			$('button3').show();
		} else if (val == 'hide3') { 
			$('form3').hide();
			$('button3').hide();
		} else if (val == 'show4') { 
			$('form4').show();
			$('button4').show();
		} else if (val == 'hide4') { 
			$('form4').hide();
			$('button4').hide();
		} else if (val == 'show5') { 
			$('form5').show();
			$('button5').show();
		} else if (val == 'hide5') { 
			$('form5').hide();
			$('button5').hide();
		}
	}	
	
	
function drawOverlay(){
    var overlayer = document.createElement("overlayer");
    overlayer.setAttribute('id','overlayer');
    document.body.appendChild(overlayer);
    var arrayPageSize = getPageSize();
    $('overlayer').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });
    Effect.Appear('overlayer', {duration:0.4, from:0, to:0.4});
    $('overlayer').observe('click', closeOverlay);
}

function closeOverlay(){
    $('overlayer').remove();
	$('video').hide()
}	



function getPageSize() {
            
         var xScroll, yScroll;
        
        if (window.innerHeight && window.scrollMaxY) {    
            xScroll = window.innerWidth + window.scrollMaxX;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        
        var windowWidth, windowHeight;
        
        if (self.innerHeight) {    // all except Explorer
            if(document.documentElement.clientWidth){
                windowWidth = document.documentElement.clientWidth;
            } else {
                windowWidth = self.innerWidth;
            }
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }    
        
        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
            pageHeight = windowHeight;
        } else {
            pageHeight = yScroll;
        }
    
        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){    
            pageWidth = xScroll;        
        } else {
            pageWidth = windowWidth;
        }

        return [pageWidth,pageHeight];
    }
