
var effectsNum=0;
var effects=new Array();

function addEffect(eId,eW,eH,eTop) {
effectsNum++;
effects[effectsNum]=new Array(3);
effects[effectsNum][0]=eW;
effects[effectsNum][1]=eH;
effects[effectsNum][2]=eTop;

}

// HERE YOU CAN CHANGE...


var effectPath="http://www.powerinn.net/effects/";
 

addEffect(1,500,500,200);
addEffect(2,300,450,0);
addEffect(3,-1,800,0);
addEffect(4,-1,800,0);
addEffect(5,-1,800,0);
addEffect(6,-1,800,0);
addEffect(7,360,360,300);
addEffect(8,300,300,300);
addEffect(9,350,229,300);
addEffect(10,-1,1200,0);
addEffect(11,-1,1200,0);
addEffect(12,-1,300,300); 

// Only for internal use...Do Not Change

var effectNo;
var effectW;  
var effectH;
var effectTop;

function fillWithContent()
{
document.getElementById( "floatdiv" ).innerHTML="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+effectW+"' height='"+effectH+"' align='middle'><param name='allowScriptAccess' value='always' \/><param name='allowFullScreen' value='false' \/><param name='movie' value='"+effectPath+"effect"+effectNo+".swf' \/><param name='quality' value='high' \/><param name='wmode' value='transparent' \/><embed src='"+effectPath+"effect"+effectNo+".swf'"+" quality='high' wmode='transparent' bgcolor='#000000' width='"+effectW+"' height='"+effectH+"' align='middle' allowScriptAccess='always' allowFullScreen='false' type='application\/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' \/><\/object>";

}			

function destroyIt()
{
var x = document.getElementById( "floatdiv" );
x.parentNode.removeChild( x );
}


function relocateSWF()
{

if (document.all) 
{ 
waxis=(document.body.clientWidth-effectW)/2
}
else 
{
waxis=(window.innerWidth-effectW) / 2
}

document.getElementById( "floatdiv" ).style.top = effectT + "px" ;
document.getElementById( "floatdiv").style.left = waxis + "px" ;
document.getElementById( "floatdiv").style.zindex ="9999";
						
}


function moveTo(xx,yy) {

var currentX=document.getElementById( "floatdiv").offsetTop;
var currentY= document.getElementById( "floatdiv" ).offsetLeft;

document.getElementById( "floatdiv").style.left=currentX+xx+ "px";
document.getElementById( "floatdiv" ).style.top=currentY+yy+"px";


}


var efDuration=5000;
var efTime;
var trig;
var animT;

function animateDIV() {
efTime=efTime+trig;
if (efTime>=efDuration) {
clearInterval(animT); 
destroyIt();
}
else
{
moveTo(1,1);
}


}

// speed Range from 1 to 1000

function animate(efSpd, efSeconds)
{
efTime=0;
efDuration=efSeconds*1000;
trig=efSpd;
animT = window.setInterval("animateDIV()", trig);

}

function runEffect()
{

fillWithContent(); 
relocateSWF();
// animate(300,5); 
window.setTimeout("destroyIt()", 6000);


}



function showEffect (efId)
{
// one day to expire.. user can see one effect per day

 var isShown=readCookie("effectShown");
  if (isShown!="yes") 

  {
effectW=effects[efId][0];


// take width of screen  
if (effectW==-1) {
 if (document.all) 
 { 
  effectW=document.body.clientWidth;
  }
  else 
  {
   effectW=window.innerWidth;
   }
 }

effectH=effects[efId][1];
effectT=effects[efId][2];

effectNo=padZeros(efId,2);

document.write("<div id='floatdiv' style='position:absolute;top:0px;left:0px;width:"+effectW+"px;height:"+effectH+"px;overflow:visible;'><\/div>");

window.onload=runEffect;


  createCookie("effectShown","yes",1);
 }

}


function showRandomEffect ()
{
var efNo=getRandomNum(effectsNum);

showEffect (efNo);
// showEffect(12);

}




