$(document).ready(function() { 
	$('#username').click(function(){
		if($(this).val()=='(Ej:13987456-0)'){
			$(this).val('');
		}
	});
	
	$('#username').focusout(function(){
		if($(this).val()==''){
			$(this).val('(Ej:13987456-0)');
		}
	});

	
});
//Boleta sucursal virtual
function sucursal_boleta(linkHref){ $.fn.colorbox({href: linkHref ,width:'650px', height:'450px',scrolling: false, iframe:true});}

//Portal TV
function dest_recordar(linkHref){ $.fn.colorbox({href: linkHref ,width:'340px', height:'180px',scrolling: false, iframe:true});}
function dest_trailer(linkHref){ $.fn.colorbox({href: linkHref ,width:'640px', height:'420px',scrolling: false, iframe:true});}

//Cotizador
function cotizador(){ $.fn.colorbox({href: '/cotizador/',width:'965px', height:'460px',scrolling: false, iframe:true});}
function error_cotizador(id){ $.fn.colorbox({href: '/imagenes/img-disculpe-molestias-2.jpg',width:'720px', height:'420px',scrolling: false, iframe:true});}

//Contratar
function contratar(id){ $.fn.colorbox({href: '/contratar/'+id+'/',width:'715px', height:'400px',scrolling: false, iframe:true});}

//Concurso
function concurso(id){ $.fn.colorbox({href: '/concurso/'+id+'/',width:'750px', height:'570px',scrolling: false, iframe:true});}

//Recuperar contraseña, solicitar contraseña, cambio de clave
function Recuperar(){$.fn.colorbox({href:'/recuperar-clave/',width:'620px', height:'340px',scrolling: false, iframe:true});}
function solicitar_pass(){$.fn.colorbox({href:'/imagenes/img-lightbox-sin-clave.jpg',width:'620px', height:'340px',scrolling: false, iframe:true});}
function cambioClave(){$.fn.colorbox({href:'/sucursal-virtual/cambio-clave/',width:'620px', height:'340px',scrolling: false, iframe:true});}

//Contacto, contacto ejecutivo, consultas ventas
function contacto(){$.fn.colorbox({href:'/contacto/',width:'740px', height:'520px',scrolling: false, iframe:true});}
function contacto_ejecutivo(){$.fn.colorbox({href:'/contacto_ejecutivo',width:'400px', height:'300px',scrolling: false, iframe:true});}
function conoce_ejecutivo(){$.fn.colorbox({href:'/contacto_ejecutivo_personas/',width:'350px', height:'225px',scrolling: false, iframe:true});}
function consulta_ventas(){$.fn.colorbox({href:'/sucursal-virtual/consultas-y-ventas.php',width:'770px', height:'520px',scrolling: false, iframe:true});}

//Paginas
function control_parental(){$.fn.colorbox({href:'/portal-television/tutorial-control-parental.php',width:'720px', height:'500px',scrolling: false, iframe:true});}
function control_remoto(){$.fn.colorbox({href:'/portal-television/control_remoto.php',width:'720px', height:'500px',scrolling: false, iframe:true});}
function kit_seguridad(){$.fn.colorbox({href:'/portal-television/control_remoto.php',width:'740px', height:'500px',scrolling: false, iframe:true});}
function kit_mcafee_pro_3(){$.fn.colorbox({href:'http://extranet.manquehue.cl/McAfee/InfoCliente.do?cod_producto=705-25444-mpcsp&producto=PC%20Security%20Plus%20SUITE&usuarioSiebel=',width:'740px', height:'500px',scrolling: true, iframe:true});}
function mi_familia_protegida(){$.fn.colorbox({href:'/packs_mi_familia_protegina.php',width:'285px', height:'250px',scrolling: false, iframe:true});}

//Noticias
function noticia(){ $.fn.colorbox({href: '/noticia-entel-gtd.php',width:'600px', height:'520px',scrolling: false, iframe:true});}


//Soporte
function soporte(id){ $.fn.colorbox({href: '/hogar/soporte/detalle/'+id+'/',width:'750px', height:'500px',scrolling: false, iframe:true});}



function oferta_cliente(){
	/*blank.location.href='';*/
	window.open('http://www.falabella.com/webapp/commerce/command/ExecMacro/falabella/macros/ProdDisp.d2w/report?cid=b4137&product_rn=5724742&cgmenbr=1891&cgpadre=2637630&cgnieto=2632212&division=0&prdisplay=0&StrOrigen=0&StrMos=1&nivel=1&cghijo1=2632195','_blank');
}
function ventanaInfoplanes(url,ancho,alto)
{
	$.fn.colorbox(
		{href:url,width:ancho, height:alto,scrolling: false, iframe:true}
	);
}

function $s(id){
return document.getElementById(id);
}
function STO(_24,_25){
return window.setTimeout(_24,_25);
}
function sty(id,clase){
	$s(id).className = clase;
}
function DecToHexa(_26){
	var _27=parseInt(_26).toString(16);
	if(_26<16){
		_27="0"+_27;
	}
	return _27;
}
function addslashes(str){
	str=str.replace(/\"/g,"\\\"");
	str=str.replace(/\'/g,"\\'");
	return str;
}
function $toggle(id){
	if(act_height(id)==0){
		$blinddown(id);
	}else{
		$blindup(id);
	}
}
function act_height(id){
	height=$s(id).clientHeight;
	if(height==0){
		height=$s(id).offsetHeight;
	}
	return height;
}
function act_width(id){
	width=$s(id).clientWidth;
	if(width==0){
		width=$s(id).offsetWidth;
	}
	return width;
}
function max_height(id){
	var ids=$s(id).style;
	ids.overflow="hidden";
	if(act_height(id)!=0){
		return act_height(id);
	}else{
		origdisp=ids.display;
		origheight=ids.height;
		origpos=ids.position;
		origvis=ids.visibility;
		ids.visibility="hidden";
		ids.height="";
		ids.display="block";
		ids.position="absolute";
		height=act_height(id);
		ids.display=origdisp;
		ids.height=origheight;
		ids.position=origpos;
		ids.visibility=origvis;
		return height;
	}
}

function $blindup(id,_2f){
	if(!_2f){
		_2f=200;
	}
	acth=act_height(id);
	maxh=max_height(id);
	if(acth==maxh){
		$s(id).style.display="block";
		var _30;
		_30=Math.ceil(_2f/acth);
		for(i=0;i<=acth;i++){
			newh=acth-i;
			STO("$s('"+id+"').style.height='"+newh+"px'",_30*i);
		}
		STO("$s('"+id+"').style.display='none'",_30*(i+1));
	}
}
function $blinddown(id,_32){
	if(!_32){
		_32=200;
	}
	acth=act_height(id);
	if(acth==0){
		maxh=max_height(id);
		$s(id).style.display="block";
		$s(id).style.height="0px";
		var _33;
		_33=Math.ceil(_32/maxh);
		for(i=1;i<=maxh;i++){
			STO("$s('"+id+"').style.height='"+i+"px'",_33*i);
		}
	}
}
function ind_view(id,img){
	var el = $s("tstats");
	var as = el.getElementsByTagName("a");
	for (var i=0; i<as.length; i++) {
		as[i].className = 'indtop';
	}
	$s('indt1').style.display='none';
	$s('indt2').style.display='none';
	$s('indt3').style.display='none';
	$("#"+ id +"").fadeIn("slow");
	img.className = 'indbot';
}

function printSWF(file,w,h){
	var strHome = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="homeflash" width="'+w+'" height="'+h+'" align="">\n';
	strHome += '<param name="movie" value="'+file+'">\n'; 
	strHome += '<param name="swliveconnect" value="true">\n';
	strHome += '<param name="quality" value="high">\n';
	strHome += '<param name="bgcolor" value="#FFFFFF">\n'; 
	//strHome += '<param name="wmode" value="transparent">\n';
	strHome += '<param name="menu" value="false">\n';
	strHome += '<param value="opaque" name="wmode">\n';
	strHome += '<embed src="'+file+'" quality="high" bgcolor="#FFFFFF" menu="false" wmode="opaque" width="'+w+'" height="'+h+'" name="homeflash" swliveconnect="true" align=""  TYPE="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">\n';
	strHome += '</embed>\n';
	strHome += '</object>\n';
	document.write(strHome);
}

function ValorRadio(ctrl){
	if(ctrl.length == undefined){
		return ctrl.value;
	}else{
		for(i=0;i<ctrl.length;i++){
			if(ctrl[i].checked) return ctrl[i].value;
		}
	}
}

function validaEncuesta(id){
	voto = ValorRadio(document.formEncuesta.voto);
	if (voto==undefined){
			alert("Por favor selecciona una alternativa");
	}else{
		expande('boxPoll');
		$s('encload').style.display='block';
		GetHtml('encuesta','/script-encuesta.php?voto='+voto+'&idec='+id);
		STO("$s('encload').style.display='none';",2500);
	}
}
function expande(id){
	for (x=1;x<180;x++){
		STO("$s('"+id+"').style.width='"+(170+x)+"px';$s('box-encuesta').style.width='"+(176+x)+"px'",x);
	}
}
function reducir(id){
	for (x=1;x<180;x++){
		STO("$s('"+id+"').style.width='"+(349-x)+"px';$s('box-encuesta').style.width='"+(355-x)+"px'",x);
	}
	$s('encResultados').style.display='none';
	$s('encEncuesta').style.display='block';
}
function printDiv(id){
	var bName = navigator.appName;
	var bVer = parseFloat(navigator.appVersion);
	var contenido = document.getElementById(id).innerHTML;
	ventana=window.open("/print.php","ventana","width=560,height=500");
	ventana.document.open();
	ventana.document.write('<html><head><title>Gtd Manquehue<\/title><link rel="stylesheet" href="/includes/css/estilos.css" type="text/css" /><link href="/sucursal-virtual/sucursal-virtual.css" rel="stylesheet" type="text/css" /><style>body{background: none !important;}<\/style><\/head><body>');
	ventana.document.write(contenido);
	ventana.document.close();
	ventana.print();
	ventana.focus();
}
function wopen(url,largo,ancho,barras){
	window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars="+barras+",menubar=0,width="+largo+",height="+ancho+",top="+((screen.availHeight-ancho)/2) +",left="+((screen.availWidth-largo)/2));
}
