
	function submitForm(aForm, aAction, aTarget)
	{
		
		if (aAction != '')
			{
			aForm.cAction.value = aAction;
			}
		aForm.action = aTarget;
		aForm.submit();
	}

	function deletePaper(aPaperID){
		if (confirm("All paper details including authors will be deleted. Delete paper?"))
			{
				document.frmPaper.delPaper.value= aPaperID;
				submitForm(document.frmPaper, 'DELETE_PAPER', '')
			}
	}
	function PaperAdd()
	{
		
		document.frmPaper.keyid.value='0';
		submitForm(document.frmPaper, "", "/nqcontent.cfm?a_name=paper_add");
	}

	function PaperEdit(aPaperId)
	{
		document.frmPaper.keyid.value = aPaperId;
		submitForm(document.frmPaper, "", "/nqcontent.cfm?a_name=paper_edit");
	}
	
	
	function deleteParticipant(aPartID){
		if (confirm("Are you sure you want to delete?"))
			{
			document.participantFrm.delPart.value= aPartID;
			submitForm(document.participantFrm, 'DELETE_PARTICIPANT', '');
			}
	}

	function deleteAuthor(aAuthId){
		if (confirm("Are you sure you want to delete?"))
			{
			document.authorFrm.delAuth.value = aAuthId;
			submitForm(document.authorFrm,'DELETE_AUTHOR','')
			}
		
	}	
	
	function ParticipantFrm(aPID,aPType)
	{
		document.participantFrm.keyid.value=aPID;
		document.participantFrm.participantTp.value=aPType;
		if (aPID == 0)
			document.participantFrm.action="/nqcontent.cfm?a_name=participant_form_add";
		else
			document.participantFrm.action="/nqcontent.cfm?a_name=participant_form_edit";
		document.participantFrm.submit();
	}
	function submitFormWithKey(aForm,aTarget,aKeyId)
	{
		aForm.keyid.value=aKeyId;
		submitForm(aForm,'',aTarget);
	}


	function GoBack(){
		
	history.go(-1);
	}
	
	function xShowModalDialog( sURL, vArguments, sFeatures ) 
	{ 
		dFeatures = 'dialogHeight: 450px; dialogWidth: 1049px; dialogTop: 646px; dialogLeft: 4px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;';//default features 
		modalWin = ""; 
	
	    if (sURL==null||sURL=='') 
	    { 
	        alert ("Invalid URL input."); 
	        return false; 
	    } 
	    if (vArguments==null||vArguments=='') 
	    { 
	        vArguments=''; 
	    } 
	    if (sFeatures==null||sFeatures=='') 
	    { 
	        sFeatures=dFeatures; 
	    } 
	
	    if (window.navigator.appVersion.indexOf("MSIE")!=-1) 
	    { 
	        var cReturnValue = window.showModalDialog ( sURL, vArguments, sFeatures ); 
	        return cReturnValue; 
	    } 
	    sFeatures = sFeatures.replace(/ /gi,''); 
	    aFeatures = sFeatures.split(";"); 
	    sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,"; 
	
	    for ( x in aFeatures ) 
	    { 
	        aTmp = aFeatures[x].split(":"); 
	        sKey = aTmp[0].toLowerCase(); 
	        sVal = aTmp[1]; 
	        switch (sKey) 
	        { 
	            case "dialogheight": 
	                sWinFeat += "height="+sVal+","; 
	                pHeight = sVal; 
	                break; 
	            case "dialogwidth": 
	                sWinFeat += "width="+sVal+","; 
	                pWidth = sVal; 
	                break; 
	            case "dialogtop": 
	                sWinFeat += "screenY="+sVal+","; 
	                break; 
	            case "dialogleft": 
	                sWinFeat += "screenX="+sVal+","; 
	                break; 
	            case "resizable": 
	                sWinFeat += "resizable="+sVal+","; 
	                break; 
	            case "status": 
	                sWinFeat += "status="+sVal+","; 
	                break; 
	            case "center": 
	                if ( sVal.toLowerCase() == "yes" ) 
	                { 
						
	                    	sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+","; 
	                    	sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+",";
						
	                }
	                break; 
	        } 
	    } 
	    modalWin=window.open(String(sURL),"",sWinFeat); 
	    if (vArguments!=null&&vArguments!='') 
	    { 
	        modalWin.dialogArguments=vArguments; 
	    } 
	} 
	
		function nqGetObject( oName, oFrame, oDoc ) {
			if( !oDoc ) { if( oFrame ) { oDoc = oFrame.document; } else { oDoc = window.document; } }
			if( oDoc[oName] ) { return oDoc[oName]; } if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }
			if( oDoc.getElementById && oDoc.getElementById(oName) ) { return oDoc.getElementById(oName); }
			for( var x = 0; x < oDoc.forms.length; x++ ) { if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; } }
			for( var x = 0; x < oDoc.anchors.length; x++ ) { if( oDoc.anchors[x].name == oName ) { return oDoc.anchors[x]; } }
			for( var x = 0; document.layers && x < oDoc.layers.length; x++ ) {
				var theOb = nqGetObject( oName, null, oDoc.layers[x].document ); if( theOb ) { return theOb; } }
			if( !oFrame && window[oName] ) { return window[oName]; } if( oFrame && oFrame[oName] ) { return oFrame[oName]; }
			for( var x = 0; oFrame && oFrame.frames && x < oFrame.frames.length; x++ ) {
				var theOb = nqGetObject( oName, oFrame.frames[x], oFrame.frames[x].document ); if( theOb ) { return theOb; } }
			return null;
		}	