var promocion_seleccionada = -1;

$(function() {		
	$("div.scrollable").scrollable({
	   size: 7,
       clickable:false
  });	
	
});
function ventanaModal(id,width,height,id_producto,id_conf,cerrarAfuera){
	var id_item='';
	//var a=cerrarAfuera!='no'?'levanta_lytebox2':'levanta_lytebox1';
	document.getElementById('levanta_floatbox').href='contenido/pre_modal.php?tipomodal='+id+'&id_producto='+id_producto+''+'&id_conf='+id_conf+'';
	
	if(arguments.length > 6){
		id_item = arguments[6];
		document.getElementById('levanta_floatbox').href+='&id_item='+id_item;
	}
	
	document.getElementById('levanta_floatbox').rev='width: '+width+' height: '+height+'';
	
	fb.loadAnchor(document.getElementById('levanta_floatbox'), 'width:'+width+' height:'+height+'', '');

}
function loadContent( sourceUrl) {
$("#contenido").load(sourceUrl);
}
function loadContentIn(div, sourceUrl) {
$("#"+div).load(sourceUrl);
}
function inicioAplicacion(localidad,id_familia,id_producto,buscar,solicitar){
      $(document).ready(function() {
          loadContent('contenido/pre_oferta.php?id_familia='+id_familia+'&id_producto='+id_producto+'&buscar='+buscar+'&solicitar='+solicitar);
      });
      
}
function cerrarVentanaModal(){
	
	fb.end();
	
}
function getLocalidad(localidad, comuna){

}
function recalculaPrecio(numero){
   self.myframe.document.form_iframe.numero.value=numero;
}
flechaInv = new Image();
flechaInv.src = 'imagenes/flecha_inv.gif';
function toggleImage(number) {
if (document.getElementById(number).src.match('imagenes/flecha.gif')) {
document.getElementById(number).setAttribute('src', 'imagenes/flecha_inv.gif');
}
else {
document.getElementById(number).setAttribute('src', 'imagenes/flecha.gif');
}
}

function trim(stringValue)
{
	return stringValue.replace(/^\s+|\s+$/g,'');
}

function valida_busqueda(form)
{
	form.buscar.value = trim(form.buscar.value);
	str_busqueda = form.buscar.value;
	
	if(str_busqueda.length <= 3)
	{
		alert("Ingrese un término de búsqueda de más de 3 letras");
		return false;
	}
	
	return true;
}
