function selectBox(num) {
    var path=window.location.href;
    var fileName=path.substring(path.lastIndexOf('/',path.length)+1,path.length);
    var fileName2=path.substring(path.lastIndexOf('_',path.length)+1,path.length);
    var fileName3=path.substring(path.lastIndexOf('.',path.length)-1,path.length);
    var fileName4=fileName.substring(0,fileName.indexOf(".")-4);
    var fileName5=fileName2.substring(0,fileName2.indexOf(".")-1);
    var opt = '';
    for ( i = 1 ; i <= num ; i++ ) {
	if (i < 10) {
	    ico = '00' + i;
	} else if (i < 100) {
	    ico = '0' + i;
	}else{
	    ico = i
	  }
	if ((ico == fileName5) || ('e'+ico == fileName5)){
	    opt += '<option value="' + fileName4 + ico + fileName3 + '" selected="selected">' + ico + '</option>';
	}else{
	    opt += '<option value="' + fileName4 + ico + fileName3 + '">' + ico + '</option>';
	}
    }
    document.write('<div class="jump"><form method=post><p><select name="jump">' + opt + '</select>' + '<span class="deno">/' + num + '</span><input type="button" value="Go" onclick="location.href = this.form.jump.options[jump.selectedIndex].value;" onkeypress="location.href = this.form.jump.options[jump.selectedIndex].value;" /></p></form></div>');
}

function disp(url){
    try{
	if(!window.opener || window.opener.closed){
	    var newMainWin =window.open(url, "main", "location=1, toolbar=1, menubar=1, status=1, scrollbars=1, resizable=1, titlebar=1, directories=1");
	    newMainWin.focus();
	}
	else{
	    opener.window.focus();
	    opener.window.location=url;
	    opener.window.focus();
	}
    }
    catch (e){
	try{
	    opener.window.focus();
	    opener.window.location=url;
	    opener.window.focus();
	}catch(err){
	    var theWin =window.open(url, "opener", "location=1, toolbar=1, menubar=1, status=1, scrollbars=1, resizable=1, titlebar=1, directories=1");
	    theWin.window.focus();
	}
    }
}

window.onload = function() {
    try{
	imgWidth = document.getElementsByTagName('img')[0].width;
	divs = document.getElementsByTagName('div');
	address = document.getElementsByTagName('address');
	if(imgWidth > 1000){
	    for(i = 0; i < divs.length; i++){
		div = divs[i];
		if(div.className == 'navi' || div.className == 'imageArea') {
		    div.style.width = imgWidth + 'px';
		    address[0].style.width = imgWidth + 'px';
		}
	    }
	}
    }catch(e){
	false;
    }

    bodyId = document.getElementsByTagName('body')[0].getAttribute('id');
    if(bodyId == 'regularImg'){
	widthResize();
    }
}

function widthResize(){
    parentWidth=document.body.clientWidth;
    divs = document.getElementsByTagName('div')
      address = document.getElementsByTagName('address');
    if (parentWidth > 1000){
	for(i = 0; i < divs.length; i++){
	    div = divs[i];
	    if(div.className == 'navi' || div.className == 'imageArea') {
		div.style.width = '960px';
	    }
	}
	address[0].style.width = '960px';
    }else if (parentWidth > 780) {
	for(i = 0; i < divs.length; i++){
	    div = divs[i];
	    if(div.className == 'navi' || div.className == 'imageArea') {
		div.style.width = '100%';
	    }
	}
	address[0].style.width = '100%';
    }else {
	for(i = 0; i < divs.length; i++){
	    div = divs[i];
	    if(div.className == 'navi' || div.className == 'imageArea') {
		div.style.width = '750px';
	    }
	}
	address[0].style.width = '750px';
    }
}

function resize(){
    imgLayout=setTimeout("widthResize()",400);
}

function imgResize(){
    bodyId = document.getElementsByTagName('body')[0].getAttribute('id');
    if(bodyId == 'regularImg'){
	resize();
    }
}

window.onresize = imgResize;
