function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}


function loadflashgallery(){
	
	var m=document.getElementById('mask');
	var c=document.getElementById('site');
	var s=document.getElementById('flashgallery');

	c.style.height="100%";
	c.style.overflow="hidden";
	m.style.display="block";
	s.style.display="block";
	
	var so = new SWFObject("media/gallery.swf?www=/gallery/", "swfdisplay", 960, 600, "8", "#000000");
	so.write("flashgallery");	
	
}

function closeflashgallery(){
	
	var m=document.getElementById('mask');
	var c=document.getElementById('site');
	var s=document.getElementById('flashgallery');

	c.style.height="auto";
	c.style.overflow="visible";
	m.style.display="none";
	s.style.display="none";
	
	
}


ht=Array();
cht=Array();

tw=Array();
cw=Array();
action=Array();
isopen=Array();
notstarted=0;
totgrps=0;

function get_heights(t){
	
	totgrps=t;
	
	for(i=0;i<=t;i++){
			cht[i]=0;
			ht[i]=document.getElementById('grp'+i).offsetHeight;
			ht[i]=ht[i]+10;
			document.getElementById('grp'+i).style.height="0px";
			
			isopen[i]='closed';
			action[i]=0;
			cw[i]=0;
			tw[i]=document.getElementById('lnkgrp'+i).offsetWidth;
			document.getElementById('lnkgrp'+i).style.width="0px";
			document.getElementById('lnkholder'+i).style.width=tw[i]+"px";
	}

}

function ini_grp(x){
	
	if(cht[x]==0){
		
		growgrp(x);
		document.getElementById('ligrp'+x).style.backgroundImage="url(images/bulletopen.jpg)";
		isopen[x]='open';
	}else{
		
		shrinkgrp(x);
		document.getElementById('ligrp'+x).style.backgroundImage="url(images/bulletclosed.jpg)";
		isopen[x]='closed';
		
	}
	
}

function growgrp(x){

	d=document.getElementById('grp'+x);

	if((cht[x]+10)<ht[x]){
	
		cht[x]=cht[x]+10;
		d.style.height=cht[x]+"px";
		growtimer=setTimeout(function(){ growgrp(x) },10)
	
	}else{
		
		cht[x]=ht[x];	
		d.style.height=ht[x]+"px";
	
	}

}

function shrinkgrp(x){

	d=document.getElementById('grp'+x);

	if((cht[x]-10)>0){
	
		cht[x]=cht[x]-10;
		d.style.height=cht[x]+"px";
		shrinktimer=setTimeout(function(){ shrinkgrp(x) },10)
	
	}else{
		
		cht[x]=0;	
		d.style.height="0px";
	
	}

}


function ini_lnk(id,x){
	
	if(x==1){
		action[id]='grow';
	}else{
		action[id]='shrink';
	}
	
	if(notstarted==0){
		notstarted=1;
		timer=setTimeout(enterframe,10);
	}

}



function enterframe(){
	
	for(i=0;i<=totgrps;i++){
		
		if(action[i]=='grow'){
			if((cw[i]+10)<tw[i]){
				cw[i]=cw[i]+10;
			}else{
				cw[i]=tw[i];
			}
		}else{
			if(isopen[i]=='closed'){
				if((cw[i]-10)>0){
					cw[i]=cw[i]-10;
				}else{
					cw[i]=0;	
				}
			}
		}
		
		document.getElementById("lnkgrp"+i).style.width=cw[i]+"px";
	
	}
	
	timer=setTimeout(enterframe,10)
	
}



function printflash(swf,w,h,div){
		var so = new SWFObject(swf, "flash-animations", w, h, "8", "#ffffff");
		so.addParam("wmode", "transparent");
		so.write(div);	
}


function navover(x){
	var n=document.getElementById("nc"+x);
	n.style.backgroundImage="url(images/navon.jpg)";
}

function navout(x){
	var n=document.getElementById("nc"+x);
	n.style.backgroundImage="url(images/navoff.jpg)";
}

function mouseover(x,value){
	
	x.style.opacity = value/10;
	x.style.filter = 'alpha(opacity=' + value*10 + ')';

}
