function displayshow(id) {
obj1 = document.getElementById(id).style;
if (obj1.display == 'block') {
obj1.display = 'none';
} else {
obj1.display = 'block';
}
}


p_w = 100;
p_h = 100;
function gal_position() {
popup_lay_position('hiden_plash');
plash_position('hiden_content', p_w, p_h);
}

function plash_position(id, plash_width, plash_height) {
_obj = document.getElementById(id);
_cwidth = document.body.clientWidth * 1;
_cheight = document.body.clientHeight * 1;

_wind_top = document.body.scrollTop;

plash_width = plash_width + 80;
plash_height = plash_height + 80;

		_obj.style.left = (_cwidth/2) - (plash_width/2) + 'px';
		_obj.style.top = (_cheight/2) - (plash_height/2) + _wind_top + 'px';
}

function popup_lay_position(id) {
obj = document.getElementById(id).style;
cwidth = document.body.clientWidth * 1;
cheight = document.body.clientHeight * 1;
wind_top = document.body.scrollTop;

obj.top = wind_top + 'px';
obj.height = cheight;
}

function alpha_obj(id, alpha) {
obj = document.getElementById(id);
obj.style.filter = "alpha(opacity = "+alpha+")";
alpha = alpha/100;
obj.style.opacity = alpha;
obj.style.MozOpacity = alpha;
}

popup_lay_alpha_active = 0;
function popup_lay_alpha(id, cont_id, status, ww, hh, jpg) {
	if (!popup_lay_alpha_active) {
		popup_lay_alpha_active = 1;
		time = 0;
		popup_lay_position(id);
		
			if (status) {
				alpha = 0;
				alpha_obj(id, alpha);
				displayshow(id);
				for (i=1; i<=10; i++) {
				alpha = alpha + 8;
				time = time + 50;
				setTimeout("alpha_obj('"+id+"', "+alpha+");", time);
				}
				time = time + 100;
				plash_position('hiden_content', ww, hh);
				p_w = ww;
				p_h = hh;
				document.getElementById('hiden_content').innerHTML = "<img src='"+ jpg + "' width = '"+ ww +"' height = '"+ hh +"' />";
				setTimeout("displayshow('"+ cont_id +"')", time);
			} else {
				alpha = 80;
				setTimeout("displayshow('"+ cont_id +"')", time);		
				alpha_obj(id, alpha);
				for (i=1; i<=5; i++) {
				alpha = alpha - 16;
				time = time + 50;
				setTimeout("alpha_obj('"+id+"', "+alpha+");", time);
				}
				setTimeout("displayshow('"+ id +"')", time);
			}
			time = time + 50;
	setTimeout("popup_lay_alpha_active=0", time);
	}
}
