
function preloadImg(i) { 
	var img = new Image(); img.src = i; return img;
}

function chmode(name, mode) { 
	if ( mode == 'on' ) add = '-on'; else add = ''; window.document.images[name].src = '/off-line/_res/'+name+add+'.gif';
}

function chmode_lnk(name, mode) { 
	if ( mode == 'on' ) add = '-on'; else add = ''; window.document.images[name].src = '/off-line/splash/'+name+add+'.jpg';
}

preloadImg('/i/d-t.gif');

function hideMDeliver(name) { 
	window.document.images[name].src = '/off-line/_res/d-t.gif';
}


var ie = (document.all)? true : false
var nn6 = (!ie && document.getElementById)? true : false
var nn4 = (document.layers)? true : false

function popupWin(name, uri, wdt, hgt) {
	var posCode = ''
	if (nn4 || nn6 || ie) {
	if ( (screen.height < 481) && (hgt > 400) ) { hgt = 400 }
		posX = Math.round((screen.width - wdt) / 2)
		posY = Math.round((screen.height - hgt) / 2)
		posCode = (nn4 || nn6)? ",screenX="+posX+",screenY="+posY : ",left="+posX+",top="+posY
	}
	popupedWin = window.open('/off-line/image_view.php?image='+uri, name, "status=no,menubar=no,toolbar=no,resizable=no,scrollbars=no,location=no,width="+wdt+",height="+hgt+posCode)
	popupedWin.focus()
}

function popupWinPreview(name, uri, wdt, hgt) {
	var posCode = ''
	if (nn4 || nn6 || ie) {
		posX = 0
		posY = 0
		posCode = (nn4 || nn6)? ",screenX="+posX+",screenY="+posY : ",left="+posX+",top="+posY
	}
	popupedWin = window.open(uri, name, "status=no,menubar=no,toolbar=no,resizable=no,scrollbars=no,location=no,width="+(screen.availWidth-10)+",height="+(screen.availHeight-28)+posCode)
	popupedWin.focus()
}