//キャンペーン情報出力
function campaignWri(){
	var imgList=new Array();
	for(i=0;i<randomList.length;i++){imgList[i]=0;}

	for(i=0;i<randomList.length;i++){
		j=randomList.length-i;
		a=Math.floor(Math.random()*j);
		for(k=0,b=-1;b<0;k++){
			if(imgList[k]==0)a--;
			if(a<0)b=k;
		}
		imgList[b]=i+1;
	}
	for(i=0;i<randomList.length;i++){
		if(i<3){
			if(randomList[imgList[i]-1][5] == "") document.write('<li><a href="'+randomList[imgList[i]-1][0]+'"><img src="'+randomList[imgList[i]-1][1]+'" width="'+randomList[imgList[i]-1][2]+'" height="'+randomList[imgList[i]-1][3]+'" alt="'+randomList[imgList[i]-1][4]+'" /></a></li>');
			if(randomList[imgList[i]-1][5] == "text") document.write('<li class="text"><a href="'+randomList[imgList[i]-1][0]+'">'+randomList[imgList[i]-1][4]+'</a></li>');
		}
	}
}

//画像ロールオーバー
function ROfunction(){
	var imgNum=document.getElementsByTagName("img");
	var inputNum=document.getElementsByTagName("input");
	overNum=new Array;
	for(i=0;i<imgNum.length;i++){overNum[i]=imgNum[i];}
	for(i=0;i<inputNum.length;i++){overNum[i+imgNum.length]=inputNum[i];}
	for(i=0;i<overNum.length;i++){
		if(overNum[i].className.indexOf("Rover")!=-1){
			overNum[i].overimg=new Image();
			if(overNum[i].className.indexOf(":")!=-1){
				Replace=overNum[i].className.split(":");
				Replace=Replace[1].split(" ");
				overNum[i].overimg.src=Replace[0];
			}else{
				Replace = overNum[i].src.length;
				overNum[i].overimg.src=overNum[i].src.substring(0,Replace-4)+"_o"+overNum[i].src.substring(Replace-4,Replace);
			}
			overNum[i].setAttribute("out",overNum[i].src);
			overNum[i].onmouseover=new Function('this.src=this.overimg.src;');
			overNum[i].onmouseout=new Function('this.src=this.getAttribute("out");');
		}
	}
}
if(window.addEventListener){window.addEventListener("load",ROfunction,false);}else if(window.attachEvent){window.attachEvent("onload",ROfunction);}else{window.onload = ROfunction;}


//inputテキスト制御
function inputValueHidden(Obj,State,Num){
	if(State=='onfocus' && Obj.value==Num) Obj.value="";
	if(State=='onblur' && Obj.value=="") Obj.value=Num;
}


//画像レイヤー切り替え
	function TABfunction(Num,Length,path){
		for(i=1; i<=Length ; i++){
			layobj=getID('tabBlock'+i);
			if(path) document.getElementById("phopvBoxImg").src=path;
			if(i==Num){
				layobj.display='block';
			}else{
				layobj.display='none';
			}
		}
	}


//HTML切り替え
	function HTMLfunction(Num,Length){
		layobj=getID(Num);
		document.getElementById(Num).innerHTML=Length;
	}



	function getID(layName){
		if(document.getElementById)return document.getElementById(layName).style;
		if(document.layers)return document.layers[layName];
		if(document.all)return document.all(layName).style;
	}



//チェックボックス・ラジオボタン 画像選択
function clickInput(label){
	var e = null;
	try{
		e = document.getElementById(label.htmlFor);
	}
	catch(exception){}
	if(e == null){
		var node;
		for(var i=0; i<label.childNodes.length; i++){
			node = label.childNodes.item(i);
			if(node.nodeName == 'INPUT'){
				e = node;
				break;
			}
		}
	}
	if(e != null){
		switch(e.type){
			case 'checkbox':
				e.checked =! e.checked;
				return false;
			case 'radio':
				e.checked = true;
				return false;
			case 'text': case 'password': case 'textarea':
				e.focus(); 
				return false;
		}
	}
}


var swfVersion="8";
var swfDirectory="./"

var VBflash="ShockwaveFlash.ShockwaveFlash."+swfVersion;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin){
	plugin = parseInt(plugin.description.match(/\d+\.\d+/)) >= swfVersion;
}else{
	document.write('<script language=VBScript>\n');
	document.write('on error resume next\n');
	document.write('plugin=(IsObject(CreateObject(VBflash)))\n');
	document.write('</script\>');
}

function showSwf(){
	if (plugin){
		document.write('<style type="text/css">#noflashContents{display:none;}</style>');
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+swfWidth+'" height="'+swfHeight+'">');
		document.write('<param name="movie" value="'+ swf +'" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="base" value="'+swfDirectory+'">');
		document.write('<embed src="'+ swf +'" base="'+swfDirectory+'" loop="true" quality="high" swLiveConnect="false" width="'+swfWidth+'" height="'+swfHeight+'" type="application/x-shockwave-flash"></embed>');
		document.write('</object>');
	}
}



