var effectTimeout = 80;

function showObj(id) {
id.style.visibility = "visible";
id.style.display = "block";
SetOpacity(id, 100);
var rect = 'rect(auto,auto.auto,auto)';
id.style.clip = rect;
}

function hideObj(id) {
id.style.visibility = "hidden";
id.style.display = "none";
}

var wval;
var eff_over = 0;
function watchToClose()
{
wval = setTimeout('watchToClose()', effectTimeout);
if (eff_over == 1) {
clearInterval(wval);
hideObj(obj);
}}

function setDelay(delay){
effectTimeout = delay;
}

function SetOpacity(id, op)
{
  id.style.opacity = op/100;
  id.style.filter = 'alpha(opacity=' + op + ')';
}

var obj;
var cop;
var cf;

function FadeOut (id)
{
obj = id;
cop = 100;
cf = -1;
outf();
}

function FadeIn (id)
{
obj = id;
cop = 0;
cf = 1;
outf();
}

function pixelate(id)
{
var dur = (500 + effectTimeout * 8) / 1000;
obj=id;
setTimeout ("eff_over = 1", dur * 1000);
obj.style.filter = 'progid:DXImageTransform.Microsoft.Pixelate(duration=' + dur + ', maxSquare=50, enabled=false)';
obj.filters[0].apply(); 
obj.filters[0].play(); 
}

var pstep = 0;

function puff(id)
{
obj=id;
if (pstep<15)
{
obj.style.left = parseInt(obj.style.left)  -  Math.round(parseInt(obj.style.width) * 0.015);
obj.style.top = parseInt(obj.style.top)   -  Math.round(parseInt(obj.style.height) * 0.015);
obj.style.pixelWidth = Math.round(parseInt(obj.style.width) * 1.03);
obj.style.pixelHeight = Math.round(parseInt(obj.style.height) * 1.03);
cwd = obj.style.pixelWidth;
chg = obj.style.pixelHeight;


try {
if (obj == outerdiv) kS();}
catch (e) {} 

pstep+=1;
setTimeout ("puff(obj)",effectTimeout);
}
else
{
pstep = 0;
eff_over = 1;
}
}

function outf()
{
cop+=2*cf;
SetOpacity(obj,cop);
if (cop>=0) {if (cop<=100) {setTimeout ("outf()", effectTimeout)}};
if (cop == 100) {eff_over = 1};
}


var curtainStep = 10;


var curtainLeft = 0;
var curtainRight = 300;
var curtainWidth = 300;
var switchTop = 0;
var switchBottom = 300;


function curtainPrepareClose(id)
{
obj = id;
curtainLeft = 0;
curtainRight = parseInt(obj.style.width);
curtainWidth = parseInt(obj.style.width);
}

function switchPrepareOff(id)
{
obj = id;
switchTop = parseInt(0);
switchBottom = parseInt(obj.style.height);
setTimeout("SetOpacity(obj,50)",0);
setTimeout("SetOpacity(obj,90)",50);
}

function curtainPrepareOpen(id, wd)
{
obj = id;
if (wd!=0)
{
curtainLeft = wd/2;
curtainRight = wd/2;
curtainWidth = wd;
}
else
{
curtainLeft = parseInt(obj.style.width)/2;
curtainRight = parseInt(obj.style.width)/2;
curtainWidth = parseInt(obj.style.width);
}
}

function clipHide(id)
{
		obj = id;
		var rect = 'rect(auto, '+ obj.style.width +'px, auto, '+ 0 +'px)';
		obj.style.clip = rect;	
}


function curtainOpen(id)
{
		obj = id;
	if (curtainLeft>0)
	{
		curtainRight += curtainStep;
		curtainLeft -= curtainStep; 

		
		var rect = 'rect(auto, '+ curtainRight +'px, auto, '+ curtainLeft +'px)';
		
		obj.style.clip = rect;
		
		setTimeout("curtainOpen(obj)",effectTimeout); 
	}
else {showObj(obj);}
}


function switchOff(id)
{
	if (switchTop<switchBottom)
	{
		obj = id;
		switchBottom -= curtainStep; 
		switchTop += curtainStep;
		
		var rect = 'rect(' + switchTop +'px, auto, '+ switchBottom +'px, auto)';
		
		obj.style.clip = rect;
		
		setTimeout("switchOff(obj)",effectTimeout); 
	}
	else {
eff_over = 1; }
}

function curtainClose(id)
{
	if (curtainLeft<curtainRight)
	{
		obj = id;
		curtainRight -= curtainStep; 
		curtainLeft += curtainStep;
		
		var rect = 'rect(auto, '+ curtainRight +'px, auto, '+ curtainLeft +'px)';
		
		obj.style.clip = rect;
		
		setTimeout("curtainClose(obj)",effectTimeout); 
	}
	else {
eff_over = 1; }
}

var savF;
function minsize(id)
{
	obj = id;
	savF = obj.style.fontSize;
	obj.style.width=0;
	obj.style.height=0;
	obj.style.fontSize = '0 pt';
	obj.style.visibility="hidden";
}

	

var cwd, chg, fw, fh;

function kS() {
if (popstyle == 0)
{
var rx=cwd;
var ry=chg;
var c=outerdiv;

try
{
d.gEl=d.getElementById;
d.gEl(c.cid+"_extWA").style.display="block";
d.gEl(c.cid+"_b").style.width=Math.max(rx+((ie5)?12:8),100)+'px';
d.gEl(c.cid+"_b").style.height=Math.max(ry+((ie5)?12:8),80)+'px';
d.gEl(c.cid+"_t").style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px';
d.gEl(c.cid+"_btt").style.left=parseInt(d.gEl(c.cid+"_t").style.width)-48+'px';
d.gEl(c.cid+"_s").style.width=Math.max(rx+12,((ie5)?100:104))+'px';
d.gEl(c.cid+"_s").style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px';
d.gEl(c.cid+"_c").style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px';
d.gEl(c.cid+"_c").style.height=Math.max(ry-((ie5)?24:28),44)+'px';
d.gEl(c.cid+"_max").h=parseInt(d.gEl(c.cid+"_b").style.height);
}
catch (e)
{
}
}
}


function grow(id, wd, hg, nwd, nhg)
{
obj = id;

   obj.style.visibility="visible";
   obj.style.fontSize = Math.round((nwd/wd) * 100) + '%';

cwd = nwd + wd / 20;
chg = nhg + hg / 20;

fw = wd;
fh = hg;

obj = id;

obj.style.width = cwd;
obj.style.height = chg;

try {
if (obj == outerdiv) kS();}
catch (e) {} 

if ((cwd<wd) && (chg<hg))
{
setTimeout("grow(obj,fw,fh,cwd,chg)",effectTimeout); 
}
else
{
	obj.style.fontSize=savF;
}
}

function squish(id, wd, hg, nwd, nhg)
{
obj = id;


   obj.style.visibility="visible";
   obj.style.fontSize = Math.round((nwd/wd) * 100) + '%';

cwd = nwd - wd / 20;
chg = nhg - hg / 20;

fw = wd;
fh = hg;

obj = id;

obj.style.width = cwd;
obj.style.height = chg;

try {
if (obj == outerdiv) kS();}
catch (e) {} 

if ((cwd>0) && (chg>0))
{
setTimeout("squish(obj,fw,fh,cwd,chg)",effectTimeout); 
}
else
{
	eff_over = 1;
	obj.style.visibility="hidden";
}
}

var blc;
function blindDown(id, blindCur)
{
		obj = id;
		blc = blindCur;
	if (blc<parseInt(obj.style.height))
	{

		blc += curtainStep;
		
		var rect = 'rect(auto,auto,' +  blc +'px,auto)';
		
		obj.style.clip = rect;

		
		setTimeout("blindDown(obj,blc)",effectTimeout); 
	}
else {showObj(obj);}
}

function blindUp(id, blindCur)
{
		obj = id;
		blc = blindCur;
	if (blc>0)
	{

		blc -= curtainStep;
		
		var rect = 'rect(' + blc + 'px,auto,auto,auto)';
		
		obj.style.clip = rect;

		
		setTimeout("blindUp(obj,blc)",effectTimeout); 
	}
else {showObj(obj);}
}

var shakelimit=32;
var shakeint;
function shake(id){
obj=id;
shakelimit=32;
shakeint=setInterval("doshake()", effectTimeout)
}


function doshake()
{
obj.style.left = parseInt(obj.style.left) - shakelimit
if (shakelimit<0)
shakelimit+=8
shakelimit = shakelimit * -1
if (shakelimit==0){
clearInterval (shakeint);
eff_over = 1;
}
}

var slc;
function slideDown(id, slideCur)
{
		obj = id;
		slc = slideCur;
	if (slc>0)
	{
		obj.style.top = parseInt(obj.style.top) + curtainStep;

		slc -= curtainStep;
		
		var rect = 'rect(auto,auto,' + slc + 'px,auto)';
		
		obj.style.clip = rect;

		
		setTimeout("slideDown(obj,slc)",effectTimeout); 
	}
	else
{
eff_over = 1;
}
}

function slideUp(id, slideCur)
{
		obj = id;
		slc = slideCur;
	if (slc<parseInt(obj.style.height))
	{
		obj.style.top = parseInt(obj.style.top) - curtainStep;

		slc += curtainStep;
		
		var rect = 'rect('  + slc + 'px,auto,auto,auto)';
		
		obj.style.clip = rect;

		
		setTimeout("slideUp(obj,slc)",effectTimeout); 
	}
else
{
eff_over = 1;
}
}

function blink(id){
obj=id;
setTimeout("FadeOut(obj,effectTimeout/5)",0);
setTimeout("FadeIn(obj,effectTimeout/5)",effectTimeout * 10);
setTimeout("FadeOut(obj,effectTimeout/5)",effectTimeout * 20);
setTimeout("FadeIn(obj,effectTimeout/5)",effectTimeout * 30);
}


var effoverlayer;
var t = 1; 
var n = 50;

var i = 0; 

function effmkoverlay(color, transp, speed, except)
{
  effoverlayer = document.createElement('DIV');
  effoverlayer.style.position = 'absolute';
  effoverlayer.style.left = '0px';
  effoverlayer.style.top = '0px';
  var w = (document.body.scrollWidth>document.body.clientWidth)? document.body.scrollWidth : document.body.clientWidth;
  var h = (document.body.scrollHeight>document.body.clientHeight)? document.body.scrollHeight : document.body.clientHeight;
  w = w + 50;
  h = h + 50;
  effoverlayer.style.width = w;
  effoverlayer.style.height = h;
  effoverlayer.style.backgroundColor = color;
  effoverlayer.innerHTML = "<table width = " + w + " height = " + h + "> </table>"
  effoverlayer.above = except;
  effoverlayer.style.opacity = 0;
  effoverlayer.style.filter = 'alpha(opacity=' + 0 + ')';
  document.body.appendChild(effoverlayer);
  n = transp;
  t = speed*speed*(speed/2);
  effshade();

}

function effshade()
{
  effoverlayer.style.visibility = "visible";
  i+= (n / 10);  

  effoverlayer.style.opacity = i/100;
  effoverlayer.style.filter = 'alpha(opacity=' + i + ')';
  
  if (i < n) setTimeout(effshade, t); 
  
} 

function effunshade()
{
  i-= (n / 10);  

  effoverlayer.style.opacity = i/100;
  effoverlayer.style.filter = 'alpha(opacity=' + i + ')';
  
  if ( i > 0 ) setTimeout(effunshade, t/2); 
  if (i<=0) effoverlayer.style.visibility = "hidden";

} 

function effhideoverlay()
{
  effunshade();
}
