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];}
}

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 PopupPic(sPicURL) { 
  window.open( "popup.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200"); 
}

function toggle(n){
	if(document.getElementById(n).style.display == "none"){
		document.getElementById(n).style.display = "block";
	}else{
		document.getElementById(n).style.display = "none";
	}
}

function changeClass(id, classA, classB)
	{
	if(document.getElementById(id).className == classA)
		{
		document.getElementById(id).setAttribute("class", classB); // FF
		document.getElementById(id).setAttribute("className", classB); // IE
		}
	else
		{
		document.getElementById(id).setAttribute("class", classA); // FF
		document.getElementById(id).setAttribute("className", classA); // IE
		}
	}

function changeImg(id, img)
	{
	document.getElementById(id).src = img;
	}


// Sliding Menu Script v.1.0

SM_speed = 10; 	// Set slide speed (1 [slower] - 20 [faster])
SM_delay = 3;	// Set the delay for the meun to open (1 [faster] - 10 [slower])

// Do NOT change below
SM_colapsing = 0;
SM_expanding = 0;
SM_id = 0;
SM_delay = SM_delay * 100;

function SM_expand(id)
	{
	if(SM_expanding == 0)
		{
		SM_expanding = 1;
		
		var h1 = document.getElementById(id).getElementsByTagName('ul')[0].offsetHeight
		var h2 = document.getElementById(id).getElementsByTagName('li')[0].offsetHeight
		
		setTimeout("SM_doExpand('" + id + "', " + h1 + ", " + h2 + ")", 0);
		}
	}

function SM_doExpand(id, h1, h2)
	{
	var h1 = h1 + SM_speed;
	if(h1 < h2)
		{
		
		document.getElementById(id).getElementsByTagName('ul')[0].style.height = h1 + "px";
		
		setTimeout("SM_doExpand('"+id+"', "+h1+", "+h2+")", 10);
		}
	else
		{
		document.getElementById(id).getElementsByTagName('ul')[0].style.height = h2 + "px";
		
		SM_expanding = 0;
		}
	}
	
function SM_colapse(id)
	{
	if(SM_colapsing == 0)
		{
		SM_colapsing = 1;
		
		var h1 = document.getElementById(id).getElementsByTagName('ul')[0].offsetHeight;
		var h2 = 0;
		
		setTimeout("SM_doColapse('" + id + "', " + h1 + ", " + h2 + ")", 0);
		}
	}

function SM_doColapse(id, h1, h2)
	{
	var h1 = h1 - SM_speed;
	
	if(h1 > h2)
		{
		document.getElementById(id).getElementsByTagName('ul')[0].style.height = h1 + "px";
		
		setTimeout("SM_doColapse('"+id+"', "+h1+", "+h2+")", 10);
		}
	else
		{
		document.getElementById(id).getElementsByTagName('ul')[0].style.height = h2 + "px";
		SM_colapsing = 0;
		}
	}
	
function SM_auto(id)
	{
	SM_id = id;
	
	if(SM_expanding == 0 && SM_colapsing == 0)
		{
		var a = id.substring(0,id.length - 1);
		var i = 0;
		while(document.getElementById(a + i))
			{
			if(document.getElementById(a + i).getElementsByTagName('ul')[0].offsetHeight > 0)
				{
				var colapser = a + i;
				}
			i++;
			}
		var expander = id;
		
		if(expander != colapser)
			{
			setTimeout("SM_auto2('"+expander+"', '"+colapser+"')", SM_delay);
			}
		}
	}

function SM_auto2(expander, colapser)
	{
	if(expander == SM_id)
		{
		setTimeout("SM_colapse('"+colapser+"')", 1);
		setTimeout("SM_expand('"+expander+"')", 1);
		}
	}
	
function SM_toggle(id)
	{
	if(document.getElementById(id).getElementsByTagName('ul')[0].offsetHeight > 0)
		{
		setTimeout("SM_colapse('" + id + "')", 0);
		}
	else
		{
		setTimeout("SM_expand('" + id + "')", 0);
		}
	}
	
	
// News Scroller Script
/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function pausescroller(content, divId, divClass, delay, speed, direction){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.speed=speed //Speed of scroll 1 = faster; 10 = slower;
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
this.direction=direction // Direction of the scroll v = vertical; h = horizontal;
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: auto" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: auto; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv, this.direction)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animatevert()}, this.delay)
}


// animatevert()- Move the two inner divs of the scroller up and in sync
pausescroller.prototype.animatevert=function(){
var scrollerinstance=this

if(this.direction == "v")
	{
		
	if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+3)){
	this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-3+"px"
	this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-3+"px"
	setTimeout(function(){scrollerinstance.animatevert()}, this.speed)
	}
	else{
	this.getinline(this.hiddendiv, this.visiblediv)
	this.swapdivs()
	setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
	}
	}
else
	{
	if (parseInt(this.hiddendiv.style.left)>(this.visibledivtop+3)){
	this.visiblediv.style.left=parseInt(this.visiblediv.style.left)-3+"px"
	this.hiddendiv.style.left=parseInt(this.hiddendiv.style.left)-3+"px"
	setTimeout(function(){scrollerinstance.animatevert()}, this.speed)
	}
	else{
	this.getinline(this.hiddendiv, this.visiblediv)
	this.swapdivs()
	setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
	}
	}
}


// swapdivs()- Swap between which is the visible and which is the hidden div
pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
	if(this.direction == "v")
	{
	div1.style.top=this.visibledivtop+"px"
	div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
	}
	else
	{
	div1.style.left=this.visibledivtop+"px"
	div2.style.left=Math.max(div1.parentNode.offsetWidth, div1.offsetWidth)+"px"
	}
}



// setmessage()- Populate the hidden div with the next message before it's visible
pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animatevert(this.direction)
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

 
function openwindow(url){
	  NewWindow=window.open(url,'newWin','width=700,height=377,left=20,top=20,toolbar=No,location=No,scrollbars=no,status=No,resizable=no,fullscreen=No');  NewWindow.focus(); void(0);  }

