/*var timer;
var degree=0;
var startopacity = 0; 	// Set this variable between 1 and 100 as the standard opacity
var speedopacity = 5; 	// Set this speed between 1 and 50

		function fadeIt(objc){
            if(timer) {clearInterval(timer);}
            setTimeout("timer=setInterval(\"flowfilter("+objc+");\",5);",350);
        }

	    function flowfilter(objc){

            //if(objb==0 && objc==0) objb = (count_array-1);

                degree += speedopacity/100;
                //setTimeout("change_tr("+objc+","+dct+");",1000);



                if ((navigator.appVersion.indexOf("MSIE")>0) && (parseInt(navigator.appVersion) >= 4))
                {
                	if (document.getElementById(objc).filters.alpha.opacity<100)
	                {
	                    document.getElementById(objc).filters.alpha.opacity+=speedopacity;
	                }
	                else
	                {
                        clearInterval(timer);
	                }


                }else if (document.getElementById(objc).style.MozOpacity){
                    if (document.getElementById(objc).style.MozOpacity<1)
	                {
                        document.getElementById(objc).style.MozOpacity = degree;
	                }
	                else
	                {
                        clearInterval(timer);
	                }

                }else if (document.getElementById(objc).style.KhtmlOpacity){
                    if (document.getElementById(objc).style.KhtmlOpacity<1)
	                {
                        document.getElementById(objc).style.KhtmlOpacity = degree;
	                }
	                else
	                {
                        clearInterval(timer);
	                }


                }

	    }















*/
function setLayerPosition(width_l,height_l) {
var shadow = document.getElementById("shadow");
var question = document.getElementById("question");

var arrayPageSize = getPageSize();
var arrayPageScroll = getPageScroll();


shadow.style.width = arrayPageSize[2] + "px";
shadow.style.height = parseInt(arrayPageSize[1]) + "px";   // + 25

//question.style.left = parseInt((arrayPageSize[2] - width_l) / 2);
//question.style.top = parseInt((arrayPageScroll[1]*2 + (arrayPageSize[3]) - height_l) / 2);

shadow = null;
//question = null;
}



function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}

// -----------------------------------------------------------------------------------

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		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
		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 = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}






function showLayer(width_l,height_l) {
setLayerPosition(width_l,height_l);

var shadow = document.getElementById("shadow");
//var question = document.getElementById("question");


hideSelectBoxes();
hideFlash();
//var overlayDuration = 0.2
//new Effect.Appear('shadow', { duration: overlayDuration, from: 0.0, to: 0.8 });

shadow.style.display = "block";
//question.style.display = "block";

shadow = null;
//question = null;
return false;
}




function hideLayer() {
var shadow = document.getElementById("shadow");
//var question = document.getElementById("question");


showSelectBoxes();
showFlash();

//fadeIt("shadow");
shadow.style.display = "none";
//question.style.display = "none";

shadow = null;
question = null;
return false;
}




function showSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

// ---------------------------------------------------

function showFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i != flashObjects.length; i++) {
		flashObjects[i].style.visibility = "visible";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i != flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i != flashObjects.length; i++) {
		flashObjects[i].style.visibility = "hidden";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i != flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "hidden";
	}

}