function NB_d(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false}return true}
function NB_n(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='number')return false}return true}
function NB_cW(){var w=0;if(Prototype.Browser.Opera)w=window.innerWidth;else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientWidth)w=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)w=document.body.clientWidth;else if(NB_d(window.innerWidth,window.innerHeight,document.height)){w=window.innerWidth;if(document.height>window.innerHeight)w-=16;}return w}
function NB_cH(){var h=0;if(Prototype.Browser.Opera)h=window.innerHeight;else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientHeight)h=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)h=document.body.clientHeight;else if(NB_d(window.innerWidth,window.innerHeight,document.width)){h=window.innerHeight;if(document.width>window.innerWidth)h-=16;}return h}
function NB_y(e){if(!(e=$(e)))return 0;var y=0;while(e){if(NB_d(e.offsetTop))y+=e.offsetTop;e=NB_d(e.offsetParent)?e.offsetParent:null}return y}
function NB_x(e){if(!(e=$(e)))return 0;var x=0;while(e){if(NB_d(e.offsetLeft))x+=e.offsetLeft;e=NB_d(e.offsetParent)?e.offsetParent:null}return x}
function NB_sl(e,b){var f=0;if(!NB_d(e)||b){var w=e||window;if(w.document.documentElement&&w.document.documentElement.scrollLeft)f=w.document.documentElement.scrollLeft;else if(w.document.body&&NB_d(w.document.body.scrollLeft))f=w.document.body.scrollLeft}else{e=$(e);if(e&&NB_n(e.scrollLeft))f=e.scrollLeft}return f}
function nws_position(){
	var nws=$('nws_subscribe'),cnt=$('b');
	if(parseInt(b.offsetLeft)>150){
		nws.style.left=parseInt(b.offsetLeft)-140;
		$('nws_bottom').removeClassName('pointLeft');
		nws_pngIEfix();
	}else{
		nws.style.left=b.offsetLeft+135;
		$('nws_bottom').addClassName('pointLeft');
		nws_pngIEfix();
	}
}
function nws_pngIEfix(){
	if(Prototype.Browser.IE&&!(window.XMLHttpRequest))$('nws_subscribe').addClassName('useIEfix');
}
function nws_subscribe(frm){
	$('nws_fld_rm').value='html';
	var v1=$('nws_fld_name'),v2=$('nws_fld_email');
	if(v1.value&&v2.value){
		$('nws_subscribe').style.display='none';
		new Ajax.Request('index.php',{parameters:{'action':'nwsSubscribe','name':v1.value,'email':v2.value,'requestMethod':'ajax'},onComplete:function(t){
			if(t.responseText=='true'){
				alert('Thank you for subscribing! Please check your e-mail to confirm your subscription');
			}else{
				alert('Something went wrong:\n'+t.responseText);
				$('nws_subscribe').style.display='block';
			}
			Form.enable(frm);
		},onFailure:function(){alert('Something went wrong...')}});
		return false;
	}else{
		alert('Please fill in the form');
	}
	return false;
}