function SetWallpaperGallery(){
	//if(navigator.userAgent.indexOf('MSIE 7') != -1){
	//	return false;
	//}
	
	var allParas = new Array();
	allParas = document.getElementsByTagName('p');
	
	var thissrc = '';
	
	for(i = 0; allParas.length > i; i++){
		if(allParas[i].className == 'wallpaper'){
			if(allParas[i].childNodes.item(0).src){
				thissrc = allParas[i].childNodes.item(0).src;
				thissrc = thissrc.replace(document.URL, "");
				allParas[i].style.backgroundImage = 'url(' + thissrc + ')';
				allParas[i].innerHTML += '<span class="previewcover" ></span>';
			}
		}
	}
}

function DrawPreviewModeSwitch(){
	//if(navigator.userAgent.indexOf('MSIE 7') != -1){
	//	return false;
	//}
	
	if(navigator.userAgent.indexOf('iPhone') != -1){
		document.write('<p><strong>注意</strong>：iPhone/iPod touchから画像を保存すると画質が低下する場合があります。コンピュータで画像を保存してからiPhone/iPod touchに同期して使用されることをオススメします。');
	}
	document.write('<form action="" method="get" onsubmit="return false"><p><input type="checkbox" checked="checked" name="PreviewMode" id="PreviewMode" onclick="SetPreviewMode()" onchange="SetPreviewMode()" /> <label for="PreviewMode">プレビュー表示モード</label></p></form>');
}

function SetPreviewMode(){
	if(document.getElementById('PreviewMode').checked){
		document.getElementsByTagName('article')[0].className = 'previewmode';
	}else{
		document.getElementsByTagName('article')[0].className = '';
	}
}

if(navigator.userAgent.indexOf('Gecko/') != -1){
	document.write('<style type="text/css">.wallpaper img:active{ opacity:1 !important; }</style>');
}