		var oldObj = null;
		var selectedObj = null;
		var popup = null;
		var table = null;
		
		function display(obj){
			document.getElementById(obj).style.display = 'none';			
		}
		function statusbar(){
			window.status = this.innerHTML;
		}

		function view(obj){
				document.getElementById(obj).style.display = 'block';			
		}

		function hidden(obj){	
				document.getElementById(obj).style.display = 'none';			
		}
		
		function isNull(obj){
			if(document.getElementById(obj)!=null)
				return false;
			else 
				return true;
		}
		
		function viewpopup(ppp,tbl,src){
			t = null;
			p =null;
			isrc=null
			img=null;
			if(!isNull(tbl)){
				p=ppp
				t = tbl;
				isrc = src.replace('.png','_selection.png');
			}else{
				t = 'c'+this.id;
				p='popup'+this.id.charAt(0);
			}
			
			if(!isNull(table))
				hidden(table);
			if(!isNull(popup))	
				hidden(popup);
			view(t);
			view(p);			
			table = t;
			popup = p;
		}
		
		function swapmenu(){
			swap(this);
			document.getElementById('imgdes').firstChild.innerHTML = this.alt;
		}
		
		function swap(obj){
			if(this.tagName == 'IMG'){
				obj = this;
			}
			if(obj.src.indexOf('_selection')> -1){
				obj.src = obj.src.replace('_selection','');
			}else{
				obj.src = obj.src.replace('.png','_selection.png');
			}
		}		
		
		function initSwapMenu(){
			p = document.getElementById('imgcmenu');
			a = p.firstChild;
			while(a!=null && a.tagName == 'A'){
				a.firstChild.onmouseover = swapmenu;
				a.firstChild.onmouseout = swapmenu;
				if(!isNull('c120')){
					a.firstChild.onclick = viewpopup;
				}
				a = a.nextSibling.nextSibling;
			}			
		}
				
		function init(){	
			if(!isNull('imgcmenu')){
				initSwapMenu();
			}
			if(!isNull('c120')){
				hidden('c120');
				hidden('c140');
				hidden('c220');
				hidden('c240');
				hidden('c320');
				hidden('c340');
				hidden('c420');
				hidden('c440');
				hidden('c520');
				hidden('c540');
				hidden('c640');
			}
			if(!isNull('submit')){
				initForm();
			}
/*
if(document.getElementsByTagName('form').length > 0){
				initFormField('input');
				initFormField('textarea');
			}				
	*/			
		}
		
		window.onload=function(){
									init();
								}