/**
 * @Copyright@
 * @6.1@
 */
 


function dotocChapter(chapid){
document.oHSUSTocMenuForm.action=webroot+"/toc/showChapter.do?id="+chapid;
	document.oHSUSTocMenuForm.submit();
}
function dotocPart(partid){
document.oHSUSTocMenuForm.action=webroot+"/toc/showPart.do?id="+partid;
	document.oHSUSTocMenuForm.submit();
}
function dotocEssay(essayid){
document.oHSUSTocMenuForm.action=webroot+"/toc/showEssay.do?id="+essayid;
	document.oHSUSTocMenuForm.submit();
}
function dotocTableGroup(tableGrpid){
document.oHSUSTocMenuForm.action=webroot+"/toc/showTable.do?id="+tableGrpid;
	document.oHSUSTocMenuForm.submit();
}
function dotrialRegPage(){
document.oHSUSTocPartForm.action=webroot+"/toc/trialRegPage.do?trial=trial";
	document.oHSUSTocPartForm.submit();
}
function  doOrgReg(){
document.oHSUSTocPartForm.action=webroot+"/toc/orgRegPage.do";
	document.oHSUSTocPartForm.submit();
}

function doaboutHsus(){
document.oHSUSTocPartForm.action=webroot+"/toc/aboutHsus.do";
	document.oHSUSTocPartForm.submit();
}

function doreviewQuotes(){
document.oHSUSTocPartForm.action=webroot+"/toc/reviewQuote.do";
	document.oHSUSTocPartForm.submit();
}
function doPartSearch(){
	document.oHSUSTocPartForm.action=webroot+"/toc/partSearch.do";
	document.oHSUSTocPartForm.submit();
	}
function doChapterSearch(){
	document.oHSUSTocChapterForm.action=webroot+"/toc/chapterSearch.do";
	document.oHSUSTocChapterForm.submit();
	}
	
function showTocContributors(editorId){
	document.forms[2].editorname.value=editorId;
	document.forms[2].action=webroot+"/toc/showIndex.do?contId="+editorId;
	document.forms[2].submit();
	}
	
function doTreeTableCall(id){
	document.oHSUSTocTableForm.screenWidth.value=screen.width;
	document.oHSUSTocTableForm.action=webroot+"/toc/tableToc.do?id="+id;
	document.oHSUSTocTableForm.submit();
}

function doAckTable(id){
	document.forms[2].screenWidth.value=screen.width;
	document.forms[2].action=webroot+"/toc/tableToc.do?id="+id;
	document.forms[2].submit();
}

function showContributor(idCon)	{
	document.oHSUSTocTableForm.contributor.value=idCon;
	document.oHSUSTocTableForm.action=webroot+"/toc/showIndex.do?contId="+idCon;
	document.oHSUSTocTableForm.submit();
	}
	
function doTableDownload(tableid){
	document.oHSUSTocTableForm.tableDownloadFlag.value="true";
	document.oHSUSTocTableForm.action=webroot+"/toc/showDownloadableTable.do?id="+tableid;
	document.oHSUSTocTableForm.submit();
	}
	
function doCancelDownloadTable(tableid){
	document.oHSUSTocTableForm.tableDownloadFlag.value="false";
	document.oHSUSTocTableForm.action=webroot+"/toc/showTable.do?id="+tableid;
	document.oHSUSTocTableForm.submit();
	}	
function dotoctable(id){
	document.oHSUSTocMenuForm.screenWidth.value=screen.width;
	document.oHSUSTocMenuForm.action=webroot+"/toc/treeTablePath.do?id="+id;
	document.oHSUSTocMenuForm.submit();
}

var PositionX;
var PositionY;
var flag = 0;

function showEssayPdf(pdfid){
 	var optIE='menubar=no,scrollbars=yes,width=1020,height=700,left='+PositionX+',top='+PositionY;
 	if(flag == 0){
		pdfwindow = window.open(pdfid,"PrinterView",optIE);
		flag=1;
	}else{
		pdfwindow.close();
		pdfwindow = window.open(pdfid,"PrinterView",optIE);
		pdfwindow.focus();
	}
}

function popupPdfWindow(str) {
	// window features
	var optIE='menubar=no,scrollbars=yes,width=1020,height=700,left='+PositionX+',top='+PositionY;

    if (!window.window2) {
        // has not yet been defined
        window2 = window.open(str,'windowRef', optIE);
        window2.focus();
    } else {
        window2 = window.open(str,'windowRef', optIE);
        window2.focus();
    }
}

function doDownloadTableGroup(tableGroupId){
	//document.oHSUSTocTableForm.tableGroupId.value=tableGroupId;
	document.oHSUSTocTableForm.action=webroot+"/servlet/HSUSDownload?tableGroupId="+tableGroupId;
	document.oHSUSTocTableForm.submit();
	
}

var PositionX;
var PositionY;
var flag = 0;

function showTablePdf(pdfid){
 	var optIE='menubar=no,scrollbars=yes,width=1020,height=700,left='+PositionX+',top='+PositionY;
 	if(flag == 0){
		pdfwindow = window.open(pdfid,"PrinterView",optIE);
		flag=1;
	}else{
		pdfwindow.close();
		pdfwindow = window.open(pdfid,"PrinterView",optIE);
		pdfwindow.focus();
	}
}

function showEssay(id){
	document.forms[2].action = webroot+"/toc/showEssayPath.do?id="+id;
	document.forms[2].submit();
	}
function showFrontEssay(id){
	document.forms[0].action = webroot+"/toc/showFrontEssay.do?id="+id;
	document.forms[0].submit();
}
	
function showcart(id){
	document.forms[2].action = webroot+"/toc/showppvshopcart.do?id="+id;
	document.forms[2].submit();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}