// JavaScript Document
/*
preview page
*/

function getScrollPosition() {
	var obj = new Object();
	obj.y = document.documentElement.scrollTop || document.body.scrollTop;
	return obj;
}

function setyscroll(){
	y=document.form.yscroll.value;
	scrollBy(0,y);
}

function go_sub(par) {
	hi=document.form.historys.value;
	hi=hi.replace(/-/g,'');
	hi=hi.replace(/=/g,'-');
	if(par=='WORD'){
		document.form.action='../content/psearch.html?code=' + hi;
	} else {
		document.form.action='../content/ppreview.html?code=' + hi;
	}
	document.form.mode.value=par;
	document.form.yscroll.value=getScrollPosition().y;
	document.form.submit();
}
function go_back(par1,par2) {
	hi=par2;
	hi=hi.replace(/-/g,'');
	hi=hi.replace(/=/g,'-');
	if(par1=='' || par2==''){
	history.back();
	} else {
	if(par1=='C'){
		document.form.action='../content/pcategory.html?code=' + hi;
	}
	if(par1=='S'){
		document.form.action='../content/ppreview.html?code=' + hi;
	}
	if(par1=='I'){
		document.form.action='../content/pindt.html?code=' + hi;
	}
	document.form.mode.value='BACK';
	document.form.yscroll.value=0;
	document.form.historys.value=par2;
	document.form.submit();
	}
}

function go_kanpro(par1,par2) {
	hi=document.form.historys.value;
	hi=hi.replace(/-/g,'');
	hi=hi.replace(/=/g,'-');
	hi=hi + '-' + par1+par2
	if(par1=='C'){
		document.form.action='../content/pcategory.html?code=' + hi;
		document.form.cateid.value=par2;
	} else {
		document.form.action='../content/ppreview.html?code=' + hi;
		document.form.proid.value=par2;
	}
	document.form.mode.value='';
	document.form.submit();
}
function go_single(par) {
	hi=document.form.historys.value;
	hi=hi.replace(/-/g,'');
	hi=hi.replace(/=/g,'-');
	document.form.action='../content/ppreview.html?code=' + hi;
	document.form.mode.value='';
	document.form.single.value=par;
	document.form.yscroll.value=0;
	document.form.submit();
}
var w = window; 

function go_zumen(par) {
	uidn=document.form.uidn.value;
	histo=document.form.historys.value;
	ment=document.form.ment.value;
	urln='../content/cadin.html?uidn=' + uidn + '&lasturl=' + histo + '&hinmei=' + par + '&ment=' + ment;
	if ((w == window) || w.closed) {
		w = open(urln,'CODELIST', 'width=600,height=350,scrollbars=yes,resizable=yes');
		} else {
		w.focus();
		}

}
function opwd1(url,winName,features) { //v2.0
window.open(url, winName,features);
}


function go_non() {
}

function go_catalog() {
	if(confirm('このPDFのダウンロードにはメンバー登録が必要です。ログインするか、メンバー登録を行ってください。')){
	par =document.form.historys.value;
	document.form.action='../cgi-bin/login.html?lasturl=' + par;
	document.form.submit();
	}
}
