
$(document).ready(function(){
	
	$("#selregion").bind("change",function(){
		var val = $(this).find("option:selected").text();
		if(val!="") {
			var sel = $("#selcity");
			sel.load("/data.asp?" + Math.random(), {'region' : val}, function() {
				$(this).attr("disabled","").trigger("focus");
			});
		}
	});
	
	$("#selcity").bind("change",function(){
		document.location = "/kontor/" + escape($(this).find("option:selected").attr("value"));
	});
	
	$("#frmcontact").validate();
	
	
	$("#contactform").before("<div style='background: url(/images/contactform-border-top.png); height: 6px;'></div>").after("<div style='background: url(/images/contactform-border-bottom.png); height: 30px;'></div>");
	$("#findoffice").after("<div style='background: url(/images/findoffice-border-bottom.png); height: 5px;'></div>");
	
	$("a[href^=http]").attr("target","_blank");
	
	$("input[type=submit]").each(function() {
		var obj = $(this);
		var val = obj.attr("value");
		obj.replaceWith("<a href='javascript:;' class='button'><span>" + val + "</span></a>");
	});
	
	$("#frmcontact .button").bind("click",function() {
		$("#frmcontact").trigger("submit");
	});
	
	if(jQuery.browser.msie & parseInt(jQuery.browser.version) <= 6) {
		$("#wrapper, #wrappertop, #wrapperbottom, #logotype img, #officepage .item img").ifixpng();
	}
	
});

