//////////////////////////////////////////////////////////////////////////
//
// ロールオーバー
//
//////////////////////////////////////////////////////////////////////////
(function(){
	function rollover(){
		var targetClassName = "rollImg";
		var suffix = "_o";

		var overReg = new RegExp("^(.+)(\\.[a-z]+)$");
		var outReg = new RegExp("^(.+)" + suffix + "(\\.[a-z]+)$");

		var preload = new Array();
		var images = document.getElementsByTagName("img");
		var submitBtn = document.getElementsByTagName("input");

		for (var i = 0, il = images.length; i < il; i++) {
			var classStr = images[i].getAttribute("class") || images[i].className;
			var classNames = classStr.split(/\s+/);
			for(var j = 0, cl = classNames.length; j < cl; j++){
				if(classNames[j] == targetClassName){

					//preload
					preload[i] = new Image();
					preload[i].src = images[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");

					//mouseover
					images[i].onmouseover = function() {
						this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					}

					//mouseout
					images[i].onmouseout = function() {
						this.src = this.getAttribute("src").replace(outReg, "$1$2");
					}
				}
			}
		}
		for (var i = 0, il = submitBtn.length; i < il; i++) {
			var classStr = submitBtn[i].getAttribute("class") || submitBtn[i].className;
			var classNames = classStr.split(/\s+/);
			for(var j = 0, cl = classNames.length; j < cl; j++){
				if(classNames[j] == targetClassName){

					//preload
					preload[i] = new Image();

					preload[i] = new Image();
					if (submitBtn[i].getAttribute("src").indexOf("_o") == -1) {
						preload[i].src = submitBtn[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					} else {
						preload[i].src = submitBtn[i].getAttribute("src");
					}
					
					//mouseover
					submitBtn[i].onmouseover = function() {
						if (this.getAttribute("src").indexOf("_o") == -1) {
							this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
						} else {
							this.src = this.getAttribute("src");
						}
					}

					//mouseout
					submitBtn[i].onmouseout = function() {
						this.src = this.getAttribute("src").replace(outReg, "$1$2");
					}
				}
			}
		}
	}

	function addEvent(elem,event,func){
		if(elem.addEventListener) {
			elem.addEventListener(event, func, false);
		}else if(elem.attachEvent) {
			elem.attachEvent("on" + event, func);
		}
	}
	addEvent(window,"load",rollover);
})();
//////////////////////////////////////////////////////////////////////////
//
// NEWSのポップアップ制御
//
//////////////////////////////////////////////////////////////////////////
<!--
// サブウィンドウの大きさと開く位置の指定
l = 10; // 表示するx座標
t = 10; // 表示するy座標
w = 380; // 横幅
h = 324; // 縦幅
/*function openWindow() {
  window.open("popup.html","OpenWindow",
    "screenX="+l+",screenY="+t+",left="+l+",top="+t+",width="+w+",height="+h);
}*/
//-->
function WinOpen2(){
WinD02=window.open(RefHref2,'Controller','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=380,height=324');
WinD02.moveTo(10,10);
WinD02.opener=self
}
//////////////////////////////////////////////////////////////////////////
//
// IE6のリンクロールオーバー背景のちらつき防止
//
//////////////////////////////////////////////////////////////////////////

try {
document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}



function sideDisp(){
	document.write('	<table width="160" border="0" cellpadding="0" cellspacing="0">');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="5"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/backnumber.html" target="_blank"><img src="pict/btn_01.jpg" alt="購入申し込み" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/teiki.html" target="_blank"><img src="pict/btn_02.jpg" alt="定期購読申し込み" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="book.html" target="_self"><img src="pict/btn_03.jpg" alt="取り扱い書籍のご紹介" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="event.html" target="_self"><img src="pict/btn_05.jpg" alt="SPECIAL WINE EVENT!!" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="list.html" target="_self"><img src="pict/btn_06.jpg" alt="販売店一覧" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/inquiry.html" target="_blank"><img src="pict/btn_04.jpg" alt="お問い合わせ" width="160" height="40" class="rollImg" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="20"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/txt_news.gif" alt="NEWS" width="160" height="34"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td>');
	document.write('				<table width="160" border="0" cellspacing="0" cellpadding="10">');
	document.write('				<tr>');
	document.write('					<td bgcolor="#e3e3e3" class="text" style="font-size: 11px;line-height: 1.3;">');
	document.write('						<font color="#ff0000"><b>2011.8.10<br />ヴィノテーク企画・編集・取材・営業スタッフ募集</b></font><br /><a href="1108recruit.html"target="_self">&gt;&gt;詳細はこちらへ</a>');
	document.write('					</td>');
	document.write('		</tr>');
	document.write('		</tr>');
	document.write('				</table>		</td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="http://www.yomiuri.co.jp/gourmet/drink/tasaki/" target="_blank"><img src="pict/banner_01.jpg" alt="田崎真也のヴィノテーク　ワインバイイング・ガイド" width="160" height="55" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/book.html" target="_blank"><img src="pict/terroir_btn.jpg" alt="テロワール" width="160" height="60" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10" /></td>');
	document.write('		</tr>');
	document.write('	<tr>');
	document.write('			<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/book.html" target="_blank"><img src="pict/banner_02.jpg" alt="甲州のアロマ新発売！お申し込みはこちら" width="160" height="60" border="0"></a></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10" /></td>');
	document.write('		</tr>');
	document.write('	<tr>');
	document.write('		<td><a href="https://secure02.blue.shared-server.net/www.vinotheque.co.jp/form/book.html" target="_blank"><img src="pict/banner_03.jpg" alt="スキャンダラスなボルドーワイン　お申し込みはこちら" width="160" height="60" border="0" /></a></td>');
	document.write('	</tr>');
	document.write('		<tr>');
	document.write('			<td><img src="pict/space.gif" alt="" width="5" height="10" /></td>');
	document.write('		</tr>');
	document.write('	</table>');
}

