function basename (path, suffix) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ash Searle (http://hexmen.com/blog/)
    // +   improved by: Lincoln Ramsay
    // +   improved by: djmix
    // *     example 1: basename('/www/site/home.htm', '.htm');
    // *     returns 1: 'home'
    // *     example 2: basename('ecra.php?p=1');
    // *     returns 2: 'ecra.php?p=1'

    var b = path.replace(/^.*[\/\\]/g, '');
    
    if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) {
        b = b.substr(0, b.length-suffix.length);
    }
    
    return b;
}
$(document).ready(function(){
    /*COLORBOX*/
	$('a[rel="individual"]').colorbox({rel:'nofollow'});
	$("a[rel='lightbox']").colorbox({width:700});
	$(".html_lightbox").colorbox({iframe:true, innerWidth:760, innerHeight:500});
	
	/*MENU*/	
	$('#menu a').each(function () {
		if (basename(window.location.href) == basename($(this).attr('href')))
			$(this).addClass('activo');
		else
			$(this).removeClass('activo');
	});
	
});

function mostrar_coche(src)

{

if (src.value==0) {document.forms.presupuesto.Coche.src='../static/coches/no_coche.gif';}

if (src.value=='Grupo-B') {document.forms.presupuesto.Coche.src='../static/coches/grupo_b.jpg';}

if (src.value=='Grupo-C') {document.forms.presupuesto.Coche.src='../static/coches/grupo_c.jpg';}

if (src.value=='Grupo-D') {document.forms.presupuesto.Coche.src='../static/coches/grupo_d.jpg';}

if (src.value=='Grupo-E') {document.forms.presupuesto.Coche.src='../static/coches/grupo_e.jpg';}

if (src.value=='Grupo-F') {document.forms.presupuesto.Coche.src='../static/coches/grupo_f.jpg';}

if (src.value=='Grupo-G') {document.forms.presupuesto.Coche.src='../static/coches/grupo_g.jpg';}

if (src.value=='Grupo-H') {document.forms.presupuesto.Coche.src='../static/coches/grupo_h.jpg';}

}

function cambiamail (buzon) {
var res = "";
for (var n = 0; n < buzon.length; n++)
res += String.fromCharCode(buzon.charCodeAt(n));
if (res.indexOf('@') < 0)
res = res + '@' + 'infotelecom.es';
location = "mail" + "to:" + res;
}

