var url="http://bzm.sytes.net:81/";
var img='<img src="'+url+'ayuda/loading_02.gif" border="0">';
var s="";
var src="";
var src01="";
var file="";
var file1="";
var t;
var y;
var c=0;
var xmlhttp;
var pie="";
var refresca=1;
var time01=2*1000;
var time02=60*1000;
s=location.href;
document.write('<div id="bzmweb" align="center">'+img+'</div>');    
//document.write('<div id="bzmads" align="center">'+img+'</div>');
src+="<center>";
//src+="<!-- webim button -->";

if (s.toLowerCase().indexOf("proimport")!=-1){
    url="";
    src+="PROIMPORT CIA. LTDA.";
    file1=url+"/proimport_im/";
    file=file1+"client.php?locale=sp";
    //pie='<a href="'+file1+'" target="bzm_im">Operadores</a><br />';
    refresca=1;
    //document.write(meebochat('pYSFzyglHj',350));
}else if(s.toLowerCase().indexOf("ccordova")!=-1){
    src+="ccordova";
    file1=url+"webim/";
    file=file1+"client.php?locale=sp";
    pie='';
}else if(s.toLowerCase().indexOf("petcosolutions")!=-1){
    src+="PetcoSolutions";
    file1=url+"webim/";
    file=file1+"client.php?locale=sp";
    pie="";
}else if(s.toLowerCase().indexOf("vivaldi")!=-1){
    src+="RadioVivaldi";
    //file1=url+"webim/";
    //file=file1+"client.php?locale=sp";
    pie="Bienvenidos";
    //document.write(meebochat('erDPHYfVuC',350));
}else if(s.toLowerCase().indexOf("cogecomsa")!=-1){
    src+="<b>COGECOMSA S.A.</b>";
    //document.write(meebochat('JEHRzdPzuZ',"250"));
    src+="<br><B>INFORMATIVO:</B>";
    src+="<br>POSCYE: UTILIZAR PRIMERA OPCION PARA 2010 Y INFORMACION ACTUAL";
    src+="<br>POSCYE: SEGUNDA OPCION PARA CONTABILIDAD 2011 (DAVID DURAN) (BAJO CONSTRUCCION)";
    src+="<hr>";
    src+="<br>BZM SERVICIOS INFORMATICOS:<br>CEL: 09-780-3833<BR>EMAIL: bzuniga01@gmail.com";
}else if(s.toLowerCase().indexOf("local")!=-1){
    var alt=250;
    document.write(meebochat('JEHRzdPzuZ',alt)); //cogecomsa
    document.write(meebochat('sXzpkaEYVc',alt)); //bzm1
    document.write(meebochat('erDPHYfVuC',alt)); //radiovialdi
    document.write(meebochat('pYSFzyglHj',alt)); //proimport
}else if(s.toLowerCase().indexOf("bzm")!=-1){
    time01=1*1000;
    url="http://bzm1.com";
    src+="Bienvenido<br />";
    file1=url+"/help_im/";
    file=file1+"client.php?locale=sp";
    pie='';
    //pie+='<a href="http://www.linksmanagement.com">Contextual Links</a><br>';
    pie+='<a href="'+file1+'" target="bzm_im" >Operadores</a><br />';
    pie+=skype("bzuniga01")+'<br />';
    pie+=skype("zdlaptops")+'<br />';
    //document.write('<div id="bzmmeebo" align="center">'+img+'</div>');
    //t=setTimeout('escmeebo("sXzpkaEYVc",300)',time01);
    //document.write(meebochat('sXzpkaEYVc',300));
    //document.write('<div style="width:210px"><style>.mcrmeebo { display: block; background:url("http://widget.meebo.com/r.gif") no-repeat top right; } .mcrmeebo:hover { background:url("http://widget.meebo.com/ro.gif") no-repeat top right; } </style><object width="210" height="350"><param name="movie" value="http://widget.meebo.com/mcr.swf?id=IXygwJQtPg"></param><embed src="http://widget.meebo.com/mcr.swf?id=IXygwJQtPg" type="application/x-shockwave-flash" width="210" height="350" /></object><a target="_blank" href="http://www.meebo.com/rooms/" class="mcrmeebo"><img alt="Create a Meebo Chat Room" src="http://widget.meebo.com/b.gif" width="210" height="45" style="border:0px"/></a></div>');
}else{
    src+="("+s+")";
    document.write(meebochat('sXzpkaEYVc',350));
}
if (file != ""){
    src+='<a href="'+file+'" '; 
    src+='target="_blank" '; 
    src+='onclick="';
    src+="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('"+file+"&amp;url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;";
    src+='">';
    src+='<img src="'+file1+'button.php?i=webim&amp;lang=sp" border="0" width="90%" height="75" alt="" />';
    src+='</a>';
}
    src+='<font size=1><br />';
    src+=pie;
//    src+='<br /><a href="http://bzm1.com" target="_blank">BZM Servicios Informáticos</a>';
    src+='</font>';
    //src+='<a href="http://www.histats.com/viewstats/?act=2&sid=1253846" target=_blank>Estadisticas</a>';
    //document.getElementById("bzmweb").innerHTML=src;
    //document.getElementById("bzmads").innerHTML=src01;
    //document.write(src);
    src+='</center>';

function meebochat(id,alto){
    var meebo="";
    //id=sXzpkaEYVc
    //meebo='<div style="width:100%"><style>.mcrmeebo { display: block; background:url("http://widget.meebo.com/r.gif") no-repeat top right; } .mcrmeebo:hover { background:url("http://widget.meebo.com/ro.gif") no-repeat top right; } </style><object width="100%" height="'+alto+'"><param name="movie" value="http://widget.meebo.com/mcr.swf?id='+id+'"></param><embed src="http://widget.meebo.com/mcr.swf?id='+id+'" type="application/x-shockwave-flash" width="100%" height="'+alto+'" /></object></div>';
    meebo='<div style="width:100%"><object width="100%" height="'+alto+'"><param name="movie" value="http://widget.meebo.com/mcr.swf?id='+id+'"></param><embed src="http://widget.meebo.com/mcr.swf?id='+id+'" type="application/x-shockwave-flash" width="100%" height="'+alto+'" /></object></div>';
return meebo;
}

function escmeebo(id,alto){
    document.getElementById("bzmmeebo").innerHTML=meebochat(id,alto);
}

function skype(id){
//var skype='<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
//skype+='<a href="skype:'+id+'?call"><img src="http://mystatus.skype.com/balloon/'+id+'" style="border: none;" width="50%" height="60px" valign="middle" alt="Llamame: '+id+'" />Skype: '+id+'</a>';
var skype='<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
skype+='<a href="skype:'+id+'?call"><img src="http://mystatus.skype.com/bigclassic/'+id+'" style="border: none;" width="90%" height="44" alt="Llamame" /><br /></a>';
return skype;    
}

function bzm01(html){
    c+=1;
    //html+=c;
    //alert(html);
    //alert(html);
    document.getElementById("bzmweb").innerHTML=html;
//    document.getElementById("bzmads").innerHTML=src01;
    if (refresca==1){
        t=setTimeout("bzm01(src)",time02);
    }
}
//t=setTimeout("bzm01()",1*1000);

function timedCount(){
    //location.reload(true);
    //y="Contador ("+c+")";
    //document.getElementById('bzm05').innerHTML=y;
    c=c+1;
    document.getElementById("bzmweb").innerHTML=img;
    getVote();
    t=setTimeout('timedCount()',60*1000);
}
function getVote(){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){
    //alert ("Browser does not support HTTP Request");
    return;
  }
var url1=file;
//url=url+"?id="+int;
//url=url+"&estacion="+estacion;
//url=url+"&link="+link;
//url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url1,true);
xmlhttp.send(null);
}

function stateChanged(){
  if (xmlhttp.readyState==4){
  bzm01(xmlhttp.responseText);
  //document.getElementById("bzmweb").innerHTML=xmlhttp.responseText;
  //document.getElementById("bzmweb").normalize();
  //alert(xmlhttp.responseText);
  }
}

function GetXmlHttpObject(){
var objXMLHttp=null;
if (window.XMLHttpRequest){
  objXMLHttp=new XMLHttpRequest();
  } else if (window.ActiveXObject){
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
return objXMLHttp;
}
//t=setTimeout('timedCount("bzmweb")',5*1000);
//t=setTimeout('timedCount('+file+')',2*1000);
//timedCount();
//bzm01(src);
t=setTimeout('bzm01(src)',time01);

