function loadswf(file, id, width, height, bgcolor, flashvars)
{
	var so = new SWFObject(file, id, width, height, 9, bgcolor);
	so.addParam("wmode", "transparent"); 
	so.addParam("flashVars", flashvars);
	so.write(id);
}


$(document).ready(function () {
	if ($("div.seguridad div#seguridad_swf")[0] != null) loadswf("swf/seguridad/menu.swf", "seguridad_swf", 261, 525, "#FFF", "");
	if ($("div.despacho div#calcula_despacho")[0] != null) loadswf("swf/despacho/calcula_despacho.swf", "calcula_despacho", 261, 150, "#FFF", "");
	/* if ($("div.despacho div#camion_swf")[0] != null) loadswf("swf/despacho/camion2.swf", "camion_swf", 261, 200, "#FFF", ""); */
	/* if ($("div.despacho div#camion2_swf")[0] != null) loadswf("swf/despacho/nuevosDespachos.swf", "camion2_swf", 261, 200, "#FFF", ""); */
	if ($("div.seguridad")[0] != null) {
		$("body").attr("class", "seguridad");
		$("div.zabaleta").css("display", "block");
	}
	
	$("dd:not(:first)").hide();
	$("dt a").click(function(){
		$("dd:visible").slideUp("fast");
		$(this).parent().next().slideDown("fast");
		return false;
	});
});


function asistenteTelefonico() {
	var ruta = 'http://www.lapolar.cl/internet/catalogo/tellamamos';
	popup_Ctg(ruta, 375, 445);
}
function popup_Ctg(URL, height, width) {
	xwidth = width;
	xheight = height;
	xleft =(getViewportWidth() - xwidth) / 2;
	xtop = (getViewportHeight() - xheight) / 2;
	
	props = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='
		 + xwidth+',height='+xheight+',top='+xtop+',left='+xleft;
	if(URL.slice(0,4) != 'http')
		nURL = '/img'+URL;
	else
		nURL = URL;
	popup = window.open(nURL, 'popup', props);
	return true;
}