//FUNCTION initRollOvers
function initRollOvers(){
	if(!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++){
		if( 
			aImages[i].className == 'imgover_iepngfix' 
			&& navigator.appName=="Microsoft Internet Explorer"
			&& (!(navigator.userAgent.indexOf("Trident/4.0") != -1))
		 	){

			if(! aImages[i].filters[IEPNGFIX.filter] )break;
				aImages[i].src = aImages[i].filters[IEPNGFIX.filter].src;

				var src = aImages[i].getAttribute('src');
				var isov = src.substring(0,src.lastIndexOf('.'));
				if( isov.substring(isov.length-3, isov.length) != "_ov" && isov.substring(isov.length-4, isov.length) != "_off"){
					var ftype = src.substring(src.lastIndexOf('.'), src.length);
					var hsrc = src.replace(ftype, '_ov'+ftype);
		
					aImages[i].setAttribute('hsrc', hsrc);
					aPreLoad[i] = new Image();
					aPreLoad[i].src = hsrc;
					
					aImages[i].onmouseover = function(){
						if( !this.filters[IEPNGFIX.filter] ) return;
						this.src = this.filters[IEPNGFIX.filter].src;
						sTempSrc = this.getAttribute('src');
						this.setAttribute('src', this.getAttribute('hsrc'));
						IEPNGFIX.fix(this);
					}
					aImages[i].onmouseout = function(){
						if( !this.filters[IEPNGFIX.filter] ) return;
						this.src = this.filters[IEPNGFIX.filter].src;
						if(!sTempSrc) sTempSrc = this.getAttribute('src').replace('_ov'+ftype, ftype);
						this.setAttribute('src', sTempSrc);
						IEPNGFIX.fix(this);
					}
				}

			IEPNGFIX.fix(aImages[i]);
		} else if(aImages[i].className == 'imgover' || aImages[i].className == 'imgover_iepngfix'){
			var src = aImages[i].getAttribute('src');
			var isov = src.substring(0,src.lastIndexOf('.'));
			
			if( isov.substring(isov.length-3, isov.length) != "_ov" && isov.substring(isov.length-4, isov.length) != "_off"){
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_ov'+ftype);
	
				aImages[i].setAttribute('hsrc', hsrc);
				aPreLoad[i] = new Image();
				aPreLoad[i].src = hsrc;
				
				aImages[i].onmouseover = function(){
					sTempSrc = this.getAttribute('src');
					this.setAttribute('src', this.getAttribute('hsrc'));
				}
				aImages[i].onmouseout = function(){
					if(!sTempSrc) sTempSrc = this.getAttribute('src').replace('_ov'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}
			}
		} 
	}
}

//FUNCTION commonPop
//pFile = popup File
//pWidth = popup Width [optional]
//pHeight = popup Height [optional]
//pStatus = popup Features[optional]
function commonPop(pFile, pWidth, pHeight,pStatus){
	var fName = pFile.substring(pFile.lastIndexOf('/')+1, pFile.length);
	var wName = "pop_"+fName.substring(0, fName.indexOf('.'));
	if(pWidth == null){ pWidth = 700}
	if(pHeight == null){ pHeight = 600}
	if(pStatus == null){ pStatus = 'yes';}
	if(pWidth > screen.availWidth){
		pWidth = screen.availWidth;
		pStatus = 'yes';
	}
	if(pHeight > screen.availHeight-50){
		pHeight = screen.availHeight-50;
		pStatus = 'yes';
	}
	var wFeatures= 'menubar=no,scrollbars='+pStatus+',resizable='+pStatus+',width='+pWidth+',height='+pHeight;
	void(window.open(pFile, wName, wFeatures));
}

//use Accordion MENU

	var j$ = jQuery;

	j$(function(){

	function setBackground() {
		var $last = j$(".acc > li:last > a");
		if($last.hasClass("close"))
			$last.css("background-position", "left bottom");
		else
			$last.css("background-position", "left -30px");
	}

	j$(".acc").each(function(){
		j$("li > ul"            , this).wrap("<div></div>");
		j$("li > div:not(:last)", this).append("<div class='notlast'>&nbsp;</div>");
		j$("li > div:last"      , this).append("<div class='last'>&nbsp;</div>");
	});
j$(".acc > li > a", this).each(function(index){
			var $this = j$(this);

			if(index > 0) 
				$this.addClass("close").next().hide();
			else
				$this.css("background-position", "left top");

			setBackground();

			var prms = {height:"toggle", opacity:"toggle"};
			$this.click(function(){
				j$(this).toggleClass("close").next().animate(prms, {duration:"fast"})
					.parent().siblings().children("div:visible").animate(prms, {duration:"fast"}).prev().addClass("close");
				setBackground();
					 
				return false;
			});
		});
	
});
