/* Plist1r2.js by Thomas Roeder */

/* handle simple events on plist form */

/* 02.09.99 	Plist OnSubmit event 
   22.11.99	Crossref OnSubmit event 
   27.11.2000	New function to open the pdf file viewer window 
		Netscape 6 workarounds					
   01.12.2007, Kai Krieger: URL changes
    */
	 

var HarkisPDFViewer;
var seriesContext = getSeriesContext();  
var HPage = getBaseUrl(seriesContext) +  '/_sb/?';
var language = document.haupt.action.substr(10, 2);
/* OnSubmit event */

function Chkplist() {
	if (document.plist.h_Artikel.value == "")
		return false;
	HPage = HPage + 'crq_pld';
	window.location.href = Hpage;
	return true;
}

/* OnSubmit event - Cross reference formular */

function Chkcr() {
	if (document.crossref.h_Artikel.value == "")
		return false;
	
	HPage = HPage + 'crq_pld';
	window.location.href = Hpage;
	return true;
}

/* OnClick event for the 'previous application' button */

function PrevApp() {
	HPage = HPage + 'crq_pprev';	
	document.plist_details.action = HPage;
	document.plist_details.submit();
}

/* OnClick event for the 'next application' button */

function NextApp() {
	HPage = HPage + 'crq_pnext';	
	document.plist_details.action = HPage;	
	document.plist_details.submit();
}

/* OnClick event für den Anfrage-Button auf der Teileliste Ergebnisseite. */

function PlInquiry() {
	if (document.plist_details) {
		//HPage = HPage + 'crq_inqpl';
		
		/* 2009-08-14, Viktor Pankraz
		 * Geändert, weil sonst die Anfrage bei Direktzugriff
		 * mit Artikelnummer in URL nicht funktioniert
		 */
		var plist_action;
		if ((HPage.indexOf('false') > -1)) {
			plist_action = document.plist_details.action;
			plist_action = plist_action.substr(0, plist_action.indexOf('?') + 1) + 'crq_inqpl';
		} else {
			plist_action = HPage + 'crq_inqpl';
		}
		document.plist_details.action = plist_action;
		/* document.plist_details.action = HPage + 'crq_inqpl'; */
		/* document.plist_details.target = "_parent"; */
		document.plist_details.submit();
	}
}


function OpenViewer() {
	if (! HarkisPDFViewer)
		HarkisPDFViewer = window.open('','HarkisPDFViewer','resizable=yes,width=800,height=600');
	else {
		if (HarkisPDFViewer.closed == true)
			HarkisPDFViewer = window.open('','HarkisPDFViewer','resizable=yes,width=800,height=600');
	}
	HarkisPDFViewer.focus();
}
