/***********************************************
* DHTML Billboard script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
	if (window.addEventListener)
	window.addEventListener("load", startbill, false)
	else if (window.attachEvent)
	window.attachEvent("onload", startbill)
	else if (document.getElementById)
	window.onload=startbill
		
//List of transitional effects to be randomly applied to billboard:
var billboardeffects=["GradientWipe(GradientSize=1.0 Duration=0.7)", "Inset", "Iris", "Pixelate(MaxSquare=5 enabled=false)", "RadialWipe", "RandomBars", "Slide(slideStyle='push')", "Spiral", "Stretch", "Strips", "Wheel", "ZigZag"]

//var billboardeffects=["Iris"] //Uncomment this line and input one of the effects above (ie: "Iris") for single effect.

//var tickspeed=5000 //ticker speed in miliseconds (2000=2 seconds)
var effectduration=500 //Transitional effect duration in miliseconds
var hidecontent_from_legacy=1 //Should content be hidden in legacy browsers- IE4/NS4 (0=no, 1=yes).

var filterid=Math.floor(Math.random()*billboardeffects.length)

document.write('<style type="text/css">\n')
if (document.getElementById)
document.write('.billcontent{display:none;\n'+'filter:progid:DXImageTransform.Microsoft.'+billboardeffects[filterid]+'}\n')
else if (hidecontent_from_legacy)
document.write('#contentwrapper{display:none;}')
document.write('</style>\n')

var selectedDiv=0
var totalDivs=0

function contractboard(){
var inc=0
while (document.getElementById("billboard"+inc)){
document.getElementById("billboard"+inc).style.display="none"
inc++
}
}

function expandboard(){
var selectedDivObj=document.getElementById("billboard"+selectedDiv)
contractboard()
if (selectedDivObj.filters){
if (billboardeffects.length>1){
filterid=Math.floor(Math.random()*billboardeffects.length)
selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[filterid]
}
selectedDivObj.filters[0].duration=effectduration/1000
selectedDivObj.filters[0].Apply()
}
selectedDivObj.style.display="block"
if (selectedDivObj.filters)
selectedDivObj.filters[0].Play()
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
setTimeout("expandboard()",tickspeed)
}

function startbill(){
while (document.getElementById("billboard"+totalDivs)!=null)
totalDivs++
if (document.getElementById("billboard0").filters)
tickspeed+=effectduration
expandboard()
}


//*****************************************
/* Codes for Blending Images on the login
// Blending Image Slide Show Script- 
//*****************************************
*/
	function applyeffect(){
		if (document.all && photoslider.filters){
		photoslider.filters.revealTrans.Transition= Math.floor(Math.random()*23)
		photoslider.filters.revealTrans.stop()
		photoslider.filters.revealTrans.apply()
		}
	}

	function playeffect(){
		if (document.all && photoslider.filters)
		photoslider.filters.revealTrans.play()
	}

	function keeptrack(){
		window.status="Image "+(which+1)+" of "+photos.length
	}

	function backward(){
		if (which>0){
		which--
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
		}
	}
	function forward(){
		if (which<photos.length-1){
		which++
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
		}
	}

	function transport(){
		window.location=photoslink[which]
		//alert(window.location.href)
	}

	function slideit(){
		which = Math.floor(Math.random() * photos.length)
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		setTimeout("slideit()",slidespeed)
	}



// *******************************************************************
// script by drevil_nz, Michael Dillon, Christchurch New Zealand. 
// Permission granted to use this script provided this credit        
// remains intact. Visit my homepage www.chc.quik.co.nz/juggler/mikey.html
// Script written for Internet Explorer 4.0+.
// ******************************************************************* 

	//var message="Michael Dillon's dynamic title script"     //specifys the title
	//var message=message+"          " //gives a pause at the end,1 space=1 speed unit, here I used 10 spaces@150 each = 1.5seconds. 
	i="0"			         //declares the variable and sets it to start at 0
	var temptitle=""                 //declares the variable and sets it to have no value yet.
	var speed="150"                  //the delay in milliseconds between letters

	function titler(){
		if (!document.all&&!document.getElementById)
		return
		document.title=temptitle+message.charAt(i)  //sets the initial title
		temptitle=temptitle+message.charAt(i)       //increases the title by one letter
		i++					    //increments the counter
		if(i==message.length)			    //determines the end of the message
		{
		i="0"					    //resets the counter at the end of the message
		temptitle=""				    //resets the title to a blank value
		}
		setTimeout("titler()",speed) 		   //Restarts. Remove line for no-repeat.
	}



/* FOR STATUSBAR SCROLLER
*/

// stop the banner if it is currently running
function stopBanner() {	
	// if banner is currently running	
	if (bannerRunning)		
	// stop the banner		
	clearTimeout(timerID)	
	// timer is now stopped	
	timerRunning = false
}

// start the banner
function startBanner() {	
	// make sure the banner is stopped	
	stopBanner()	
	// start the banner from the current position	
	showBanner()
}

// assign state a string of "0" characters of the length of the current message
function clearState() {	
	// initialize to empty string	
	state = ""	
	// create string of same length containing 0 digits	
	for (var i = 0; i < ar[message].length; ++i) {		
		state += "0"	
	}
}

// display the current message
function showBanner() {	
	// if the current message is done	
	if (getString()) {		
		// increment message		
		message++		
		// if new message is out of range wrap around to first message		
	if (ar.length <= message)			
		message = 0		
		// new message is first displayed as empty string		
		clearState()		
		// display next character after pause milliseconds		
		timerID = setTimeout("showBanner()", pause)	
	} 
	else {		
		// initialize to empty string		
		var str = ""		
		// built string to be displayed (only character selected thus far are displayed)		
	for (var j = 0; j < state.length; ++j) {			
		str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     "		
	}		
	// partial string is placed in status bar		
	window.status = str		
	// add another character after speed milliseconds		
	timerID = setTimeout("showBanner()", speed)	
	}
}

function getString() {	
	// set variable to true (it will stay true unless proven otherwise)	
	var full = true	
	// set variable to false if a free space is found in string (a not-displayed char)	
	for (var j = 0; j < state.length; ++j) {		
		// if character at index j of current message has not been placed in displayed string		
		if (state.charAt(j) == 0)			
		full = false	
	}	
	// return true immediately if no space found (avoid infinitive loop later)	
	if (full) return true	
	// search for random until free space found (braoken up via break statement)	
	while (1) {		
		// a random number (between 0 and state.length - 1 == message.length - 1)		
		var num = getRandom(ar[message].length)		
		// if free space found break infinitive loop		
	if (state.charAt(num) == "0")			
		break	
	}	
	// replace the 0 character with 1 character at place found	
	state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)	
	// return false because the string was not full (free space was found)	
	return false
}

function getRandom(max) {	
	// create instance of current date	
	var now = new Date()		
	// create a random number (good generator)	
	var num = now.getTime() * now.getSeconds() * Math.random()	
	// cut random number to value between 0 and max - 1, inclusive	
	return num % max
}
// -->

	/***********************************************
	* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit http://www.dynamicdrive.com/ for full source code
	***********************************************/

	function iecompattest(){
		return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
	}

	function showmenu(e, which, optWidth){
		if (!document.all&&!document.getElementById)
		return
		clearhidemenu()
		menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
		menuobj.innerHTML=which
		menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
		menuobj.contentwidth=menuobj.offsetWidth
		menuobj.contentheight=menuobj.offsetHeight
		eventX=ie5? event.clientX : e.clientX
		eventY=ie5? event.clientY : e.clientY
		//Find out how close the mouse is to the corner of the window
		var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
		var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge<menuobj.contentwidth)
		//move the horizontal position of the menu to the left by it's width
		menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
		else
		//position the horizontal position of the menu where the mouse was clicked
		menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
		//same concept with the vertical position
		if (bottomedge<menuobj.contentheight)
		menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
		else
		menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
		menuobj.style.visibility="visible"
	
		return false
	}

	function contains_ns6(a, b) {
		//Determines if 1 element in contained in another- by Brainjar.com
		while (b.parentNode)
		if ((b = b.parentNode) == a)
		return true;
	return false;
	}

	function hidemenu(){
		if (window.menuobj)
		menuobj.style.visibility="hidden"
	}

	function dynamichide(e){
		if (ie5&&!menuobj.contains(e.toElement))
			hidemenu()
		else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		hidemenu()
	}

	function delayhidemenu(){
		delayhide=setTimeout("hidemenu()",500)
	}

	function clearhidemenu(){
		if (window.delayhide)
		clearTimeout(delayhide)
	}

////

	/***********************************************
	* Sticky Note script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* Visit DynamicDrive.com for hundreds of DHTML scripts
	* This notice must stay intact for legal use
	* Go to http://www.dynamicdrive.com/ for full source code
	***********************************************/

	//Specify display mode. 3 possible values are:
	//1) "always"- This makes the fade-in box load each time the page is displayed
	//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
	//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
	// For example, 2 would display the box about (1/2) 50% of the time the page loads.

	var displaymode= "always"
	var leftposition = 200 // in pixel
	var enablefade="yes" //("yes" to enable fade in effect, "no" to disable)
	var autohidebox=["yes", 20] //Automatically hide box after x seconds? [yes/no, if_yes_hide_after_seconds]
	var showonscroll="yes" //Should box remain visible even when user scrolls page? ("yes"/"no)
	var IEfadelength=3 //fade in duration for IE, in seconds
	var Mozfadedegree=0.05 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)

	////////No need to edit beyond here///////////

	if (parseInt(displaymode)!=NaN)
	var random_num=Math.floor(Math.random()*displaymode)

	function displayfadeinbox(){
		var ie=document.all && !window.opera
		var dom=document.getElementById
		iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		objref=(dom)? document.getElementById("fadeinbox") : document.all.fadeinbox
		var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
		var docwidth=(ie)? iebody.clientWidth : window.innerWidth
		docheight=(ie)? iebody.clientHeight: window.innerHeight
		var objwidth=objref.offsetWidth
		objheight=objref.offsetHeight
		objref.style.left=(leftposition+docwidth/2)-objwidth/2+"px"
		objref.style.top=scroll_top+docheight/2-objheight/2+"px"

		if (showonscroll=="yes")
		showonscrollvar=setInterval("staticfadebox()", 50)

		if (enablefade=="yes" && objref.filters){
			objref.filters[0].duration=IEfadelength
			objref.filters[0].Apply()
			objref.filters[0].Play()
		}
		objref.style.visibility="visible"
		if (objref.style.MozOpacity){
			if (enablefade=="yes")
				mozfadevar=setInterval("mozfadefx()", 90)
			else{
				objref.style.MozOpacity=1
				controlledhidebox()
			}
		}else controlledhidebox()
	}

	function mozfadefx(){
		if (parseFloat(objref.style.MozOpacity)<1)
			objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+Mozfadedegree
		else{
			clearInterval(mozfadevar)
			controlledhidebox()
		}
	}

	function staticfadebox(){
		var ie=document.all && !window.opera
		var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
		objref.style.top=scroll_top+docheight/2-objheight/2+"px"
	}

	function hidefadebox(){
		objref.style.visibility="hidden"
		if (typeof showonscrollvar!="undefined")
		clearInterval(showonscrollvar)
	}

	function controlledhidebox(){
		if (autohidebox[0]=="yes"){
			var delayvar=(enablefade=="yes" && objref.filters)? (autohidebox[1]+objref.filters[0].duration)*1000 : autohidebox[1]*1000
			setTimeout("hidefadebox()", delayvar)
		}
	}

	function initfunction(){
		setTimeout("displayfadeinbox()", 100)
	}

	function get_cookie(Name) {
		var search = Name + "="
		var returnvalue = ""
		if (document.cookie.length > 0) {
			offset = document.cookie.indexOf(search)
			if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length;
				returnvalue=unescape(document.cookie.substring(offset, end))
			}
		}
		return returnvalue;
	}

	if (displaymode=="oncepersession" && get_cookie("fadedin")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
		if (window.addEventListener)
		window.addEventListener("load", initfunction, false)
		else if (window.attachEvent)
		window.attachEvent("onload", initfunction)
		else if (document.getElementById)
		window.onload=initfunction
		document.cookie="fadedin=yes"
	}

//