/* wins */
var oneWin = new bt_Window();
function openWindow(on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '</div><a href="javascript:void(0);" id="x_winclose" onclick="xajax_firstVisitor();'+ on_click +'" title="Close" class="fps_winclose"></a><div id="loader" class="fps_winloading"></div><div id="x_wincontent" class="fps_wincontent"></div>'
	});
}
function returnWindow(title, str, type, on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	var content = '';
	if(type==0){
		content += '<div class="error">';
	}else if(type==1){
		content += '<div class="success">';
	}else{
		content += '<div class="notice">';
	}
	content += str + '</div>';
	content += '<div style="text-align:center;"><input id="x_okbutton" onclick="'+ on_click +'" class="button" type="button" value="OK" /></div></div>';

	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_returntitle" class="fps_windrag">' + title + '</div><div id="x_returnclose" onclick="'+ on_click +'" title="Close" class="fps_winclose"></div>'+
		'<div id="returnloader" class="fps_winloading"></div><div id="x_returncontent" class="fps_wincontent">' + content + '</div>'
	});

	if (document.getElementById('x_okbutton')) {
		document.getElementById('x_okbutton').focus();
		document.getElementById('x_okbutton').onkeydown = function(e) {
			if(window.event) { // IE
  				keynum = window.event.keyCode;
  			} else {
  				keynum = e.keyCode;
  			}
  			if (keynum == 13 || keynum ==27) this.onclick();
		}
	}
}

function resizeWindow(w, h, n) {
	if (typeof n == 'undefined') n = 1;
	var bt = document.getElementById('bt_win_'+n);
	var t = bt.firstChild;
	var c = bt.lastChild;

	c.style.padding = '0px';
	bt.style.width = w+'px';
	t.style.width = (w-70)+'px';
	c.style.width = w+'px';

	bt.style.height = (h+19)+'px';
	c.style.height = h+'px';
}


function closeWindow(){
	oneWin.close();
}


function xWintitleSizer(){
    document.getElementById("x_wintitle").style.width = 750+'px';
}

