
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23706793-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


function settheDate(month,day,year,startorend){

var Parent;
Parent = top.opener;

if(startorend == 'start'){

Parent.showform.startday.value = day;
Parent.showform.startmonth.selectedIndex = month-1;
Parent.showform.startyear.value = year;
window.close('Calendar');
}
else{

Parent.showform.endday.value = day;
Parent.showform.endmonth.selectedIndex = month-1;
Parent.showform.endyear.value = year;
window.close('Calendar');
}



}

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 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 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 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 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;
			
			}
		
		}
	}
}

