var hostt=server;function cargarpag4(pag,div){jQuery.ajax({async:true,url:pag,type:"GET",cache:false,dataType:"html",beforeSend:function(objeto){jQuery("#"+div).html("<div style='width:100%; text-align:center; padding:120px 0px 120px 0px'><img src='"+hostt+"imagenes/publicas/load.gif' /></div>");},success:function(rpta){jQuery("#"+div).html(rpta);}});}
function cargarpag5(pag,div){jQuery.ajax({async:true,url:pag,type:"GET",cache:false,dataType:"html",beforeSend:function(objeto){jQuery("#"+div).html("<div style='width:100%; text-align:center; padding:0px 0px 0px 0px'><img src='"+hostt+"imagenes/publicas/load.gif' /></div>");},success:function(rpta){jQuery("#"+div).html(rpta);}});}
function cargarpag3(pag,div){jQuery.ajax({async:true,url:pag,type:"GET",cache:false,dataType:"html",beforeSend:function(objeto){jQuery("#"+div).html("<div style='width:100%; text-align:center; padding:120px 0px 120px 0px'><img src='"+hostt+"imagenes/publicas/carga.gif' /></div>");},success:function(rpta){jQuery("#"+div).html(rpta);}});}
function cargarpag2(pag,div){jQuery.ajax({async:true,url:pag,type:"GET",cache:false,dataType:"html",beforeSend:function(objeto){jQuery("#"+div).html("<span style='font-size:16px;'><p>Cargando...</p></span>");},success:function(rpta){jQuery("#"+div).html(rpta);}});}
function cargarpag(pag,div){jQuery.ajax({async:true,url:pag,type:"GET",cache:false,dataType:"html",success:function(rpta){jQuery("#"+div).html(rpta);}});}
function findPosX(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetLeft
obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;}
function findPosY(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curtop+=obj.offsetTop
obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;}
function flashes(){var obj_swf=new FlashObject("banner_home2.swf","HOME","564","119","8");obj_swf.addParam("quality","high");obj_swf.addParam("menu","false");obj_swf.addParam("scale","noborder");obj_swf.addParam("wmode","transparent");obj_swf.write("flash");}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function iniciar()
{flashes();MM_preloadImages(hostt+'img/cartelera1.gif',hostt+'img/clientes2.gif',hostt+'img/home2.gif',hostt+'img/recomiendenos2.gif',hostt+'img/contacto2.gif',hostt+'img/operaciones2.gif',hostt+'img/servicios2.gif',hostt+'img/cartelera2.gif',hostt+'img/market2.gif',hostt+'/img/mundo2.gif',hostt+'img/consu2.gif',hostt+'img/sercorp2.gif',hostt+'img/comer2.gif',hostt+'img/serfin2.gif',hostt+'img/geren1.gif',hostt+'img/empresa2.gif',hostt+'img/geren2.gif',hostt+'img/op_edicom2.jpg',hostt+'img/op_proyex2.jpg',hostt+'img/op_inver2.jpg',hostt+'img/op_ofi2.jpg',hostt+'img/op_indus2.jpg',hostt+'img/op_retail2.jpg',hostt+'img/op_consul2.jpg',hostt+'img/op_resid2.jpg')}
function ir_oficina()
{var localizacion=jQuery("#oficina").attr("value");if(localizacion)
{location.href="http://www.colliers.com/"+localizacion;}}
function login(){var lenguaaa="";lenguaaa=$.trim(jQuery('#lenguaaa').attr("value"));var txt_email=jQuery("#txt_email").attr("value");var txt_pass=jQuery("#txt_pass").attr("value");var check_datos=jQuery('#check_datos').attr('checked');if(check_datos==true){var estado="si";}else{var estado="no";}
var titu="";var err="";var nohas="";if(lenguaaa=="esp"){titu="Te logueaste correctamente";err="Te olvidaste tu contrase&ntilde;a";var nohas="No has escrito tu email y password";}
else if(lenguaaa=="ing"){titu="logueaste you correctly";err="Forgot your password";var nohas="have not written your email and password";}
else if(lenguaaa=="bra"){titu="voc&#234; logueaste corretamente";err="Esqueceu sua senha";var nohas="não tenham escrito o seu e-mail e senha";}
else if(lenguaaa=="fra"){titu="vous logueaste correctement";err="Vous avez oublié votre mot de passe";var nohas="n'avez pas écrit votre e-mail et mot de passe";}
else if(lenguaaa=="hol"){titu="correct logueaste u";err="Uw wachtwoord vergeten";var nohas="heb u niet geschreven je emailadres en wachtwoord";}
else if(lenguaaa=="ale"){titu="logueaste Sie richtig";err="Ich Passwort vergessen";var nohas="haben nicht Ihre E-Mail und Passwort geschrieben";}
else if(lenguaaa=="rus"){titu="&#1042;&#1067; &#1055;&#1056;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1086; &#1046;&#1059;&#1088;&#1085;&#1072;&#1083;&#1072;";err="&#1042;&#1099; &#1079;&#1072;&#1073;&#1099;&#1083;&#1080; &#1087;&#1072;	&#1088;&#1086;&#1083;&#1100;";var nohas="&#1042;&#1099; &#1085;&#1077; &#1085;&#1072;&#1087;&#1080;&#1089;&#1072;&#1083;&#1080; &#1089;&#1074;&#1086;&#1081; &#1072;&#1076;&#1088;&#1077;&#1089; &#1101;&#1083;&#1077;&#1082;&#1090;&#1088;&#1086;&#1085;&#1085;&#1086;&#1081; &#1087;&#1086;&#1095;&#1090;&#1099; &#1080; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;";}
if(txt_email!=""&&txt_pass!=""){$.post(hostt+'proc_tbl_usuario.php',{op:'login',txt_email:txt_email,txt_pass:txt_pass,estado:estado,lenguaaa:lenguaaa},function(datos){if(datos=="Logeado"){jAlert(titu,'Mensaje');window.location.href=hostt+'cuentausuario.php?idioma='+lenguaaa;}
else if(datos=="sinfoto"){jAlert(titu,'Mensaje');window.location.href=hostt+'cuenta_foto.php?idioma='+lenguaaa;}
else if(datos=="sinalbum"){jAlert(titu,'Mensaje');window.location.href=hostt+'cuenta_imagen.php?idioma='+lenguaaa;}
else if(datos=="Error"){jAlert(err,'Mensaje');}
else if(datos=="cerrar"){window.location.href=hostt+'cuentausuario.php?idioma='+lenguaaa;}});}else{jAlert(nohas,'Mensaje');}}
function cerrar_download(){var lenguaaa="";lenguaaa=$.trim(jQuery('#lenguaaa').attr("value"));jQuery.ajax({type:"POST",url:hostt+"proc_tbl_usuario.php",data:"op=cerrar",success:function(datos){if(datos=="cerrar"){window.location.reload();}else{jAlert('No se pudo cerrar sesion cierra esta ventana','Mensaje');}}});}
function cerrar()
{var lenguaaa="";lenguaaa=$.trim(jQuery('#lenguaaa').attr("value"));jQuery.ajax({type:"POST",url:hostt+"proc_tbl_usuario.php",data:"op=cerrar",success:function(datos){if(datos=="cerrar")
{window.location.href=hostt+'index.php?idioma='+lenguaaa;}else{jAlert('No se pudo cerrar sesion cierra esta ventana','Mensaje');}}});}
function olvidarclave()
{var email=jQuery('#email').attr('value');jQuery.ajax({type:"POST",url:hostt+"proc_tbl_usuario.php",data:"op=clave&email="+email,success:function(datos){if(datos=="clave")
{jAlert('Tu clave se envio a tu email','Mensaje');setTimeout('recargar_pagina()',1500);}
if(datos=="sinclave"){jAlert('Usted no esta registrado','Mensaje');}}});}
function olvidastes(){$('#frm_login').hide();$('#frm_olvidar_login').show();}
function cancelar(){jQuery('#frm_olvidar_login').hide();jQuery('#frm_login').show();}
function login_empresa()
{var txt_email=jQuery("#txt_email").attr("value");var txt_pass=jQuery("#txt_pass").attr("value");if(txt_email&&txt_pass)
{jQuery.ajax({type:"POST",url:hostt+"proc_tbl_empresa.php",data:"op=login&txt_email="+txt_email+"&txt_pass="+txt_pass,success:function(datos){if(datos=="Logeado")
{jAlert('Te logueaste correctamente','Mensaje');setTimeout('recargar_pagina()',1500);}
if(datos=="Error")
{jAlert('Te olvidaste tu contrase&ntilde;a','Mensaje');}}});}
else
{jAlert('No has escrito tu email y password','Mensaje');}}
function recargar_pagina()
{window.location.reload();}
function borrar_escribir_email()
{jQuery("#txt_email").attr("value","");}
function escribir_email(){if(jQuery("#txt_email").attr("value")==""){var copi=jQuery("#copiaemail").attr("value");jQuery("#txt_email").attr("value",copi);}}
var borrar_pass=true;function borrar_escribir_pass()
{if(borrar_pass)
{borrar_pass=false;jQuery("#txt_pass_finta").hide();jQuery("#txt_pass").show();setTimeout('ayuda_borrar_escribir_pass()',300);}else{borrar_pass=true;jQuery("#txt_pass_finta").show();jQuery("#txt_pass").hide();}}
function ayuda_borrar_escribir_pass()
{jQuery("#txt_pass").focus();}
function abrir_select_celeste()
{ubicar('div_capa_emergente_select_celeste','div_simular_select_celeste',0,-20);var expandido=jQuery("#div_capa_emergente_select_celeste").hasClass("expandido");var expandido=jQuery("#div_capa_emergente_select_celeste").hasClass("expandido");var expandido=jQuery("#div_capa_emergente_select_celeste").hasClass("expandido");var expandido=jQuery("#div_capa_emergente_select_celeste").hasClass("expandido");var expandido=jQuery("#div_capa_emergente_select_celeste").hasClass("expandido");if(expandido)
{jQuery("#div_capa_emergente_select_celeste").removeClass("expandido");jQuery("#div_capa_emergente_select_celeste").hide();}
else
{jQuery("#div_capa_emergente_select_celeste").addClass("expandido");jQuery("#div_capa_emergente_select_celeste").show();}}
function ubicar(divmover,divrelativo,numx,numy)
{var div=document.getElementById(divmover);div.style.display='block';var obj=document.getElementById(divrelativo);var posx=findPosX(obj);var posy=findPosY(obj);posy=posy-numy-1;posx=posx+numx;div.style.top=posy+"px";div.style.left=posx+"px";jQuery('#'+divmover).show();}
function seleccionar_combo_celeste(texto)
{if(texto)
{jQuery("#div_reload_select_celeste_seleccionado").html(texto);jQuery("#div_capa_emergente_select_celeste").removeClass("expandido");jQuery("#div_capa_emergente_select_celeste").hide();}}
function cambiar_categoria(idarticulo)
{if(idarticulo)
{var nueva_categoria=jQuery("#nueva_categoria"+idarticulo).attr("value");jConfirm('Desea Cambiar la categoria de este articulo?','Confirmaci&oacute;n',function(rpta){if(rpta)
{jQuery.ajax({type:"POST",url:hostt+"pages/proc_tbl_articulos_blog.php",data:"op=cambiar_categoria&idarticulo="+idarticulo+"&nueva_categoria="+nueva_categoria,success:function(datos){window.location.reload();}});}});}}
function enviar_contacto(){var nom=jQuery('#nombrec').val();var ema=jQuery('#emailc').val();var tel=jQuery('#telefonoc').val();var cel=jQuery('#celularc').val();var conocerc=jQuery('#conocerc').attr('value');var valpais=jQuery('#paisc').attr('checked');if(valpais==true)var pais='peru';else var pais=jQuery('#nompaisc').val();var com=jQuery('#comentariosc').val();if(nom!=''&&ema!=''&&tel!=''&&com!=''&&conocerc!='-1'){$('#c1').hide();jQuery('#c2').show();jQuery('#c3').hide();$.ajax({type:"POST",url:hostt+"abc/pages/proc_ajax_contacto.php",data:"op=contactar&nom="+nom+"&ema="+ema+"&tel="+tel+"&cel="+cel+"&pais="+pais+"&com="+com+"&conocerc="+conocerc,success:function(datos){jQuery('#c1').hide();jQuery('#c2').hide();jQuery('#c3').show();setTimeout("jQuery('#c1').show();jQuery('#c2').hide();jQuery('#c3').hide();",3000);jQuery('#nombrec').attr('value','');jQuery('#emailc').attr('value','');jQuery('#telefonoc').attr('value','');jQuery('#celularc').attr('value','');jQuery('#comentariosc').attr('value','');}});}else{alert('Datos incompletos');}}
function enviar_recomendar(){var nombrer=jQuery('#nombrer').val();var emailr=jQuery('#emailr').val();var amigo1r=jQuery('#amigo1r').val();var email1r=jQuery('#email1r').val();var amigo2r=jQuery('#amigo2r').val();var email2r=jQuery('#email2r').val();var mensajer=jQuery('#mensajer').val();if(nombrer!=''&&emailr!=''&&amigo1r!=''&&email1r!=''){jQuery('#c1').hide();jQuery('#c2').show();jQuery('#c3').hide();jQuery.ajax({type:"POST",url:hostt+"pages/proc_ajax_recomendar.php",data:"op=recomendar&nombrer="+nombrer+"&emailr="+emailr+"&amigo1r="+amigo1r+"&email1r="+email1r+"&amigo2r="+amigo2r+"&email2r="+email2r+"&mensajer="+mensajer,success:function(datos){jQuery('#c1').hide();jQuery('#c2').hide();jQuery('#c3').show();setTimeout("jQuery('#c1').show();jQuery('#c2').hide();jQuery('#c3').hide();",3000);jQuery('#nombrer').attr('value','');jQuery('#emailr').attr('value','');jQuery('#amigo1r').attr('value','');jQuery('#email1r').attr('value','');jQuery('#amigo2r').attr('value','');jQuery('#email2r').attr('value','');jQuery('#mensajer').attr('value','');}});}else{alert('Datos incompletos');}}
function quehaces(){var txt_quehaces=jQuery('#txt_quehaces').val();if(txt_quehaces!=''){$('#link_haciendo').hide();$('#save_cargar').show().html('Enviando datos...');$.post(hostt+'proc_user_msg.php',{op:'hacer',txt_quehaces:txt_quehaces},function(data){$('#quehaciendo').html(txt_quehaces);$('#txt_quehaces').val('');$('#hacecuanto').html('Hace un momento');$('#save_cargar').hide();$('#link_haciendo').show();$('.span_add_com:last').after(data);$(".row_msg_red:first").fadeIn();});}else{jAlert("No Ingreso ningun comentario");}}
function quehaces2(id_amigo){var txt_quehaces=jQuery('#txt_quehaces').val();if(txt_quehaces!=''){$('#link_haciendo').hide();$('#save_cargar').show().html('Enviando datos...');$.post(hostt+'proc_user_msg.php',{op:'hacer2',txt_quehaces:txt_quehaces,id_amigo:id_amigo},function(data){$('#txt_quehaces').val('');$('#save_cargar').hide();$('#link_haciendo').show();$('.span_add_com:last').after(data);$(".row_msg_red:first").fadeIn();});}
else{jAlert("No Ingreso ningun comentario");}}
function agregar_comentario(id_tblupdate){var comentario=jQuery('#txt_comentario').val();if($.trim(comentario)!=''){$.post(hostt+'pages/proc_ajax_comentario.php',{op:'agregar_comentario',id_tblupdate:id_tblupdate,comentario:comentario},function(data){window.location.reload();});}else{jAlert('No lleno el mensaje.');}}
function comentar_serv_tecnico(){var title=$('#txt_title').val();var com=$('#txt_com').val();var tipo=$('#txt_tipo').val();if($.trim(title)!=''&&$.trim(com)!=''){$('#btns').html('Enviando informaci&oacute;n');$.post(hostt+'proc_ajax_comentario.php',{op:'add_com_tec',title:title,com:com,tipo:tipo},function(data){$('#btns').html('Su consulta ha sido enviada');setTimeout("window.location.reload()",1000);});}else{jAlert('Datos incompletos');}}
function responder_serv_tecnico(){var idconsulta=$('#txt_idconsulta').val();var resp=$('#txt_resp').val();if($.trim(resp)!=''){$('#btns').html('Enviando informaci&oacute;n');$.post(hostt+'pages/proc_ajax_comentario.php',{op:'resp_com_tec',resp:resp,idconsulta:idconsulta},function(data){$('#btns').html('Respuesta Enviada');setTimeout("window.location.reload()",1000);});}else{jAlert('Datos incompletos');}}
function add_resp_com(idrow,id_user){var message=$('#data_msg'+idrow).find('textarea').val();$('#data_msg'+idrow).find('textarea').val('');if($.trim(message)!=''){$('#data_msg'+idrow).find('.link_ok').replaceWith("<span class='link_change'>Enviando...</span>");$('#data_msg'+idrow).find('.link_cancel').hide();$.post('proc_user_msg.php',{op:'resp_com',message:message,idrow:idrow,id_user:id_user},function(data){$('#data_msg'+idrow).before(data);$('#data_msg'+idrow).hide();$('#data_msg'+idrow).find('.link_change').replaceWith("<span onclick='add_resp_com("+idrow+","+id_user+")' class='link_ok'>Aceptar</span>");$('#addcom'+idrow).show();$('#data_msg'+idrow).find('.link_cancel').show();});}else{jAlert('Llene el mensaje.');}}
function listar_videos_yt(){var criterio=$('#txt_criterio').val();$('#btn_listar_yt').attr('disabled',true).val('Buscando...');$.post('rpacoc_youtube/index.php',{op:'agregar_comentario',query:criterio},function(data){$('#btn_listar_yt').attr('disabled',false).val('Buscar');$('#listado_media_yt').html(data);});}
function media_view_yt(codigo){var cad="<object width='218' height='180'><param name='movie' value='http://www.youtube.com/v/"+codigo+"&hl=es_ES&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/"+codigo+"&hl=es_ES&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='218' height='180'></embed></object>";$('#reprod_youtube').html(cad);$('#listado_media_yt').hide();$('#frm_media_yt').show();$('#txt_codigo_yt').val(codigo);$('#btn_listar_yt').hide();}
function create_video_yt(){var codigo=$('#txt_codigo_yt').val();var titleyt=$('#txt_'+codigo+'_title').val();var descyt=$('#txt_'+codigo+'_desc').val();var titulo=$('#txt_titulo_yt').val();var autor=$('#txt_autor_yt').val();if($.trim(titulo)!=''){$('#btn_create_yt').attr('disabled',true).val('Guardando...');$.post(hostt+'pages/proc_ajax_perfil_edit.php',{op:'guardar_musica',titulo:titulo,autor:autor,valor:codigo,title:titleyt,desc:descyt},function(data){$('#btn_create_yt').val('Guardado');window.location.reload();});}else{jAlert('Datos incompletos');$('#txt_titulo_yt').focus().select();}}
