window.addEvents({
	'domready': function() {
		setDefaultInputText();
		pushboxSlideShow();
		getToolTips();
		getToolTipFix();
		initTeaserFirstClass();
		emptySearchString();
		getPostFilter('form.jobfilter');
		removeTagsWhenEmpty("div.leftmenu","span.foot");
		removeTagsWhenEmpty("div.right","span.foot");
		removeTagsWhenEmpty("div.content-image");
		setColumnSizes();
		
		new StarRating();
		new RoutePlanner();
    },
		'load': function(){
			new EventCompanyMenu();
			findExternalLinks();
			AddClassLightboxBody();
		}
});

/**
 * Adds a class to the lightbox body for styling
 *
 * @author Phi Son Do <phison.do@efocus.nl>
 * @version 1.0, 2 nov, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function AddClassLightboxBody(){
	var elLightbox = $('lightbox');
	if (elLightbox){
		var elLightboxBody = elLightbox.getParent('html').addClass('lightbox');
	};			
}

/**
 * clears the searchstring, if value is zoeken
 *
 * @author Phi Son Do <phison.do@efocus.nl>
 * @version 1.0, 2 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function emptySearchString(){
	var elHeaderSearch = $('searchfield');
	if (elHeaderSearch){
		var elInputElement = elHeaderSearch.getElement('input');
		if(elInputElement.get("alt")){
			new OverText(elInputElement);
		}
	};			
}


/**
 * Check if element has no content (unless exception) or has a tag class="hidden", 
 * remove the tag from the DOM.
 * 
 * @param strClassNameEl - the class name of the element to check
 * @param strClassNameException - the class name of the element exeption
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 6 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function removeTagsWhenEmpty(strClassNameEl, strClassNameException){
	var elToCheck = $$(strClassNameEl);
 	if(!$defined(elToCheck[0])) return  false;
		
	if((elToCheck[0].getChildren().length < 1) || 
	(elToCheck[0].getChildren().length == 1 && elToCheck[0].getElement(strClassNameException)) ||
	elToCheck[0].getChildren().get("class") == "hidden"){
		elToCheck[0].getParent().setStyle("background","none");
		elToCheck[0].dispose();	
	}
}

/**
 * Gives the first teaser or cta class="teaserfirst" or "ctafirst"
 *
 * @author Phi Son Do <phison.do@efocus.nl>
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 6 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function initTeaserFirstClass(){
	var arrTeasers = $$('div.right').getElement('div.teaser');
	var arrCTAs = $$('div.right').getElement('div.cta');

	arrTeasers.each(function(item){
		if(item){
			  item.addClass('teaserfirst');
		}
	});
	arrCTAs.each(function(item){
		if(item){
			  item.addClass('ctafirst');
		}
	});
}


/**
 * Show tooltips
 *
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 6 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function getToolTips(){
	var arrFields = $$("div.field");
	if(arrFields.length > 0){
		arrFields.each(function(item){
			var strToolTipText = null;
			var elInput = item.getElements("input");
			var elTextArea = item.getElement("textarea");
			var elRadioButton = null;
			var elCheckBox = null;
			
			if(item.getElement("label")){
				strToolTipText = item.getElement("label").get("title");
			}
			
			if(item.getElement("div.checkbox")){
				elCheckBox = item.getElements("div.checkbox");
			}
			
			if(item.getElement("div.radio")){
				elRadioButton = item.getElement("div.radio");
			}
			
			if(elRadioButton != null){
				if (strToolTipText) {
					elRadioButton.addEvent('mouseover', function(el){
						setToolTipEvent(elRadioButton, strToolTipText);
					})
				}
			} else if (elTextArea != null) {
				if (strToolTipText) {
					elTextArea.addEvent('focus', function(el){
						setToolTipEvent(elTextArea, strToolTipText);
					})
				}
			} else if (elCheckBox != null) {
				if (strToolTipText) {
					elCheckBox.addEvent('mouseover', function(el){
						setToolTipEvent(elCheckBox, strToolTipText);
					})
				}	
			} else {
				if (strToolTipText) {
					elInput.addEvent('focus', function(el){
						setToolTipEvent(elInput, strToolTipText);
					})
				}
			}		
			
		});
	}	
}

/**
 * Fix to get the correct z-index for rooms overview tooltip
 *
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 12 nov, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function getToolTipFix(){
	var arrToolTipHeaders = $$("div.room-overview thead th");
	arrToolTipHeaders.each(function(el) {
	el.addEvent('mouseenter', function(event) {
		$$("div.header")[0].setStyle("z-index","99");
	});
	
	el.addEvent('mouseleave', function(event) {
		$$("div.header")[0].setStyle("z-index","999");
	});
	})
}	

/**
 * Create tooltips
 *
 * @param item - the form item to show tooltip on
 * @param strToolTip - the string with tooltip text to show
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 6 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function setToolTipEvent(item,strToolTip){
	var i = 0;
	
	var elToolTip = new Element("span");
	elToolTip.addClass("tooltip");
	elToolTip.set("html", strToolTip);
	item.getParent("div").adopt(elToolTip);
	i=+1;
	
	item.addEvent('blur', function(el){
		if(i!=0) {
			item.getParent("div.field").getElement("span.tooltip").dispose();
			i = 0;
		}
	})
	
	item.addEvent('mouseout', function(el){
		if(i!=0){
			item.getParent("div.field").getElement("span.tooltip").dispose();
			i=0;	
		}
	})		
}

/**
 * pushboxSlideShow
 * Animates the header slideshow on the homepage and defines the interaction.
 *
 * @author Ralph Meeuws <ralph.meeuws@efocus.nl>
 * @version 1.0, 2 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function pushboxSlideShow(){
	if (!$('pushbox')) return;
	
	var elMySs = $('pushbox');
	var arrMySlides = elMySs.getElement('.slides').getElements('li.slide');	
	var elMyNav = elMySs.getElement('.pushbox_nav');

	var objSlideShow = new EfxNavSlideShow({
		arrSlides: arrMySlides,
		elNav: elMyNav,
		intInterval: 5000
	});
	
}

/**
 * Resizes the page columns
 *
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 2 jul, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function setColumnSizes(){
	if($$("div.grid_9")[0] || $$("div.grid_12")[0]){

		var intRightColLength = $$("div.grid_4")[0].getStyle("height").toInt();
		var elRightCol = $$("div.grid_4")[0].getElement("div.right");
		
		if($$("div.grid_12")[0]){
			var intCenterLeftColLength = $$("div.grid_12")[0].getStyle("height").toInt();
			var elCenterLeftCol = $$("div.grid_12")[0].getElement("div.inner");
			if (intCenterLeftColLength < intRightColLength) {
				elCenterLeftCol.setStyle("height",intRightColLength-(elCenterLeftCol.getStyle('padding-top').toInt()+elCenterLeftCol.getStyle('margin-top').toInt()));
			};
		}
		
		if($$("div.grid_9")[0]){
			var intCenterColLength = $$("div.grid_9")[0].getStyle("height").toInt();
			var intCenterCol = $$("div.grid_9")[0].getElement("div.inner");
			if (intCenterColLength < intRightColLength) {
				intCenterCol.setStyle("height",intRightColLength-(intCenterCol.getStyle('padding-top').toInt()+intCenterCol.getStyle('margin-top').toInt()));
			}
		}		
	}
}

/**
 * Toggles default text in text inputfields
 *
 * @author Phi Son Do<phison.do@efocus.nl>
 * @version 1.0, 6 mei, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @requires MooTools 1.2.4 More, <http://www.mootools.net> 
 * @return void
 */
function setDefaultInputText() {
	var arrInputFields = $$('.defaultText');
	
	if(arrInputFields){
		arrInputFields.each(function(elInputField) {
			elInputField.defaultText = elInputField.value;
			
			elInputField.addEvents({
				'focus': function() {
					if (elInputField.value == elInputField.defaultText) {
						elInputField.value = '';
						elInputField.setStyle('color', "#666"); 
					}
				},
				'blur': function() {
					if (elInputField.value == '') {
						elInputField.value = elInputField.defaultText;
						elInputField.setStyle('color','#666');
					}
				}
			});
		});
	}
}

/**
 * Opens external links valid in a new window without the target attribute.
 * 
 * @author Mirjam Verloop, <mirjam.verloop@efocus.nl>
 * @version 1.0, 12 feb, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @requires <a href="http://www.efocus.nl/" class="external">eFocus</a>
 * @return void
 */
function initExternalLinks() {
	var arrExternalLinks = $$('a.external');
	if (arrExternalLinks.length > 0) {
		arrExternalLinks.each(function(elExternalLink) {
			elExternalLink.addEvent('click', function(event) {
				event.stop();
				window.open(this.get('href'));
			});
		});	
	}
}

/**
 * Find all external links, and add class External
 * 
 * @author Mirjam Verloop, <mirjam.verloop@efocus.nl>
 * @version 1.0, 12 feb, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @requires <a href="http://www.efocus.nl/" class="external">eFocus</a>
 * @return void
 */
function findExternalLinks() {
	
	var allExternalLinks = $$('a[href^="http://"]');
	var thisDomain = window.location.host;
	
	var arrInternalLinks = [ $$('a[href="http://www.voorlinden.nl"]'),
	                         $$('a[href="http://www.hoogevuursche.nl"]'),
	                         $$('a[href="http://www.tewerve.nl"]'),
	                         $$('a[href="http://www.lindenhof.nl"]'),	
	 
	                         $$('a[href="http://dehoogevuursche.shl3.dedicated.nines.nl"]'),	
	                         $$('a[href="http://delindenhof.shl3.dedicated.nines.nl"]'),	
	                         $$('a[href="http://tewerve.shl3.dedicated.nines.nl"]'),	
	                         $$('a[href="http://voorlinden.shl3.dedicated.nines.nl"]'),	      
	                         $$('a[href="http://hoogevuursche.eventcompany.staging2.efocus.nl"]'),
	                         $$('a[href="http://lindenhof.eventcompany.staging2.efocus.nl"]'),
	                         $$('a[href="http://tewerve.eventcompany.staging2.efocus.nl"]'),
	                         $$('a[href="http://voorlinden.eventcompany.staging2.efocus.nl"]'),
							 $$('a[href="http://richardvy.efocus02.efocus.local"]')]	

	allExternalLinks.each(function(thisLink) {		
		if (!thisLink.get('href').contains(thisDomain) && thisLink.hasClass("linkBlocker") == false) {
			thisLink.addClass('external');
		} 		
	});
	
	// TODO fix this; isn't working yet, we don't want links from eventcompany domains (e.g. www.voorlinden.nl) to open in a new window
	arrInternalLinks.each(function(thisLink2) {		
		if (!thisLink2 == false) {
			thisLink2.removeClass('external');
		} 		
	});
	
	initExternalLinks();	
}

/**
 * Set star rating buttons. If javascript is disabled, normal radio's will be shown.
 * 
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 2.0, 18 aug, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @requires:
 * 
 * @return void
 */
StarRating = new Class({
	Implements: [Options],
	options: {
		strElIdRating: "rating"
	},
	initialize: function(options) {
		this.setOptions(options);
		var strElIdRating = this.options.strElIdRating;
		
		if ($(strElIdRating)) {
			this.arrRadioButtons = $(strElIdRating).getElements("label.star");
			var elStar;
			
			this.arrRadioButtons.each(function(item, index){
				item.getElement("span").setStyle("display", "none");
				item.getElement("input").setStyle("display", "none");
				elStar = new Element("span");
				elStar.addClass("star");
				elStar.addClass(index + 1);
				item.adopt(elStar);
			});
			
			this.arrRadioButtons.each(function(item, index){
				if (item.getElement("input").get("checked")) {
					this.setActiveStarRating(item.getElement("span.star"), index+1);
				}
			}.bind(this));
			
			$$('span.star').addEvent('click', function(el){
				this.setActiveStarRating(el);
			}.bind(this));
		}	
	},
	setActiveStarRating: function(el, index){
		var intStarNum = index;
		this.arrRadioButtons.each(function(item,index){
			item.getElement("span.star").removeClass("star-on");		
		});
		if(intStarNum == null){
			intStarNum = el.target.get("class").split("star ")[1];
		}
	
		this.arrRadioButtons.each(function(item,index){
			if((index+1)<=intStarNum){
				item.getElement("span.star").addClass("star-on");		
			}
			if(index+1==intStarNum){
				item.getElement("input").set("checked","true");
			}
			
		});	
	}
});


/**
 * Loads a google map with a custom route for multiple locations.
 * 
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 2.0, 18 aug, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @requires Google Maps script: http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=...
 * @return void
 */
RoutePlanner = new Class({
	Implements: [Options],
	options: {
		blnOpenMapInSamePagePanel: "true",
		strElIdRoutePlanner: "routemap",
		strElIdRouteDirections: "routedirections",
		strElIdRouteForm: "routeinput",
		strElIdRouteButton: "routebutton",
		strLocale: "nl_NL", 
		strElClassName: "span.company_name",
		strElClassStreet: "span.company_street",
		strElClassPostal: "span.company_postal",
		strElClassCity: "span.company_city",
		strElClassRoutePanel: "div.routeplanner",
		strElClassPlanButton: "a.plan"
	},
	initialize: function(options) {
		this.setOptions(options);
		
		if($(this.options.strElIdRoutePlanner)){
			if (GBrowserIsCompatible()){
				this.url = window.location.href;
				this.objMap = new GMap2($(this.options.strElIdRoutePlanner));
				this.objGeocoder = new GClientGeocoder();
				this.objGdir = new GDirections(this.objMap, $(this.options.strElIdRouteDirections));
				this.strAddress = "";
				this.setMap(0);
				this.getEvents();		
			}	
		}
	},
	getName: function(i){
		return $$(this.options.strElClassName)[i].get('html');
	},
	getStreet: function(i){
		return $$(this.options.strElClassStreet)[i].get('html');
	},
	getPostal: function(i){
		var strPostal = $$(this.options.strElClassPostal)[i].get('html');
		return strPostal.slice(0,4);
	},
	getCity: function(i){
		return $$(this.options.strElClassCity)[i].get('html');		
	},
	getAddress: function(i){
		return this.getStreet(i) + ', ' + this.getPostal(i) + ' ' + this.getCity(i);	
	},
	getBalloonContent: function(i){
		return '<h4>' + this.getName(i) + '</h4>' + '<p>' + this.getStreet(i) + '<br />' + this.getCity(i) + '</p>';
	},
	getEvents: function(){
		var arrPlanRouteBtn = $$(this.options.strElClassPlanButton);
		var elRouteForm = $(this.options.strElIdRouteForm);
		var elRouteBtn = $(this.options.strElIdRouteButton);
				
		//multiple route links
		arrPlanRouteBtn.each(function(item,index){
			item.addEvent('click', function(){
				if(this.options.blnOpenMapInSamePagePanel == "true"){
					$$(this.options.strElClassRoutePanel)[0].setStyle("height","auto");	
					$$(this.options.strElClassRoutePanel)[0].setStyle('visibility', 'visible');
				}
				this.setMap(index);
				if(elRouteForm.value != ""){
					this.objGdir.load('from: ' + elRouteForm.value + ' to: ' + this.strAddress, { 'locale': this.options.strLocale });
				}
				window.location.href = this.url + "#anchor";
			}.bind(this));
		}.bind(this));
				
		//route planner form submit
		elRouteBtn.addEvent('click', function(){
			this.objGdir.load('from: ' + elRouteForm.value + ' to: ' + this.strAddress, { 'locale': this.options.strLocale });
			elRouteBtn.removeEvent('click');
		}.bind(this));
		elRouteForm.addEvent('keydown', function(e){
			if(e.key == 'enter') {
				this.objGdir.load('from: ' + elRouteForm.value + ' to: ' + this.strAddress, { 'locale': this.options.strLocale });	
			}
			elRouteBtn.removeEvent('keydown');
		}.bind(this));
				
	},
	setMap: function(i){
		this.strAddress = this.getAddress(i);
		var strBalloonContent = this.getBalloonContent(i);
		this.objGeocoder.getLatLng(
			this.strAddress,
			function(point) {
				if (!point) {
					alert(this.strAddress + " not found");
				} else {
					this.objMap.setCenter(point, 12);
											
					var objMarker = new GMarker(point);
					this.objMap.addOverlay(objMarker);

					this.objMap.setCenter();
					this.objMap.setUIToDefault();
					objMarker.openInfoWindowHtml(strBalloonContent);
					
					GEvent.addListener(objMarker, "click", function() {
						objMarker.openInfoWindowHtml(strBalloonContent);
					});		
				}
			}.bind(this)
		);	
	}
});

/**
 * Post on Change filter
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.00, 16 aug, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
function getPostFilter(strElClass){
	if($$(strElClass).length > 0){
		var elForm = $$(strElClass)[0];
		elForm.getElement("select").addEvent('change', function(e){
			elForm.submit();
		});
	}
}

/**
 * Event Company Menu Class.
 * Menu dropdown works without js.
 * This class makes sure, all the links are displayed in 2 columns.
 * Menu can have a specific block area
 * Menu has a shadow below the submenu background.
 * 
 * @author Lee Boonstra <lee.boonstra@efocus.nl>
 * @version 1.0, 20 aug, 2010
 * @requires MooTools 1.2.4 Core, <http://www.mootools.net>
 * @return void
 */
EventCompanyMenu = new Class({
	Implements: [Options],
	options: {
		strBlockSpecials : 'headerdiv-js-content',
		strBlockSpecialsDiv : 'div.other-locations',
		strMainMenu : 'ul.mainmenu',
		strSubMenu: 'div.submenu'
	},
	initialize: function(options) {
		this.setOptions(options);
		
		this.elMainMenu = $$(this.options.strMainMenu)[0];
		if(this.elMainMenu){
			this.arrSubMenu = this.elMainMenu.getElements(this.options.strSubMenu);	
		}
		
		this.setSubMenuCols();
	},
	setSubMenuCols: function(){
		/**
		* Disposes and inject ul in submenu in 2nd col
		* @author Phi Son Do <phison.do@efocus.nl>
		*/
		var elMainMenu = this.elMainMenu;
		if (elMainMenu) {
			var arrSubmenu = this.arrSubMenu;
			arrSubmenu.each(function(elSubmenu){
				var elFirstList = elSubmenu.getElement("ul");
				var arrSubmenuLists = elSubmenu.getElements('ul.submenulist li');
				var arrSubmenuListsCount = arrSubmenuLists.length;
				
				/*
				intSubMenuHeight = elSubmenu.getHeight();
				if(elSubmenu.getElement("div.other-locations h2")){
					elSubmenu.getElement("div.other-locations").setStyle("height", intSubMenuHeight);
					intSubMenuHeight = intSubMenuHeight+2;
				}
				*/
				
				var intTotalLeft = (arrSubmenuListsCount / 2).round(0);
				var arrSecondRow = [];
				
				for (var i = intTotalLeft; i < arrSubmenuListsCount; i++) {
					arrSecondRow.push(arrSubmenuLists[i]);
					arrSubmenuLists[i].dispose();
				}
				var elNewList = new Element('ul', {
					'class': 'submenulist2'
				});
				arrSecondRow.each(function(item){
					elNewList.adopt(item);
				});
				elNewList.inject(elFirstList, 'after');
			});
			this.setMenuSizes();
		}	
	},
	setMenuSizes: function(){

		var elMainMenu = this.elMainMenu;
		var arrSubMenu = this.arrSubMenu;
		var intSubMenuHeight = 0;
		var intMainMenuWidth = 0;
		
		if(arrSubMenu.length > 0){	
			arrSubMenu.each(function(elSubMenu){
				// Gijs O. => disabled block will be filled serverside
				//this.removeBlockSpecials();
			
				intSubMenuHeight = elSubMenu.getHeight();
				intMainMenuWidth = elMainMenu.getWidth();

				if(elSubMenu.getElement("div.other-locations").getStyle("left") != "-99999px"){
					elSubMenu.getElement("div.other-locations").setStyle("height", intSubMenuHeight);
					intSubMenuHeight = intSubMenuHeight+2;
				} else {
					var elHiddenBlock = new Element("div");
						
					intMainMenuWidth = (intMainMenuWidth - elSubMenu.getElement("div.other-locations").getWidth()) + 16
					elSubMenu.getElement("div.other-locations").dispose();
					elHiddenBlock.addClass("hiddenblock");
					elSubMenu.adopt(elHiddenBlock);
					elHiddenBlock.setStyles({
						'left':  intMainMenuWidth,
						'height': intSubMenuHeight,
						'width': elMainMenu.getWidth() - intMainMenuWidth
					})
					intSubMenuHeight = intSubMenuHeight-8;
				}
				
				// Gijs O. => disabled block will be filled serverside
				//this.fillBlockSpecials();
				var blnRemoveBlock = this.removeBlockSpecials(elSubMenu);
				elSubMenu.setStyle('width', intMainMenuWidth);	
				
				if (blnRemoveBlock) {
					this.setShadow(elSubMenu, intMainMenuWidth, intSubMenuHeight-10);
				} else {
					this.setShadow(elSubMenu, intMainMenuWidth, intSubMenuHeight);
				}

				
			}.bind(this));
		};
	},
	setShadow: function(elSubMenu,intMainMenuWidth,intSubMenuHeight){
		/**
		 * Set Shadow on submenu
		 * @author Phi Son Do <phison.do@efocus.nl>
		 * @author Lee Boonstra <lee.boonstra@efocus.nl>
		 */
		var elShadowDiv = elSubMenu.getParent().getElement('div.shadow');
		if(elShadowDiv){
			elShadowDiv.setStyles({
				'height': intSubMenuHeight,
				'width': intMainMenuWidth
			});	
		}	
	},
	fillBlockSpecials: function() {
		/**
		 * Load specific context-sensitive content in mainmenu sub.
		 * @author Gijs Oliemans <gijs.oliemans@efocus.nl>
		 * @author Lee Boonstra <lee.boonstra@efocus.nl>
		 */
		var elHeaderDiv = $(this.options.strBlockSpecials);
		var arrHeaderDivs = $$(this.options.strBlockSpecialsDiv);
		if (elHeaderDiv) {			
			var elHtml = elHeaderDiv.get("html");
			arrHeaderDivs.each(function(el){
				el.set("html", elHtml);
			});
		}		
	},
	removeBlockSpecials: function(elSubMenu){
		var elSpecialBlock = elSubMenu.getElement('div.other-locations');
		if(!elSpecialBlock.getElement('ul')){
			elSpecialBlock.setStyle('display', 'none');
			return true;
		}
		return false;
	}
})



/**
* removes image holder for image uploader en adds upload field
*
* @author Richard van Yperen <richardvy[at]efocus.nl
* @since 1.0, jan 2011
* @param string - id of form field
*/

function deleteImage(id) {
	$('uploaded_'+id).dispose();
	$(id).removeClass('hidden');
	$(id).disabled = false;
}
