var so = new SWFObject("Gete.swf", "sotester", "100%", "100%", "8", "#ffffff");
so.addParam("scale","noscale");
so.addParam("salign","lt");
so.addParam("menu","false");
so.addParam("wmode","transparent");
so.write("flashcontent");

$(document).ready(function() {
    $("a[rel]").overlay({
        mask: 'darkred',
        effect: 'apple',
        onBeforeLoad: function() {
            var wrap = this.getOverlay().find(".contentWrap");
            wrap.load(this.getTrigger().attr("href"));
        }
    });
    $(":input[placeholder], textarea[placeholder]").placeholder({blankSubmit:true}); 
    
});
function alerta(q){
alert(q);	
}
function redirect(id){
	switch(window.location.hash){
		case "":if(id=='ca'){window.location.href="index_ca.php#presentacio";}else{window.location.href="index_en.php#introduction";}break;
		case "#presentacion":if(id=='ca'){window.location.href="index_ca.php#presentacio";}else{window.location.href="index_en.php#introduction";}break;
		case "#inicio":if(id=='ca'){window.location.href="inici.php#inici";}else{window.location.href="start.php#start";}break;
		case "#quienes-somos":if(id=='ca'){window.location.href="qui-som.php#qui-som";}else{window.location.href="about-us.php#about-us";}document.getElementById('b0').className="actual";break;
		case "#servicios":if(id=='ca'){window.location.href="serveis.php#serveis";}else{window.location.href="services.php#services";}document.getElementById('b1').className="actual";break;
		case "#clientes":if(id=='ca'){window.location.href="customers.php#customers";}else{window.location.href="customers.php#customers";}document.getElementById('b2').className="actual";break;
		case "#campanas":if(id=='ca'){window.location.href="campanyes.php#campanyes";}else{window.location.href="campaigns.php#campaigns";}document.getElementById('b3').className="actual";break;
		case "#contacto":if(id=='ca'){window.location.href="contacte.php#contacte";}else{window.location.href="contact-us.php#contact-us";}document.getElementById('b4').className="actual";break;
		
		case "#presentacio":if(id=='es'){window.location.href="index.php#presentacion";}else{window.location.href="index_en.php#introduction";}break;
		case "#inici":if(id=='es'){window.location.href="inicio.php#inicio";}else{window.location.href="start.php#start";}break;
		case "#qui-som":if(id=='es'){window.location.href="quienes-somos.php#quienes-somos";}else{window.location.href="about-us.php#about-us";}document.getElementById('b0').className="actual";break;
		case "#serveis":if(id=='es'){window.location.href="servicios.php#servicios";}else{window.location.href="services.php#services";}document.getElementById('b1').className="actual";break;
		case "#clients":if(id=='es'){window.location.href="clientes.php#cliente";}else{window.location.href="customers.php#customers";}document.getElementById('b2').className="actual";break;
		case "#campanyes":if(id=='es'){window.location.href="campanas.php#campanas";}else{window.location.href="campaigns.php#campaigns";}document.getElementById('b3').className="actual";break;
		case "#contacte":if(id=='es'){window.location.href="contacto.php#contacto";}else{window.location.href="contact-us.php#contact-us";}document.getElementById('b4').className="actual";break;

		case "#introduction":if(id=='es'){window.location.href="index.php#presentacion";}else{window.location.href="index_ca.php#presentacio";}break;
		case "#start":if(id=='es'){window.location.href="inicio.php#inicio";}else{window.location.href="inici.php#inici";}break;
		case "#about-us":if(id=='es'){window.location.href="quienes-somos.php#quienes-somos";}else{window.location.href="qui-som.php#qui-som";}document.getElementById('b0').className="actual";break;
		case "#services":if(id=='es'){window.location.href="servicios.php#servicios";}else{window.location.href="serveis.php#serveis";}document.getElementById('b1').className="actual";break;
		case "#customers":if(id=='es'){window.location.href="clientes.php#cliente";}else{window.location.href="clients.php#clients";}document.getElementById('b2').className="actual";break;
		case "#campaigns":if(id=='es'){window.location.href="campanas.php#campanas";}else{window.location.href="campanyes.php#campanyes";}document.getElementById('b3').className="actual";break;
		case "#contact-us":if(id=='es'){window.location.href="contacto.php#contacto";}else{window.location.href="contacte.php#contacte";}document.getElementById('b4').className="actual";break;
	}
}
switch(window.location.hash){
	case "#presentacion":window.location.href="index.php#presentacion";break;
	case "#inicio":window.location.href="inicio.php#inicio";break;
	case "#quienes-somos":window.location.href="quienes-somos.php#quienes-somos";document.getElementById('b0').className="actual";break;
	case "#servicios":window.location.href="servicios.php#servicios";document.getElementById('b1').className="actual";break;
	case "#clientes":window.location.href="clientes.php#clientes";document.getElementById('b2').className="actual";break;
	case "#campanas":window.location.href="campanas.php#campanas";document.getElementById('b3').className="actual";break;
	case "#contacto":window.location.href="contacto.php#contacto";document.getElementById('b4').className="actual";break;
	case "#presentacio":window.location.href="index_ca.php#presentacio";break;
	case "#inici":window.location.href="inici.php#inici";break;
	case "#qui-som":window.location.href="qui-som.php#qui-som";document.getElementById('b0').className="actual";break;
	case "#serveis":window.location.href="serveis.php#serveis";document.getElementById('b1').className="actual";break;
	case "#clients":window.location.href="clients.php#clients";document.getElementById('b2').className="actual";break;
	case "#campanyes":window.location.href="campanyes.php#campanyes";document.getElementById('b3').className="actual";break;
	case "#contacte":window.location.href="contacte.php#contacte";document.getElementById('b4').className="actual";break;
	case "#introduction":window.location.href="index_en.php#introduction";break;
	case "#start":window.location.href="start.php#start";break;
	case "#about-us":window.location.href="about-us.php#about-us";document.getElementById('b0').className="actual";break;
	case "#services":window.location.href="serveis.php#services";document.getElementById('b1').className="actual";break;
	case "#customers":window.location.href="customers.php#clients";document.getElementById('b2').className="actual";break;
	case "#campaigns":window.location.href="campaigns.php#campaigns";document.getElementById('b3').className="actual";break;
	case "#contact-us":window.location.href="contact-us.php#contact-us";document.getElementById('b4').className="actual";break;

}
var myWindow;
function abrir_ventana(url,ancho,alto) {
    var width = ancho;
    var height = alto;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,scrollbars=yes,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}



