<!--
function addField(form, field, sectionpos) {
    form.secondaryaction.value = "addfield"
    form.secondaryactionfield.value = field
    form.secondaryactionsection.value = sectionpos
    form.submit()
}

function deleteField(form, field, sectionpos, pos) {
    form.secondaryaction.value = "deletefield"
    form.secondaryactionfield.value = field
    form.secondaryactionsection.value = sectionpos
    form.secondaryactionpos.value = pos
    form.submit()
}

function moveUp(form, field, sectionpos) {
    form.secondaryaction.value = "moveup"
    form.secondaryactionfield.value = field
    form.secondaryactionsection.value = sectionpos
    form.submit()
}

function moveDown(form, field, sectionpos) {
    form.secondaryaction.value = "movedown"
    form.secondaryactionfield.value = field
    form.secondaryactionsection.value = sectionpos
    form.submit()
}

function helpWin(url) {
    var tempwin = window.open(url,"helpwin","width=450,height=300,scrollbars=yes,resizable=yes,location=no,toolbar=no,menubar=no")
    tempwin.focus()
}

function popup(name, url, width, height) {
    var tempwin = window.open(url,name,"width="+width+",height="+height+",scrollbars=yes,resizable=yes,location=no,toolbar=no,menubar=no")
    tempwin.focus()
}

function popupWindow(name, url, width, height) {
    var win= window.open(url,name,"width="+width+",height="+height+",scrollbars=yes,resizable=yes,location=yes,toolbar=yes,menubar=yes")
    win.focus()
}

function dialog(name, url, width, height) {
    var dialogbox = window.open(url,name,"width="+width+",height="+height+",scrollbars=no,resizable=yes,location=no,toolbar=no,menubar=no")
    dialogbox.focus()
    if (dialogbox.opener == null) dialogbox.opener = self
    if (window.name == '') window.name = "mainwin"
}

function dialogWithParent(name, url, width, height, parentname) {
    var dialogbox = window.open(url,name,"width="+width+",height="+height+",scrollbars=no,resizable=yes,location=no,toolbar=no,menubar=no")
    dialogbox.focus()
    if (dialogbox.opener == null) dialogbox.opener = self
    window.name = parentname
}

function dialogWithParentSubmit(name, url, width, height, parentname, form) { 
    form.secondaryaction.value = "tmpsave" 
    form.submit()
    var dialogbox = window.open(url,name,"width="+width+",height="+height+",scrollbars=yes,resizable=yes,location=no,toolbar=no,menubar=no")    
    dialogbox.focus()
    if (dialogbox.opener == null) dialogbox.opener = self    
    window.name = parentname
}

function dialogWithScrollbars(name, url, width, height) {
    var dialogbox = window.open(url,name,"width="+width+",height="+height+",scrollbars=yes,resizable=yes,location=no,toolbar=no,menubar=no")
    dialogbox.focus()
    if (dialogbox.opener == null) dialogbox.opener = self
    if (window.name == '') window.name = "mainwin"
}

function refreshParent(dialogbox) {
    if (dialogbox.opener != null) dialogbox.opener.location.reload()
}

function closeDialogRefreshParent() {
    if (window.opener != null) window.opener.location.reload()
    window.close()
    return true
}

function closeDialog() {
    window.close()
    return true
}

function sendForm(form) {
    if (window.opener) {
	form.target = window.opener.name
    }
    else {
	form.target = "mainwin"
    }
    form.submit()
    setTimeout('window.close()', 1000)
}

function goToStep(num) {
    document.metadataform.secondaryaction.value = "gotostep"
    document.metadataform.prevstep.value = document.metadataform.step.value
    document.metadataform.step.value = num
    document.metadataform.submit()
}

function addOtherValue(field) {
    if (document.metadataform.elements[field].value == "Other ...") {
	 document.metadataform.secondaryactionfield.value = field
         otherDialog = window.open("http://www.icdlbooks.org/servlet/icdladmin/other.html","popupdialog","width=350,height=75,scrollbars=no,resizable=no,location=no,toolbar=no,menubar=no")
    	 otherDialog.focus()
	 if (otherDialog.opener == null) otherDialog.opener = self
    }
    return false
}

function addOtherValueAlways(field) {
    document.metadataform.secondaryactionfield.value = field
    otherDialog = window.open("http://www.icdlbooks.org/servlet/icdladmin/other.html","popupdialog","width=350,height=75,scrollbars=no,resizable=no,location=no,toolbar=no,menubar=no")
    otherDialog.focus()
    if (otherDialog.opener == null) otherDialog.opener = self
    return false
}

function addNewValue(value) {
    document.metadataform.secondaryaction.value = "addothervalue"
    document.metadataform.secondaryactionvalue.value = value
    document.metadataform.submit()
}

function addFavoriteLink(url,favorite,link) {

    //if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
    if (window.external) {
	document.write('<A HREF="javascript:window.external.AddFavorite(\'' + url + '\',\'' + favorite + '\')">' + link + '</a>');
    }
}

function addFavoriteButton(url,favorite,link) {

    if (window.external) {
	document.write('<input type="button" onclick="javascript:window.external.AddFavorite(\'' + url + '\',\'' + favorite + '\')" value="' + link + '">');
    }
}

function goToSection(form, section) {
    form.secondaryaction.value = "gotosection"
    form.prevsection.value = form.section.value
    form.section.value = section
    form.submit()
}

function goToSectionShowProgress(form, section) {
    rotatecontent('dyncontent');
    form.secondaryaction.value = "gotosection";
    form.prevsection.value = form.section.value;
    form.section.value = section;
    form.submit();
}

function markClean(form, stringid) {
	form.secondaryaction.value = "markclean"	
	form.string.value = stringid
	form.submit()
}

function targetopener(mylink, closeme, closeonly) {
	if (!(window.focus && window.opener)) return true;
	window.opener.focus();
	if (!closeonly)window.opener.location.href=mylink.href;
	if (closeme) window.close();
	return false;
}

//-->

