function deleteComment(commentid){
	
	var postBody = "commentid=" + commentid ;
	
	new Ajax.Request('inc/inc_articlefunctions.asp?action=deletecomment', { 
								method: 'post',	
								postBody: postBody ,
								onComplete: function(ajaxrequest){
									
									Effect.Fade($('comment_' + commentid ),{duration:0.5}) ;

								}
	});	
	
}

function addComment(){

	var articleid = $('articleid').value ;
	var author = escape($('author').value) ;
	var comment = escape($('comment').value) ;
	
	var url = 'inc/inc_articlefunctions.asp?action=addcomment';
	var postBody = "articleid=" + articleid ;
		postBody += "&author=" + author ;
		postBody += "&comment=" + comment ;
		
		new Ajax.Updater('commentsholder',url, { 
							 		method: 'post',	
									postBody: postBody ,
									onComplete: function(ajaxrequest){
										
										Effect.Appear($('commentadded')) ;
										$('author').value = '';
										$('comment').value = '';
										setTimeout(Effect.Fade($('commentadded')),3000) ;

									}
		});
		
	
}



function showHideOrgBox(){

					var orgbox;
								
					orgbox = document.getElementById('orgbox');
					
					if (document.editform.festival.checked == true || document.editform.publisher.checked == true || document.editform.organisation.checked == true || document.editform.venue.checked == true || document.editform.gallery.checked == true )
				{orgbox.style.display = ''; }

						else{
						orgbox.style.display = 'none';
						}
						
					
			}
			
			function submitForm(){
		document.subCatForm.submit();
	}
			
			
			function showHideDIV(divid){

					var div;
								
					div = document.getElementById(divid);
					
					if (div.style.display == 'none'){
						div.style.display = ''; 
						
							if(divid=='perfbox'){
							document['perfarrow'].src  = 'images/arrowup.gif';
							}
							if(divid=='prombox'){
							document['promarrow'].src  = 'images/arrowup.gif';
							}							
							
						}
						else{
						
						if(divid=='perfbox'){
							document['perfarrow'].src  = 'images/arrowdown.gif';
							}
							if(divid=='prombox'){
							document['promarrow'].src  = 'images/arrowdown.gif';
							}
					
						div.style.display = 'none';
						}
						
					
			}
			
			function showHideDIVS(){

					var div;
								
					div = document.getElementById('photodate');
					
					if (div.style.display == 'none'){
						div.style.display = ''; 
													
							}
						else{
						
											
						div.style.display = 'none';
						}
						
						div = document.getElementById('docfiles');
					
					if (div.style.display == 'none'){
						div.style.display = ''; 
													
							}
						else{
						
											
						div.style.display = 'none';
						}
						div = document.getElementById('photofiles');
					
					if (div.style.display == 'none'){
						div.style.display = ''; 
													
							}
						else{
						
											
						div.style.display = 'none';
						}
						div = document.getElementById('photoinfo');
					
					if (div.style.display == 'none'){
						div.style.display = ''; 
													
							}
						else{
						
											
						div.style.display = 'none';
						}
					
			}

function showHidePubBox(){

					var pubbox;
								
					pubbox = document.getElementById('pubbox');
					
					if (document.editform.publisher.checked == true)
				{pubbox.style.display = ''; }

						else{
						pubbox.style.display = 'none';
						}
						
					
			}



	function newWindow(file,window,width,height) {
    	msgWindow=open(file,window,'resizable=no,width='+width+',height='+height);
    	if (msgWindow.opener == null) msgWindow.opener = self;
	}
<!--
function load(file,target) {
    if (target != '')
        target.window.location.href = file;
    else
        window.location.href = file;
}
//-->

function changeView(strDivID){
	
	var divName = strDivID;
	var thisDiv = document.getElementById(divName);
	var strCodeInputName = divName.substring(3);
	
	strButtonName = 'htmlButton_' + strCodeInputName;
	strCodeInputName = 'codetype_' + strCodeInputName;
	
	switch(document.forms[0].elements[strCodeInputName].value){
	
	case 'html':
	
		thisDiv.innerHTML = thisDiv.innerText;
		document.forms[0].elements[strCodeInputName].value = 'wysiwyg';
		document.forms[0].elements[strButtonName].value = 'Show HTML';
		break;
	
	case 'wysiwyg':
	
		thisDiv.innerText = thisDiv.innerHTML;		
		document.forms[0].elements[strCodeInputName].value = 'html';
		document.forms[0].elements[strButtonName].value = 'Show Wysiwyg';
		break;
	}

}


	function submitForm(){
		document.subCatForm.submit();
	}

function processPostcard(){
var thisDiv = document.getElementById('pccontent');
var thisDivHTML = thisDiv.innerHTML
document.forms[0].elements['inputpccontent'].value = thisDivHTML;
}

function processForm(){

	for(var i = 0; i<document.forms[0].elements.length; i++){
		var e = document.forms[0].elements[i];
		var strName = e.name
					
		if(strName.substring(0,5) == 'input'){
								
			var strName2 = strName.substring(5);
			
			var strCodeInputName = 'codetype_' + strName2;
			strName2 = 'div' + strName2;
										
			var thisDiv = document.getElementById(strName2);
			var thisDivHTML = thisDiv.innerHTML
			var thisDivText = thisDiv.innerText
			
			switch(document.forms[0].elements[strCodeInputName].value){
	
			case 'wysiwyg':
				
			document.forms[0].elements[i].value = thisDivHTML;
			break;
			
			case 'html':
			document.forms[0].elements[i].value = thisDivText;
			break;
			
			}
		
		}
	}
}
