var checkTimerID;
var imgWin;
var imgSrc;

function ShowLargeImage(src,str,isHorizontal)
{
    if(isHorizontal == 'True')
    {
	    imgWin = window.open("ShowImage.htm","window1", "width=660,height=525,toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,menubar=0");
	}
	else if(isHorizontal == 'False')
	{
	    imgWin = window.open("ShowImage.htm","window1", "width=500,height=700,toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,menubar=0");
	}
	imgWin.focus();
	title = str;
	imgSrc = src;
    clearInterval(checkTimerID);
    checkTimerID = setInterval("ShowImageCheck()", 500);
	return false;
}

function ShowTopLargeImage(src,str,isHorizontal)
{
    if(isHorizontal == 'True')
    {
	    imgWin = window.open("../ShowImage.htm","window1", "width=660,height=525,toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,menubar=0");
	}
	else if(isHorizontal == 'False')
	{
	    imgWin = window.open("../ShowImage.htm","window1", "width=500,height=700,toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,menubar=0");
	}
	imgWin.focus();
	title = str;
	imgSrc = src;
    clearInterval(checkTimerID);
    checkTimerID = setInterval("ShowImageCheck()", 500);
	return false;
}

var count = 0;
function ShowImageCheck()
{
    //IEはobject、FFはfunctionしか取れない模様→undefined以外ならOKということになった(吉岡S・張さん確認)
    //if('object' == typeof(imgWin.ShowImage))
    if('undefined' != typeof(imgWin.ShowImage))
    {
        try{
            imgWin.ShowImage(imgSrc,title);
        }
        catch(e){
            return;
        }
        clearInterval(checkTimerID);
        checkTimerID = null;
    }
    count++;
    if(10 < count){
        clearInterval(checkTimerID);
        checkTimerID = null;
    }
}