// Открывает popup окно чата
function chatStart(from,dep,name,email) {
	var url = 'http://chat.forex-mmcis.ru/';
	
	if(from) {
		url+= '?from=' + from;
	}
	if(dep) {
		url+= '&dep=' + dep;
	} else {
		url+= '&dep=support';
	}	
	if(name) {
		url+= '&name=' + name;
	}
	if(email) {
		url+= '&email=' + email;
	}
	
	popUpWindow(url,700,500);
}

// Открывает popUp окно
function popUpWindow(URLStr,v_width,v_height) {	
	if(typeof(screen.height)=="undefined"){
		v_left=0;
		v_top=0;
	}else{
		v_top=(screen.height-v_height)/2-50;		
		v_left=(screen.width-v_width)/2;
	}
	
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+v_width+',height='+v_height+',left='+v_left+', top='+v_top+',screenX='+v_left+',screenY='+v_top+'');
}