function disableButton(o,message) {
	if(!message)message='sending';
	o.disabled = true;
	o.value = message;
}
$(function () {
	$('a#faq').click(function (e) {
		e.preventDefault();
		var $this = $(this);
		var horizontalPadding = 30;
		var verticalPadding = 30;
		$('<iframe id="externalSite" class="externalSite" src="' + this.href + '" />').dialog({
			title: ($this.attr('title')) ? $this.attr('title') : '[[progress]]',
			autoOpen: true,
			width: 1000,
			height: 500,
			modal: true,
			resizable: true,
			autoResize: true,
			overlay: {
				opacity: 0.5,
				background: "black"
			}
		}).width(1000 - horizontalPadding).height(500 - verticalPadding);
	});
});
window.onresize = window.onload = function(){
	$('.flextext').each(
		function(){
			$(this).css("width", $(window).width() - 100);
		}
		
	);
}
$(function(){
	$('.blockEnterkey').keypress(function(e){if(e.keyCode == 13)return false;});
});

//XMLHttpRequest.js
var HTTP = {};
HTTP._factories = [
	function(){return new XMLHttpRequest();},
	function(){return new ActiveXObject("Msxml2.XMLHTTP");},
	function(){return new ActiveXObject("Microsoft.XMLHTTP");}
];

HTTP.newRequest = function(){
	if(HTTP._factory != null) return HTTP._factory();
	for(var i=0; i < HTTP._factories.length; i++){
		try{
			var factory = HTTP._factories[i];
			var request = factory();
			if(request != null){
				HTTP._factory = factory;
				return request;
			}
		}catch(e){
			continue;
		}
	}
	HTTP._factory = new function(){
		throw new Error("XMLHttpRequest not supported");
	}
	HTTP._factory();
}
