function SetMailformInputBackgrounds()
{
	SetInputBackgrounds("form#mailform ");
	
	$("form#mailform textarea").parent().css("margin-bottom", "8px");
}

function SetInputBackgrounds($path)
{
	if(!(($.browser.msie) &&  ($.browser.version <= 6)))
	{	
		
		$($path + " input[type=text]").each(function(){
				$width = this.offsetWidth;
				//$height = $(this).css("height");
				//$height = $height.match('([0-9]+)')[0];
				$height = this.offsetHeight;
				

				//alert($height + " / " + this.offsetHeight)
				if(!($(this).parent().hasClass("zoekveld"))){
					$(this)
					.css({"border":"none",
						"width":this.offsetWidth,
						"background-color":"transparent",
						"height":this.offsetHeight});
					if(!($(this).parent().hasClass("servicemenu_searchbutton") || $(this).parent().hasClass("inputbackground")))
						$(this).wrap("<div class=\"inputbackground\" _width=\""+$width+"\" _height=\""+$height+"\"></div>");
					$(this).parent()
						.css("background-image", "url(/InputBackground/Default.aspx/"+$width+"x"+$height+"/input)")
						.css({"background-repeat":"no-repeat",
							"background-position":"0px 0px",
							"height":$height,
							"width":$width,
							"display":"block"});
				}
		});
		
		$($path + " input[type=file]").each(function(){
				$width = this.offsetWidth + 4;
				//$height = $(this).css("height");
				//$height = $height.match('([0-9]+)')[0];
				$height = this.offsetHeight + 5;
				

				//alert($height + " / " + this.offsetHeight)
				if(!($(this).parent().hasClass("zoekveld"))){
					$(this)
					.css({"border":"none",
						"width":this.offsetWidth,
						"background-color":"transparent",
						"margin-top":"1px",
						"margin-left":"1px",
						"float":"left",
						"border-color":"#DFDFD9",
						"height":this.offsetHeight});
					if(!($(this).parent().hasClass("servicemenu_searchbutton") || $(this).parent().hasClass("inputbackground")))
						$(this).wrap("<div class=\"inputbackground\" _width=\""+$width+"\" _height=\""+$height+"\"></div>");
					$(this).parent()
						.css("background-image", "url(/InputBackground/Default.aspx/"+$width+"x"+$height+"/input)")
						.css({"background-repeat":"no-repeat",
							"background-position":"0px 0px",
							"height":$height,
							"width":$width,
							"display":"block",
							"float":"left",
							"padding-top":"1px"});
				}
		});		
		
		$($path + " textarea").each(function(){
			$width = this.offsetWidth;
			$height = this.offsetHeight;
			$(this)
			.css({"border":"none",
				"width":this.offsetWidth,
				"float":"none",
				"background-color":"transparent",
				"background-repeat":"no-repeat",
				"height":($height-2)});
			if(!($(this).parent().hasClass("servicemenu_searchbutton") || $(this).parent().hasClass("inputbackground")))
				$(this).wrap("<div class=\"inputbackground\" _width=\""+$width+"\" _height=\""+$height+"\"></div>");
			$(this).parent().css("background-image", "url(/InputBackground/Default.aspx/"+$width+"x"+($height+2)+"/input)")
			.css({"background-repeat":"no-repeat",
				"background-position":"0px 0px",
				"height":($height+2),
				"float":"left",
				"width":$width,
				"display":$(this).css("block")});

		});

		$("form.formtool input[type=text], form#mailform input[type=text]").each(function(){
			$(this).parent()
				.css({
					"float":"left"
				})
		});
	}
}

$(document).ready(function()
{
	SetInputBackgrounds("");
})