﻿var IconSizeW = 25;var IconSizeH = 55;var PicSizeW = 100;var PicSizeH = -5;var IsOpera = false;if (window.opera){	IsOpera = true;		PicSizeW += 25;	PicSizeH += 20;	IconSizeW += 25;	IconSizeH += 25;}//alert(IsIE);function GetXPosition(e){	if(IsOpera)	{		
		var x = event.clientX;		
		if (navigator.userAgent.indexOf('Opera 6') < 0 && navigator.userAgent.indexOf('Opera/6') < 0)
		{
			x = x + document.body.scrollLeft;			
		}		return x	}	else if(document.all)	{		return document.documentElement.scrollLeft + event.clientX	}	else if(document.layers || document.getElementById)	{		return e.pageX			} }function GetYPosition(e){	if(window.opera)	{		
		var y = event.clientY;
		if (navigator.userAgent.indexOf('Opera 6')<0 && navigator.userAgent.indexOf('Opera/6')<0)
		{			
			y = y + document.body.scrollTop;
		}		return y	}	else if(document.all)	{		return document.documentElement.scrollTop + event.clientY				}	else if(document.layers || document.getElementById)	{		return e.pageY			}
}

var thumbnailPic = "";

function SetIcon(targetID,iconType){		var target =  document.getElementById(targetID);			switch (iconType)
	{
		case "ViewScreenShot":			
			//target.onmouseover = IconPopUp1;
			//target.onmousemove = IconMove;							
			break;
		case "SiteInfo":			
			//target.onmouseover = IconPopUp2;
			//target.onmousemove = IconMove;				
			break;
		case "PostAgrees":				
			target.onmouseover = IconPopUp3;
			target.onmousemove = IconMove;						
			break;
		case "VisitSite":		
			//target.onmouseover = IconPopUp4;
			//target.onmousemove = IconMove;						
			break;
		default:			
			target.onmouseover = function(e)
			{		
				thumbnailPic = iconType;
				PicPopUp(e);
			}
			target.onmousemove = PicMove;						
			break;
				
	}				target.onmouseout = IconHide;		}

function SetIconDiv(){	var icondiv = document.createElement("div");	icondiv.id = "icondiv";	icondiv.style.position = "absolute";	if (IsOpera)	{		icondiv.style.margin = "25px";//Opera	}	document.body.appendChild(icondiv);	}

function IconPopUp1(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{			icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';		icondiv.innerHTML = "<b style='color:#999999'>ViewScreenShot</b>";	}	}

function IconPopUp2(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{		icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';		icondiv.innerHTML = "<i style='color:#000000'>SiteInfo</i>";	}}

function IconPopUp3(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{			icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';		icondiv.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='55' height='45' id='vote' align='middle'>" + 
							"<param name='allowScriptAccess' value='sameDomain' />" + 
							"<param name='movie' value='/images/vote.swf' />" + 
							"<param name='loop' value='false' />" + 
							"<param name='menu' value='false' />" + 
							"<param name='quality' value='high' />" + 
							"<param name='wmode' value='transparent' />	" + 						
							"<embed src='/images/vote.swf' loop='false' menu='false' quality='high' wmode='transparent' width='55' height='45' name='vote' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" + 
							"</object>";	}}

function IconPopUp4(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{			icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';		icondiv.innerHTML = "<span style='color:#0000ff'>VisitSite</span>";	}}

function PicPopUp(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{		icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';			icondiv.innerHTML = "<img src='" + thumbnailPic + "' border='0' style='margin-top:30px;'/>";//ブラウザによって、余白がないとダメ		icondiv.style.display = "none";
		st = setTimeout(function(){
			icondiv.style.display = "block";
			clearTimeout(st);
		},100);		
		//alert(icondiv.innerHTML);
	}
}

function IconHide(e){	var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{		icondiv.innerHTML = "";	}}function IconMove(e){	var icondiv = document.getElementById("icondiv");		if (icondiv != null)	{		icondiv.style.top = (GetYPosition(e) - IconSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - IconSizeW) + 'px';	}}function PicMove(e){		var icondiv = document.getElementById("icondiv");	if (icondiv != null)	{		icondiv.style.top = (GetYPosition(e) - PicSizeH) + 'px';		icondiv.style.left = (GetXPosition(e)  - PicSizeW) + 'px';	}}//↓header.ascx//window.onload = SetIconDiv;