//the main function, call to the effect object
function init(){
var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
var toggles = document.getElementsByClassName('display'); //h3s where I click on

//accordion effect
var myAccordion = new fx.Accordion(toggles, stretchers, {opacity: true, duration: 500});

//hash function
function checkHash(){
	var found = false;
	toggles.each(function(h3, i){
		if (window.location.href.indexOf(h3.title) > 0) {
			myAccordion.showThisHideOpen(stretchers[i]);
			found = true;
		}
	});
	return found;
}

if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);
}

//var ScrollLinks = {
//	currentHash: false,
//	start: function(){
//		this.scroll = new fx.Scroll({duration: 1200, transition: fx.sineOut, onComplete: function(){this.end();}.bind(this)});
//		this.allinks = $c(document.getElementsByTagName('a'));
//		this.allinks.each(function(lnk){
//			if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) 
//				|| ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {
//				lnk.onclick = function(){
//					ScrollLinks.scroll.clearTimer();
//					this.initialHref = this.href;
//					this.initialHash = this.hash;
//					this.href = "javascript:void(0)";
//					setTimeout(function(){this.href = this.initialHref;}.bind(this), 200);
//					ScrollLinks.go(this);
//				}
//			}
//		});
//	},
//
//	go: function(link){
//		this.currentHash = link.initialHash.slice(1);
//		if (this.currentHash) {
//			this.allinks.each(function(lnk){
//				if (lnk.id == ScrollLinks.currentHash){
//					if (window.opera) lnk =  [lnk].find('parentNode');
//					ScrollLinks.scroll.scrollTo(lnk);
//					return;
//				}
//			});
//		}
//	},
//
//	end: function(){
//		if (!/Konqueror|Safari|KHTML/.test(navigator.userAgent)) window.location.hash = "#"+this.currentHash;
//		this.currentHash = false;
//	}
//}

//window.onload = function() {
////height effect
//document.getElementById("loginContent").style.visibility = 'visible';
//myHeight = new fx.Height('loginContent');
//$('tabheight').onclick = function() {
//	myHeight.toggle();
//	};
//};


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
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);
