function verVideo(nombre) {
	Ventana=open("","","top=10,left=100,toolbar=no,directories=no,menubar=no,width=300,height=200");
	Ventana.document.write("<head><title>Videos</title><link rel=stylesheet href='/ccsantboi/css/web.css'></head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><table border=0 cellspacing=0 cellpadding=0><tr><td><embed autostart=\"true\" lang=\"es\" loop=\"false\" src='" + nombre + "'></embed></td></tr><tr><td align=right bgcolor='#006699'><a href='#' onclick='window.close();'><img src='/ccsantboi/img/botones/cerrar.gif' alt='' border=0></a></td></tr></table></body>");
}

function BSB_masFotos() {
	window.open("/ccsantboi/cas/carreras/berga-santboi/fotos/otros_anyos.html","","width=200,height=50,top=100,left=100,resizable=no,scrollbars=no");
}


function Fecha() {
<!-- Comienza
var d = new Date();
var k = d.getTime();
<!--  Activate Cloaking Device
var now = new Date();
var yr = now.getYear();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;
var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
yr %= 100;
yr += 2000;

if(dName==1) Day = "Domingo";
if(dName==2) Day = "Lunes";
if(dName==3) Day = "Martes";
if(dName==4) Day = "Mi&eacute;rcoles";
if(dName==5) Day = "Jueves";
if(dName==6) Day = "Viernes";
if(dName==7) Day = "S&aacute;bado";
if(mName==1) Month="enero";
if(mName==2) Month="febrero";
if(mName==3) Month="marzo";
if(mName==4) Month="abril";
if(mName==5) Month="mayo";
if(mName==6) Month="junio";
if(mName==7) Month="julio";
if(mName==8) Month="agosto";
if(mName==9) Month="septiembre";
if(mName==10) Month="octubre";
if(mName==11) Month="noviembre";
if(mName==12) Month="diciembre";

var todaysDate =(Day + ", " + dayNr + " de " + Month + " de " + yr);     

document.open();
document.write(todaysDate);
//-->
}


//-----------------------------------
//  CODIGO POSTAL Y PROVINCIA
//-----------------------------------
	function xponerProvincia(cod_postal) {
		//cod_postal = document.form.cp.value;
		try {
			var dosdigitos = cod_postal.substring(0,2);
			var provincia = document.form.provincia;
			
			if (cod_postal > 52999 || cod_postal < 01000 || cod_postal.length < 5) {
				alert("El Codigo Postal introducido es incorrecto");
				return false;
				document.form.cp.focus();
			} else {
				if (dosdigitos == "01") {
					provincia.value = "Álava"
				}
				if (dosdigitos == "02") {
					provincia.value = "Albacete"
				}
				if (dosdigitos == "03") {
					provincia.value = "Alicante"
				}
				if (dosdigitos == "04") {
					provincia.value = "Almería"
				}
				if (dosdigitos == "05") {
					provincia.value = "Ávila"
				}
				if (dosdigitos == "06") {
					provincia.value = "Badajoz"
				}
				if (dosdigitos == "07") {
					provincia.value = "Baleares"
				}
				if (dosdigitos == "08") {
					provincia.value = "Barcelona"
				}
				if (dosdigitos == "09") {
					provincia.value = "Burgos"
				}
				if (dosdigitos == "10") {
					provincia.value = "Cáceres"
				}
				if (dosdigitos == "11") {
					provincia.value = "Cádiz"
				}
				if (dosdigitos == "12") {
					provincia.value = "Castellón"
				}
				if (dosdigitos == "13") {
					provincia.value = "Ciudad Real"
				}
				if (dosdigitos == "14") {
					provincia.value = "Córdoba"
				}
				if (dosdigitos == "15") {
					provincia.value = "La Coruña"
				}
				if (dosdigitos == "16") {
					provincia.value = "Cuenca"
				}
				if (dosdigitos == "17") {
					provincia.value = "Girona"
				}
				if (dosdigitos == "18") {
					provincia.value = "Granada"
				}
				if (dosdigitos == "19") {
					provincia.value = "Guadalajara"
				}
				if (dosdigitos == "20") {
					provincia.value = "Guipuzcoa"
				}
				if (dosdigitos == "21") {
					provincia.value = "Huelva"
				}
				if (dosdigitos == "22") {
					provincia.value = "Huesca"
				}
				if (dosdigitos == "23") {
					provincia.value = "Jaén"
				}
				if (dosdigitos == "24") {
					provincia.value = "León"
				}
				if (dosdigitos == "25") {
					provincia.value = "Lleida"
				}
				if (dosdigitos == "26") {
					provincia.value = "La Rioja"
				}
				if (dosdigitos == "27") {
					provincia.value = "Lugo"
				}
				if (dosdigitos == "28") {
					provincia.value = "Madrid"
				}
				if (dosdigitos == "29") {
					provincia.value = "Málaga"
				}
				if (dosdigitos == "30") {
					provincia.value = "Murcia"
				}
				if (dosdigitos == "31") {
					provincia.value = "Navarra"
				}
				if (dosdigitos == "32") {
					provincia.value = "Orense"
				}
				if (dosdigitos == "33") {
					provincia.value = "Asturias"
				}
				if (dosdigitos == "34") {
					provincia.value = "Palencia"
				}
				if (dosdigitos == "35") {
					provincia.value = "Las Palmas"
				}
				if (dosdigitos == "36") {
					provincia.value = "Pontevedra"
				}
				if (dosdigitos == "37") {
					provincia.value = "Salamanca"
				}
				if (dosdigitos == "38") {
					provincia.value = "Tenerife"
				}
				if (dosdigitos == "39") {
					provincia.value = "Cantabria"
				}
				if (dosdigitos == "40") {
					provincia.value = "Segovia"
				}
				if (dosdigitos == "41") {
					provincia.value = "Sevilla"
				}
				if (dosdigitos == "42") {
					provincia.value = "Soria"
				}
				if (dosdigitos == "43") {
					provincia.value = "Tarragona"
				}
				if (dosdigitos == "44") {
					provincia.value = "Teruel"
				}
				if (dosdigitos == "45") {
					provincia.value = "Toledo"
				}
				if (dosdigitos == "46") {
					provincia.value = "Valencia"
				}
				if (dosdigitos == "47") {
					provincia.value = "Valladolid"
				}
				if (dosdigitos == "48") {
					provincia.value = "Vizcaya"
				}
				if (dosdigitos == "49") {
					provincia.value = "Zamora"
				}
				if (dosdigitos == "50") {
					provincia.value = "Zaragoza"
				}
				if (dosdigitos == "51") {
					provincia.value = "Ceuta"
				}
				if (dosdigitos == "52") {
					provincia.value = "Melilla"
				}				
			}
	

		} catch(error) {
			alert(error);
		}
	}




function publicidad() {
<!--// inicio 
	NumOpciones=23;
	prueba=Math.random();
	res = parseInt(prueba  * NumOpciones,10 );
	if (isNaN(res)==true){res=0;}

	document.write('<table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td align="center">');

// E-Dreams 1 -- 2007 ok
	if (res==0) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(90749)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=15407&a=362204&g=90749" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Record Rent A Car 1 -- 2007 ok
	if (res==1) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)g(146263)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// Destinia 1 -- 2007 ok
	if (res==2) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16619442)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=17509&a=362204&g=16619442" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// DELL 1 -- 2007 ok
	if (res==3) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)g(16188452)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// KLM -- 2007 ok
	if (res==4) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)g(16451464)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// DELL 2  --  2007 OK
	if (res==5) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)g(16187714)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// DELL 3 -- 2007 OK
	if (res==6) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16371926)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=4326&a=362204&g=16371926" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Mediatransfer -- 2007 ok
	if (res==7) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16203720)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=3806&a=362204&g=16203720" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Lastminute.com 1 -- 2007 ok
	if (res==8) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16744426)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=21645&a=362204&g=16744426" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Lastminute.com 2 -- 2007 ok
	if (res==9) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16744400)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=21645&a=362204&g=16744400" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// E-dreams 2 -- 2007 ok
	if (res==10) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(90748)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=15407&a=362204&g=90748" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Record Rent A Car 2 -- 2007 ok
	if (res==11) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(133971)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=17349&a=362204&g=133971" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// Media transfer 2 -- 2007 ok
	if (res==12) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(16203710)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=3806&a=362204&g=16203710" target="_blank"><img src="'+uri+'" border=0></a><br>MT 2');
	}
//AQUARELLE -- 2007 ok
	if (res==13) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(1105812)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=22651&a=362204&g=1105812" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// AIR FRANCE -- 2007 ok
	if (res==14) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(14096917)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=17770&a=362204&g=14096917" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// SKYPE -- 2007 ok
	if (res==15) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(12322424)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=28598&a=362204&g=12322424" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// iTUNES -- 2007 ok
	if (res==16) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)g(16728374)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// COMPRA-VENTA -- 2007 ok
	if (res==17) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(1049875)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=23212&a=362204&g=1049875" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// CASADELLIBRO -- 2007 ok
	if (res==18) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(137727)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=17460&a=362204&g=137727" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// CCC -- 2007 ok
	if (res==19) {
		var uri = 'http://impes.tradedoubler.com/imp?type(img)g(11627773)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<a href="http://clk.tradedoubler.com/click?p=24363&a=362204&g=11627773" target="_blank"><img src="'+uri+'" border=0></a>');
	}
// ebookers -- 2007 ok
	if (res==20) {
		var uri = 'http://impes.tradedoubler.com/imp?type(js)pool(188534)a(362204)' + new String (Math.random()).substring (2, 11);
		document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
	}
// CMID -- COLABORADOR CARRERA DE CICLOCROSS
	if (res==21) {
		document.write('<a href="/ccsantboi/esponsors/cmid.php"><img src="/ccsantboi/img/banners/cmid.gif" alt="CMID - Centre M&egrave;dic i Dental" border="0" width="460" height="60"></a>');
	}
// MOJAPROM
	if (res==22) {
		document.write('<a href="http://www.mojaprom.com" target="_blank"><img src="/ccsantboi/img/banners/mojaprom-460x60.gif" alt="MojaProm - Serveis Immobiliaris" border="0" width="460" height="60"></a>');
	}
	document.write('</td></tr></table>');
// Fin-->
}



/* NEW JS ERA */

function twitterStatus(msg) {
	$.ajax({
		url: 'https://api.twitter.com/oauth/request_token', /*http://twitter.com/status/update',*/
		type: 'POST',
		dataType: 'JSON',
		data: {
			status: msg, 
			path:   'statuses%2Fupdate',
			oauth_consumer_key:"lTEAb0Lih9qf7mlJspFDA",  
			oauth_version:"1.0"
				/*
				 * consumer_secret = "DDsgJ031Ou7PImFk5g9OeTe9HKIkVsyQ02Ne8AR44",
				 * Access token URL = "https://api.twitter.com/oauth/access_token", 
				 * authorize_url = "https://api.twitter.com/oauth/authorize",
				 * oauth_nonce=\"dI3INp3j5MBQQQARfRKIPW24LYULi9T4hJzlNERGpM\", 
				 * oauth_signature_method=\"HMAC-SHA1\", 
				 * oauth_timestamp=\"1280700242\", --> php date_timestamp_get(date) 
				 * oauth_consumer_key=\"lTEAb0Lih9qf7mlJspFDA\", 
				 * oauth_token=\"150808729-tfqSDcoge6VRizwHFa96Y853A5CMY3t2W8R0F5CG\", 
				 * oauth_signature=\"wVSkKKP%2BckzjbMzIA9thR2xuONw%3D\", 
				 * oauth_version=\"1.0\"
				 */

		},
		success: function(data) {
			//$('.result').html(data);
			alert('Load was performed.\n' + data);
		}
	});
}

function enlaceFB(Wurl) {
	document.write('<a name="fb_share" share_url="' + Wurl + '" type="icon_link">Comp&aacute;rtelo</a>');
}

function fbMG(){
	document.write('<fb:like-box profile_id="142755675753973" width="380" height="478" connections="6" logobar="1" stream="true" header="false"></fb:like-box>');
}
