d = document;
var inf3
var mow
var moh
var dirloc
var filnm
var ftype
var mov
var moviestring
var movieflag=true
function loadwin()
{
moviestring='<html><body bgcolor=\"#000000\"></body></html>'
window.movframe.document.open("text/html");
window.movframe.document.write(moviestring);
window.movframe.document.close();
}





function getmovie(movie, me)
{if (movieflag==true)
{
loadwin()
d.getElementById('movframe').style.borderColor='#ffffff';
var loc=this.location.href;/////parsing out Location Section Name
from=loc.lastIndexOf('/')+1;
to=loc.lastIndexOf('.html');
dirloc=loc.slice(from,to);

fr2=movie.lastIndexOf('x')-3;/////parsing out the W x H
to2=movie.lastIndexOf('x');
frm=movie.lastIndexOf('x')+1;
toh=movie.lastIndexOf('.');
mov=movie
moh=Number(movie.slice(frm,toh));//height
mow=movie.slice(fr2,to2);//////////width

ps2 =movie.lastIndexOf('x')+4;
filnm=movie.slice(0,ps2);
filstr='assets/'+dirloc+'/'+filnm;

ft1 =movie.lastIndexOf('x')+5;
ftype=movie.slice(ft1,movie.length);

if (ftype=='swf')
{
mow/=2;
moh/=2;
}else{moh+=16;}

//if (mow<=190)/////////////////if the movie is narrow add right margin
//{d.getElementById('movframe').style.marginRight=mow+'px';}
//else{d.getElementById('movframe').style.marginRight='10px';}


if (mow<d.getElementById('movframe').style.width.replace(/px/,""))//sets the expansion/contraction 
{w="-"}else{w="+"}
if (moh<d.getElementById('movframe').style.height.replace(/px/,""))
{h="-";}else{h="+";}

G=5

//remw=moh-d.getElementById('movframe').style.height.replace(/px/,"")
//remh=mow-d.getElementById('movframe').style.width.replace(/px/,"")

if (moh>mow)
	{gr=moh;sm=mow;}
	else
	{sm=moh;gr=mow;}
x = 1/(sm/gr)
if (moh<mow)
	{rat=(x*G).toPrecision(2)+':'+(1*G)}
	else
	{rat=(1*G)+':'+(x*G).toPrecision(2)}

wh=w+h+'_'+rat;

	theID = me;
	d.getElementById("info2").innerHTML=inf3;//description
	d.getElementById('preinfo').innerHTML="";
	d.getElementById('popinfo').innerHTML=d.getElementById('poptime').innerHTML;
	timepop(me, "popinfo")

		if (ftype=='swf')
		{
		
		}else{
		 moviestring='<html><body style=margin:0; bgcolor=\"#000000\">'+
		'<OBJECT WIDTH='+mow+' HEIGHT='+(moh)+' ID=movieX>'+
					'<PARAM Name=Autoplay Value=true>'+
					'<PARAM NAME=src VALUE=assets/'+dirloc+'/'+movie+'>'+
					'<PARAM NAME=loop VALUE=false>'+
					'<PARAM NAME=controller VALUE=true>'+
					'<PARAM NAME=bgcolor VALUE=#000000>'+
			   '<EMBED WIDTH='+mow+' HEIGHT='+(moh)+' SRC=assets/'+dirloc+'/'+movie+' TYPE=video/quicktime NAME=movieX EnableJavaScript=true BGCOLOR=#000000 CONTROLLER=true Autoplay=true loop=false PLUGINSPAGE=http://quicktime.apple.com/quicktime/>'+
				   '</OBJECT>'+
					'</body></html>';
		}

parent.addcc();
d.getElementById('option1').innerHTML = '<div class=\"optbuts\">&nbsp;</div>'
movieflag=false
frmanme = setInterval('frameanime(wh)',1)	
}
}

function frameanime(wh)///////////////////////////animates the movie frame size //////////////////////////////////////
{
rat1 = Number(wh.slice(wh.indexOf('_')+1,wh.indexOf(':')))
rat2 = Number(wh.slice(wh.indexOf(':')+1,wh.length))
	if (d.getElementById('movframe').style.height.replace(/px/,"")==moh && d.getElementById('movframe').style.width.replace(/px/,"")==mow)
		{
		clearInterval(frmanme)
		movieflag=true
		if (ftype=='swf')
			{
			ifstr='ac1.html?'+mov
			window.open(ifstr, 'movframe')
			}else{
			window.movframe.document.open("text/html");
			window.movframe.document.write(moviestring);
			window.movframe.document.close();	
			}
		d.getElementById('option1').style.top="21px";
		d.getElementById('option1').style.right=(Number(d.getElementById('movframe').style.marginRight.replace(/px/,''))+40)+"px";
		d.getElementById('option1').style.display='block';
		if (ftype=='swf')
			{d.getElementById('option1').innerHTML = '<div onClick=\"context()\" class=\"optbuts\" onMouseOver=\"this.style.cursor=\'pointer\';\">View in Context</div>'
			}else{d.getElementById('option1').innerHTML = '<div onClick=\"larger()\" class=\"optbuts\" onMouseOver=\"this.style.cursor=\'pointer\';\">View @ 2x Size</div>'}
		return
		}
if (wh.slice(0,1)=='+')
{
	if (d.getElementById('movframe').style.width.replace(/px/,"")<mow) 
	{d.getElementById('movframe').style.width=(Number(d.getElementById('movframe').style.width.replace(/px/,''))+rat1)+"px";}
	 else {d.getElementById('movframe').style.width=mow+"px";}
}else if (wh.slice(0,1)=='-'){
	if (d.getElementById('movframe').style.width.replace(/px/,"")>mow) 
	{d.getElementById('movframe').style.width=(Number(d.getElementById('movframe').style.width.replace(/px/,''))-rat1)+"px";}
	else{d.getElementById('movframe').style.width=mow+"px";}
}
if (wh.slice(1,2)=='+')
{
	if (d.getElementById('movframe').style.height.replace(/px/,"")<moh) 
	{d.getElementById('movframe').style.height=(Number(d.getElementById('movframe').style.height.replace(/px/,''))+rat2)+"px";}
	else{ d.getElementById('movframe').style.height=moh+"px";}
}else if (wh.slice(1,2)=='-'){
	if (d.getElementById('movframe').style.height.replace(/px/,"")>moh) 
	{d.getElementById('movframe').style.height=(Number(d.getElementById('movframe').style.height.replace(/px/,''))-rat2)+"px";}
	else{d.getElementById('movframe').style.height=moh+"px";}
}
}


function highlight(hot)
{zq=d.getElementsByName('img');//delivers name attribute for the pages: "img" the list is zq
  for (i=0;i<=zq.length-1;i++)
  { 
	if (zq[i].id != hot) 
	{
	d.getElementById(zq[i].id).className = "icons"
	}else{
	d.getElementById(hot).className = "iconsHot"
  	}
  }
}

function larger()
{
window.movframe.document.movieX.Stop()

wid=mow*2
hei=(moh-16)*2
numov=mov.replace(mow,wid).replace(moh-16,hei)

//moh=Number(movie.slice(frm,toh));//height
//mow=movie.slice(fr2,to2);//////////width

var moviestring='<html><body style=\"margin:0px;\" bgcolor=\"#000000\">'+
		'<OBJECT WIDTH=\"'+(mow*2)+'\" HEIGHT=\"'+(moh*2)+'\" ID=\"movieY\">'+
					'<PARAM Name=\"Autoplay\" Value=\"true\">'+
					'<PARAM NAME=\"src\" VALUE=\"assets/'+dirloc+'/'+numov+'\">'+
					'<PARAM NAME=\"loop\" VALUE=\"false\">'+
					'<PARAM NAME=\"controller\" VALUE="true\">'+
					'<PARAM NAME=\"bgcolor\" VALUE=\"#000000\">'+
			   '<EMBED WIDTH=\"'+(mow*2)+'\" HEIGHT=\"'+(moh*2)+'\" SRC=\"assets/'+dirloc+'/'+numov+'\" TYPE=\"video/quicktime\" NAME=\"movieY\" EnableJavaScript=\"true\" BGCOLOR=\"#000000\" CONTROLLER=\"true\" Autoplay=\"true\" loop=\"false\" PLUGINSPAGE=\"http://quicktime.apple.com/quicktime/\">'+
				   '</OBJECT>'+
					'</body></html>';
mywin=window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+ (mow*2) +',height='+ (moh*2) );
mywin.document.write(moviestring);
mywin.focus()

//window.movframe.document.close();
//if (!PopupWindow.opener)
// PopupWindow.opener = self;
}


//function increment(me)//checks for the end of the video and replaces it with the default video
//{
//////d.getElementById("info").innerHTML= d.movieX.GetTime() +'_'+ d.movieX.GetEndTime();  <-shows current time vs. total time in a text area
//	if (d.movieX.GetTime() == d.movieX.GetEndTime())
//	{
		//d.movieX.SetIsLooping(true)
//	clearInterval(int);
//	d.movieX.SetURL("base.mov");	
		//if (d.movieX.GetTime() == d.movieX.GetEndTime())
		//{d.movieX.Stop()}
//	d.getElementById(me).className = "icons"
//	d.getElementById("info3").style.top='-1000px'
//	d.getElementById("info1").innerHTML="&nbsp;";
//	d.getElementById("info2").innerHTML="&nbsp;";
//	}
//}

function timepop(me, n)
{
	d.getElementById(n).style.left=d.getElementById(me).style.left;
	d.getElementById(n).style.top=d.getElementById(me).style.top;	
}

function roll(dat, me)
{d.getElementById(me).style.cursor='pointer';
if (me.match('flash')==null)
{
	inf4=dat.substring(0, dat.indexOf(':')+3);
	inf5=dat.substring(dat.indexOf(':')+3, dat.indexOf('_'));
	inf3=dat.substring(dat.indexOf(':')+3, dat.length).replace(/_/, " ");
		
	d.getElementById('poptime').innerHTML=inf4;
	d.getElementById('preinfo').innerHTML=inf5;
	timepop(me, 'poptime');
	
}else{
inf5=dat.substring(0, dat.indexOf('_')).replace(/_/, " ");
d.getElementById('preinfo').innerHTML=inf5;//////title
inf3=dat.substring(0, dat.length).replace(/_/, " ");//////whole string
d.getElementById('poptime').innerHTML = 'Flash'
timepop(me, 'poptime');
}
d.getElementById('preinfo').style.left=d.getElementById(me).style.left;
d.getElementById('preinfo').style.top=(Number(d.getElementById(me).style.top.replace(/px/,''))-14)+"px";
}
		
function off()
{
d.getElementById('preinfo').innerHTML="";
}

//if(document.location.href.match('video.html') != null)
//	{
//	alert(document.location.href)
//	}
//d.getElementById('preinfo').style.visibility="hidden"
//d.getElementById(me).style.border="2px solid #000000";
////////////////////from old index/////////////////////////////////////////////////
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
siz();
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var hinscale = null
var hinsz = null
var winscale = null
var winsz = null
var bgloc = null
var browser=navigator.appName;

function goto()
{
	if (browser=="Microsoft Internet Explorer")
	{
	winsz=d.body.offsetWidth;
	}else{
	winsz=window.outerWidth;	
	}
bgloc = winsz/2
winscale = winsz-160

d.body.style.backgroundPosition=bgloc+"px";
d.body.style.backgroundImage="url(assets/btile.gif)";
d.getElementById('pg1').style.backgroundColor="transparent";
intslide = setInterval("slide()",1);
d.getElementById('ringneg').style.display="inline";
d.getElementById('rollring').style.display="none";
}
function slide()
{
	if (bgloc >= 30)
	{
	d.body.style.backgroundPosition=(bgloc-=30)+"px";
	}else{
	clearInterval(intslide);
	d.body.style.backgroundImage="url(assets/btile2.gif)";
	d.body.style.backgroundPosition="20px";
	d.getElementById('pg2').style.display="block";
	d.getElementById('nam').style.fontSize="14px";
	d.getElementById('ema').style.fontSize="10px";
	d.getElementById('nam').style.display="inline";
	d.getElementById('ema').style.display="inline";
	d.getElementById('ringneg').style.display="none";
	intshapeup = setInterval('shapeup()',75);
		for (i=1;i<=4;i++)
		{
		d.getElementById('p'+i).style.width=(winscale)+'px';
		}
		intbutt = setInterval('buttup()',20);

}
}
function buttup()////    /////  first button stretch   ///////   ///////
{ 
 	if (winscale >= 100)
	{ 
		for (q=1;q<=4;q++)
		{d.getElementById('p'+q).style.width=(winscale-=20)+'px';
		}
	}else{
		for (r=1;r<=4;r++)
		{d.getElementById('p'+r).style.width='90px';
		}
	clearInterval(intbutt);
	winscale = winsz-190
	}
}
var shapeLoop = 0
function shapeup()
{
	switch(shapeLoop)
	{
case 0:	
zip("p4")
	d.getElementById('shape2').style.display="inline";
	d.getElementById('shape2').style.borderColor="#000000";
	d.getElementById('shape2').style.height="20px";
	d.getElementById('shape2').style.width="500px";
	d.getElementById('shape2').style.top="155px";////////////////////////////////////////
	d.getElementById('shape2').style.left="-50px";
	d.getElementById('shape1').style.display="inline";
	d.getElementById('shape1').style.backgroundColor="transparent";
	d.getElementById('shape1').style.border="1px #000000 solid";
	d.getElementById('shape1').style.left=(winsz-100)+"px";
	d.getElementById('shape1').style.left="450px";
	d.getElementById('shape1').style.width="10px";
	d.getElementById('shape1').style.height="23px";
	d.getElementById('shape1').style.top="50px";////////////////////////////////////////	
	shapeLoop++
	break; 
case 1:
	
	shapeLoop++
	break; 
case 2:
	d.getElementById('shape1').style.background="transparent";
	d.getElementById('shape1').style.border="1px #ffffff solid";
	d.getElementById('shape1').style.height="90px";
	d.getElementById('shape1').style.width="600px";
	d.getElementById('shape1').style.top="50px";
	d.getElementById('shape1').style.left="57px";	
	shapeLoop++
	break;
case 3:
	zip("p2")
	d.getElementById("shape1").style.display='inline';
	d.getElementById("shape1").style.height='10px';
	d.getElementById("shape1").style.width='600px';
	d.getElementById("shape1").style.top="50px";
	shapeLoop++
	break;
case 4:
	d.getElementById('shape1').style.border="1px #ffffff solid";
	d.getElementById('shape1').style.height="30px";
	d.getElementById('shape1').style.width="70px";
	d.getElementById("shape1").style.left='357px';
	shapeLoop++
	break;
case 5:
	d.getElementById('smltxt').innerHTML = "&nbsp";
	d.getElementById('smltxt').style.border="none";
	d.getElementById('shape1').style.height="100px";
	d.getElementById('shape1').style.width="50px";
	d.getElementById("shape1").style.left='257px';
	shapeLoop++
	break; 
case 6:
	d.getElementById("shape1").style.left='100px';
	d.getElementById("shape1").style.height='100px';
	d.getElementById("shape1").style.width='100px';
	d.getElementById("shape1").style.top='60px';////////////////////////////////	
	shapeLoop++
	break;
case 7:
	d.getElementById('shape1').style.top="40px";////////////////////////////////
	d.getElementById('shape1').style.width="90px";
	d.getElementById('shape1').style.height="50px";	
	d.getElementById('shape1').style.left="15px";	
	shapeLoop++
	break;
case 8:
	clearInterval(zint);
	clearInterval(intshapeup);
	d.getElementById('shape2').style.display="none";
	d.getElementById('shape1').style.top="40px";////////////////////////////////
	d.getElementById('shape1').style.width="90px";
	d.getElementById('shape1').style.height="30px";	
	d.getElementById('shape1').style.left="15px";
	shapeLoop = 0
	break;
	}
}



var spinkloop = 0
function twink1()//spark1()////    ///// text TWINKLE///   ///////
{
spink=setInterval('sparkle(spinkloop)',500);
}
function sparkle()////    ///// text TWINKLE///   ///////
{
switch(spinkloop)
	{
case 0:
	d.getElementById('smltxt').style.backgroundColor="#000000";
	spinkloop++
	break;
case 1:
	d.getElementById('smltxt').style.backgroundColor="transparent";
	d.getElementById('txt4').style.color="ffffff";
	spinkloop++
	break;
case 2:
	d.getElementById('txt4').style.color="000000";
	spinkloop++
	break;
case 3:
	clearInterval(spink);
	spink2();
	spinkloop=0;
	break;
	}
}


function twink1()////    ///// text TWINKLE///   ///////
{
if (t==true)
{	
	if (d.getElementById('box').style.display=="inline"){
	r=255, g=255, b=255
	d.getElementById('txt3').style.color="rgb(0,0,0)";
	twink=setInterval('twinkle()',50);
	t=false}
}

}
var t = true
var r = 255
var g = 255
var b = 255
function twinkle()
{ 
 	if (r >= 10)
	{
	d.getElementById('txt3').style.color="rgb("+(r-=12)+','+(g-=12)+','+(b-=8)+")";
	}else{
	clearInterval(twink);
	t=true
	d.getElementById('txt3').style.color="rgb(0,0,0)";
	}
}////    /////  ///////   ///////  ///    /////  /////// 