// JavaScript Document

function ma_ShowLayer (showthis) { //show the given layer
	
  var obj;
  
  if ((obj=MM_findObj(showthis))!=null)
  { 
  	if (obj.style) 
  	{ 
		obj=obj.style; 
		obj.visibility='visible';
	}
  }    
	
}  //end ma_ShowLayer


function ma_HideLayer (hidethis) { //hide the given layer
	
  var obj;
  
  if ((obj=MM_findObj(hidethis))!=null)
  { 
  	if (obj.style) 
  	{ 
		obj=obj.style; 
		obj.visibility='hidden';
	}
  }    
	
}  //end ma_HideLayer




function ma_drop(dropthis)
{
  //alert('Hello World!');	
  
  //var dropthis = "proteam_more";
  
  if ((obj=MM_findObj(dropthis))!=null)
  { 
  	if (obj.style) 
  	{ 		
		if (obj.style.display == 'none')
		{
			obj.style.display='block';
		} else
		{ 
			obj.style.display='none';
		}
	}	
  } 
} //end ma_drop




function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function flash(src,width,height,tr){
        object = '';
        object += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="param" width="'+width+'" height="'+height+'">';
        object += '<param name="movie" value="../'+src+'">';
        if(tr=='1'){
             object += '<param name="wmode" Value="Transparent">';
        }
        object += '<embed src="'+src+'" quality="high" ';    
        if(tr=='1'){
            object += ' wmode="transparent" ';
        }
        object += ' bgcolor="#ffffff" menu="false" width="'+width+'" height="'+height+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
        object += '</object>';
        document.write(object);
    }
    
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() { //v3.0
  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];}
}


// COLLAPSE-EXPANDING CODE 


var COLLAPSABLE_PARENT_NAME = "collapsable";
var COLLAPSABLE_PARENT_TYPE = "div";
var COLLAPSABLE_CHILD_TYPE = "p";

var COLLAPSABLE_EXPAND = "<img src='images/content_images/button_expand.jpg'>";
var COLLAPSABLE_SHRINK = "<img src='images/content_images/button_hide.jpg'>";

init = function() {
    if(document.getElementById && document.createTextNode) {
        var entries = document.getElementsByTagName(COLLAPSABLE_PARENT_TYPE);
        for(i=0;i<entries.length;i++)
            if (entries[i].className==COLLAPSABLE_PARENT_NAME)
                assignCollapse(entries[i]);
    }
}

assignCollapse = function (div) {
    var button = document.createElement('a');
    button.style.cursor='pointer';
    button.setAttribute('expand', COLLAPSABLE_EXPAND);
    button.setAttribute('shrink', COLLAPSABLE_SHRINK);
    button.setAttribute('state', -1);
    button.innerHTML='dsds';
    div.insertBefore(button, div.getElementsByTagName(COLLAPSABLE_CHILD_TYPE)[0]);
	
    button.onclick=function(){
        var state = -(1*this.getAttribute('state'));
        this.setAttribute('state', state);
        this.parentNode.getElementsByTagName(COLLAPSABLE_CHILD_TYPE)[0].style.display=state==1?'none':'block';
        this.innerHTML = this.getAttribute(state==1?'expand':'shrink');
    };                   
    button.onclick();
}


window.onload=init;

// end COLLAPSE-EXPANDING CODE 

