function createRequestObject() {
  var http_request = false;

  if (window.XMLHttpRequest) { // Mozilla, Safari,...
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
      http_request.overrideMimeType('text/plain');
    } 
  } 
  else if (window.ActiveXObject) { // IE
    try {
      http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e) {
      try {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (e) {}
    }
  }
  if (!http_request) {
    alert('Hiba :( Nem hozható létre az XMLHTTP példánya');
    return false;
  }
  return http_request;
}

var http=createRequestObject();

function sndReq(action) {
  http.open('get','http://www.mellowmood.hu/getlang.php?lang='+action);
  http.onreadystatechange=handleResponse;
  http.send(null);
}

function handleResponse() {
  if(http.readyState==4){
    var response=http.responseText;
    labels=response.split('|');
    labelids=["FBCi","_jan","_feb","_mar","_apr","_may","_jun","_jul","_aug","_sept","_oct","_nov","_dec","FBNi","FBAd","FBAc","FBCu","FBCa","FBCc","FBMo","FBHh","FBTt"];
    for (i=0; i<labels.length-1; i++){
      txt=document.createTextNode(labels[i]);
      if (document.getElementById(labelids[i])) document.getElementById(labelids[i]).appendChild(txt);
    }
  }
}

function PopupPic(sPicURL,sPicTitle) {
  window.open("http://www.mellowmood.hu/popup.php?kep="+sPicURL+"&cim="+sPicTitle, "mellowin", "resizable=1,HEIGHT=450,WIDTH=600");
}

function new_win(){
  open('', 'mellowmood_win', 'resizable=0, menubar=0, toolbar=0, scrollbars=0, location=0, status=0, height=720, width=880');
}

function flasheader(){
  document.getElementById('flashanim').innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="815" height="123" id="corporate" align="middle">'+
  '<param name="allowScriptAccess" value="sameDomain" />'+
  '<param name="movie" value="./banners/header.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="./banners/header.swf" quality="high" bgcolor="#ffffff" width="815" height="123" name="special_offer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
  '</object>';
}










var il_cnt;
var il_lh;
var il_dh;
var il_t=0;
var il_go=true;

function movelangs(s){
  il_go=true;
  lmove(s);
}

function lmove(s){
  if (s=="right" && il_t>il_dh-il_lh) il_t--;
  else if (s=="left" && il_t<0) il_t++;
  if (il_go) setTimeout("lmove('"+s+"')",1);
  il_cnt.style.left=il_t+'px';
}

function stoplangs(){
  il_go=false;
}

function initlangs(){
  u=document.getElementById('lleft');
  u.onmouseover=function () {movelangs('left');}
  u.onmouseout=function () {stoplangs();}
  d=document.getElementById('lright');
  d.onmouseover=function () {movelangs('right');}
  d.onmouseout=function () {stoplangs();}
  il_dh=document.getElementById('langdiv').offsetWidth;
  il_cnt=document.getElementById('langs');
  lis=il_cnt.getElementsByTagName('li');
  il_lh=0;
  for (i=0; i<lis.length; i++){
    il_lh+=lis[i].offsetWidth;
  }
  document.getElementById('langs').style.width=il_lh+'px';
}

function mmail(obj){
  obj.href=obj.href.replace(/nospam./g,'');
  return true;
}
