function borrarCall() {
	if(document.getElementById("callNumber").value == "su telefono...")
		document.getElementById("callNumber").value = "";
}
function connectCall() {
	var NUMEROS = "1234567890";
	var telefono = document.getElementById("callNumber").value;	// Call number is taken from form
	var ch = telefono.charAt(0);
	if (document.getElementById("callNumber").value == "") {
		alert("Debes introducir el teléfono de contacto.");
		document.getElementById("callNumber").focus();
		return false;
	}
	if (telefono.length != 9) {
		alert("Debes introducir un número de teléfono válido.");
		return false;
	}
	if ((ch != "9") && (ch != "6")) {
		alert("Debes introducir un número de teléfono válido.");
		return false;
	}
	var affiliateId = unescape(JSQueryString("affid"));
	var programId = "189644";	// Program Id is hardcoded
	var callURI = "http://impse.tradedoubler.com/ctcrequest?p(" + programId + ")a(" + affiliateId + ")n(" + telefono + ")";
	// var callURI = "http://www.tradedoubler.com/pan/programClick2CallMakeCallCustomDomain.action?programId=" + programId + "&affiliateId=" + affiliateId + "&callNumber=" + telefono + "&random=" + Math.random();
	frames['iframeCall'].location.href = callURI;	// The browser is conncected to the URL that initates the c2c
}

function JSQueryString(par) {
	var sTemp 
	var sPar
	var sFin, iStart, iEnd
	sTemp = new String(window.location)
	sPar = new String(par + "=")
	iStart = sTemp.indexOf(sPar)
	if (iStart > 0) {
		iFin = sTemp.indexOf("&", iStart)
		if (iFin == -1) {
			iFin = sTemp.length
		}
		sFin = sTemp.substring(iStart + sPar.length,iFin)
	}
	else {
		sFin = ""
	}
	return sFin
}

