window.addEvent('domready', function() {
imgM = $$('.menu');
Roll = $$('.imgRoll')
/*	
$each(imgM, function(a, b){
	 a.addEvent('mouseover', function(){
		  if(a.src.indexOf('_a.gif') < 0 ) a.src = a.src.replace('.gif','_a.gif');
		});
		a.addEvent('mouseout', function(){
		    a.src = a.src.replace('_a.gif','.gif');
		});
});*/

$each(Roll, function(a, b){
	 a.addEvent('mouseover', function(){
		  if(a.src.indexOf('_a.gif') < 0 ) a.src = a.src.replace('.gif','_a.gif');
		});
		a.addEvent('mouseout', function(){
		    a.src = a.src.replace('_a.gif','.gif');
		});
});

});


	 
function PNGfix(img, w, h){
	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 = "float:left;padding-left:15px; " + 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 style='float:left;padding-top:15px;padding-bottom:0px;'	><span " + imgID + imgClass + imgTitle +
		" style=\"" +
		"width:" +
		w +
		"px; height:" +
		h +
		"px;" +
		imgStyle +
		";" +
		"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" +
		"(src=\'" +
		img.src +
		"\', sizingMethod='image');\">&nbsp;</span></span>"
		//    alert(strNewHTML)
		//	 img.parentNode.innnerHTML='';
		document.getElementById('araaa').value = strNewHTML;
		img.outerHTML = strNewHTML;
	}
}

function tagEventHover(id,tag,idimg){
	var sfEls = $(id).getElementsByTagName(tag);
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {	
			if (this.className.search("rollOver")>=0){
				if ($(idimg).src.search("jpg")>=0){
					$(idimg).src=$(idimg).src.replace('.jpg','_a.jpg');
				}else{
					$(idimg).src=$(idimg).src.replace('.gif','_a.gif');
				}
			}
		}
		sfEls[i].onmouseout=function() {
			if (this.className.search("rollOver")>=0){
				if ($(idimg).src.search("jpg")>=0){
					$(idimg).src=$(idimg).src.replace('_a.jpg','.jpg');
				}else{
					$(idimg).src=$(idimg).src.replace('_a.gif','.gif');
				}
			}
		}
	}
}

function eventHover(id,tag){
	var sfEls = $(id).getElementsByTagName(tag);
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {	
			if (this.className.search("rollOver")>=0){
				if (this.src.search("jpg")>=0){
					this.src=this.src.replace('.jpg','_a.jpg');
				}else{
					this.src=this.src.replace('.gif','_a.gif');
				}
			}
		}
		sfEls[i].onmouseout=function() {
			if (this.className.search("rollOver")>=0){
				if (this.src.search("jpg")>=0){
					this.src=this.src.replace('_a.jpg','.jpg');
				}else{
					this.src=this.src.replace('_a.gif','.gif');
				}
			}
		}
	}
}

function eventRollHover(id){
	var sfEls = $(id).getElementsByTagName("A");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {	
			if (this.className.search("bckRollOver")>=0){
				if (this.style.backgroundImage.search("jpg")>=0){
					this.style.backgroundImage=this.style.backgroundImage.replace('.jpg','_a.jpg');
				}else{
					this.style.backgroundImage=this.style.backgroundImage.replace('.gif','_a.gif');
				}
			}
		}
		sfEls[i].onmouseout=function() {
			if (this.className.search("bckRollOver")>=0){
				if (this.style.backgroundImage.search("jpg")>=0){
					this.style.backgroundImage=this.style.backgroundImage.replace('_a.jpg','.jpg');
				}else{
					this.style.backgroundImage=this.style.backgroundImage.replace('_a.gif','.gif');
				}
			}
		}
	}
}
