if (typeof(document.documentElement.style.maxHeight) == 'undefined') {
	var pngElements = Array(
		'a#BLENZ_LOGO1 img',
		'a#BLENZ_LOGO2 img',
		'img#MENU_BAR',
		'div.mainVisual',
		'div.orderList h2 img',
		'img.PNG'
	);
	DD_belatedPNG.fix(pngElements.join(','));
}

var suffix1 = '_off.';
var suffix2 = '_on.';

function rollOver() {
	var images = $$('img').concat($$('input')); 

	var tmp = new Object();
	images.each( function(obj, index) {
		obj.galleryImg = false;
		if(obj.getAttribute('src') && obj.getAttribute('src').indexOf(suffix1)!=-1)
		{
			obj.onmouseover = function() {
				this.setAttribute('src', this.getAttribute('src').replace(suffix1, suffix2));
			}
			obj.onmouseout = function() {
				this.setAttribute('src', this.getAttribute('src').replace(suffix2, suffix1));
			}
			tmp[index] = new Image();
			tmp[index].src = obj.src.replace(suffix1, suffix2);
		}
	} );
}

function mainMenuBarIE6() {
	if (typeof document.body.style.maxHeight == 'undefined') {
		// IE 6.0 ˆÈ‰º
		if ($('MAIN_MENU')) {
			var html = $('MAIN_MENU').innerHTML;
			$('MAIN_MENU').innerHTML = '<img src="' + findCommon() + 'common/frame_03.png" width="949" height="61" alt="" id="MENU_BAR" />' + html;
		}
	}
}

function findCommon() {
	var dir = '';
	$$('img').each( function(img) {
		var path = img.getAttribute('src');
		if (path.indexOf('common/') != -1) {
			dir = path.split('common/')[0];
			throw $break;
		}
	} );
	return dir;
}

function email(txt1, txt2) {
	var address = txt1 + '@' + txt2;
	document.write('<a href="mailto:' + address + '">' + address + '</a>');
	return;
}

function mapLink() {
	if ($('SHOP_SELECT')) {
		$('SHOP_SELECT').onchange = function() {
			if ($F('SHOP_SELECT') != '') {
				var path = 'http://blenz-japan.com/form/map/?shop=' + $F('SHOP_SELECT');
				var mapWin = window.open(path, 'MAP', 'width=550,height=650,resizable=1,location=1');
				$('SHOP_SELECT').options[0].selected = true;
				$('SHOP_SELECT').blur();
				mapWin.focus();
			}
		}
	}

	if($$('div.mapBtn').length >= 1) {
		$$('div.mapBtn a').each( function(btn) {
			btn.onclick = function() {
				var mapWin = window.open(this.href, 'MAP', 'width=550,height=650,resizable=1,location=1');
				mapWin.focus();
				return false;
			}
		} );
	}
}

function seasonalMenu() {
	if ( $('HOT_DRINK') && $('ICE_DRINK') ) {
		$('HOT_BTN').onclick = function() {
			$('HOT_DRINK').style.display = 'block';
			$('ICE_DRINK').style.display = 'none';
		}
		$('ICE_BTN').onclick = function() {
			$('HOT_DRINK').style.display = 'none';
			$('ICE_DRINK').style.display = 'block';
		}
	}
}

Event.observe(window, "load", mainMenuBarIE6, false);
Event.observe(window, "load", mapLink, false);
Event.observe(window, "load", seasonalMenu, false);
Event.observe(window, "load", rollOver, false);