///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////FUNCTIONS////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function ocultarColumna(tabla,num,ocultar) {
dis = (ocultar==0) ? '' : 'none';
fila = document.getElementById(tabla).getElementsByTagName('tr');
fila[0].getElementsByTagName('th')[num].style.display=dis;
for(i=1;i(.*)\', 'i');
var matches = str.match(re);
if(matches) {
eval(matches[1]);
}
}
function checkLicenciasFreeNum(){
var obj = document.getElementById('num_licencias_documenta');
if(obj.options[obj.selectedIndex].value=='freeNum'){
document.getElementById('freeNum').style.display = 'inline';
setDiskQuota(1);
} else {
document.getElementById('freeNum').style.display = 'none';
setDiskQuota(0);
}
}
function disableEnterKey(e){
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
return (key != 13);
}
function recordarPassword(login){
if(login!=''){
var http = new_ajax();
http.open(" web="" recordarpassword.php?login=" + login, true);
http.onreadystatechange=function() {
if(http.readyState == 4) {
alert(http.responseText);
}
}
http.send(null);
} else {
alert('Write you username and press again to receive your credentials by email.');
}
}
function validar_alta(agrupacion_id){
var http = new_ajax();
http.open(" validar_alta.php?agrupacion_id=" + agrupacion_id, true);
http.onreadystatechange=function() {
if(http.readyState == 4) {
window.location.reload();
}
}
http.send(null);
}
function check_num_licencias_documenta(){
var num_licencias_documenta = parseInt(document.getElementById('num_licencias_documenta').value);
document.getElementById('num_licencias_documenta').value = num_licencias_documenta;
var min_num_licencias_documenta = parseInt(document.getElementById('min_num_licencias_documenta').value);
var precio_por_licencia = parseFloat(document.getElementById('precio_por_licencia').value);
var diskquota_por_licencia = parseFloat(document.getElementById('diskquota_por_licencia').value);
if ( num_licencias_documenta < min_num_licencias_documenta || isNaN(num_licencias_documenta)) {
alert('Minimum up to ' + min_num_licencias_documenta + 'licenses');
var num_licencias_documenta = parseInt(document.getElementById('min_num_licencias_documenta').value);
document.getElementById('num_licencias_documenta').value = num_licencias_documenta;
}
document.getElementById('diskquota').value = (num_licencias_documenta*diskquota_por_licencia).toFixed(2);
document.getElementById('diskquota_show').value = (document.getElementById('diskquota').value>1)?document.getElementById('diskquota').value+' GB':1000*document.getElementById('diskquota').value+' MB';
document.getElementById('precio').value = (num_licencias_documenta*precio_por_licencia).toFixed(2);
document.getElementById('precio_show').value = document.getElementById('precio').value+" €"="" document.getelementbyid('iva_show').value="(.01*document.getElementById('iva').value*document.getElementById('precio').value).toFixed(2)+"" document.getelementbyid('total_show').value="(Number(document.getElementById('precio').value)+Number(.01*document.getElementById('iva').value*document.getElementById('precio').value)).toFixed(2)+"" check_coupon_code(){="" coupon_code="document.getElementById('coupon_code').value;" +coupon_code;="" if(http.responsetext="=''){" alert('non-existent="" coupon="" code');="" document.getelementbyid('coupon_code').value="" apply_coupon_code(parsefloat(http.responsetext));="" check_coupon_code4(){="" apply_coupon_code4(parsefloat(http.responsetext));="" check_coupon_code_compra(){="" check_coupon_code_compra4(){="" apply_coupon_code(discount){="" num_licencias_documenta="parseInt(document.getElementById('num_licencias_documenta').value);" precio_por_licencia="parseFloat(document.getElementById('precio_por_licencia').value);" document.getelementbyid('precio_show').value="document.getElementById('precio').value+"" apply_coupon_code4(discount){="" apply_diskquota(min_diskquota,remaining_days,precio_day){="" if(diskquota<="min_diskquota){" alert('minimum="" up="" '="" (min_diskquota+1)="" gb');="" document.getelementbyid('precio_por_licencia').value="(diskquota-min_diskquota)*remaining_days*precio_day;" if(document.getelementbyid('coupon_code').value!="" check_coupon_code_compra();="" apply_coupon_code(0);="" apply_diskquota4(min_diskquota,remaining_days,precio_day){="" check_coupon_code_compra4();="" apply_coupon_code4(0);="" apply_lics4(min_lics,remaining_days,precio_day){="" lics="parseInt(document.getElementById('num_licencias_documenta').value);" document.getelementbyid('num_licencias_documenta').value="lics;" if(lics<="min_lics){" (min_lics+1)="" licenses');="" check_coupon_code4();="" gencdpcoupon(contenido_de_pago_id){="" gencdpcoupon.php?contenido_de_pago_id=" + contenido_de_pago_id, true);
http.onreadystatechange=function() {
if(http.readyState == 4) {
document.getElementById('coupon').value = http.responseText;
}
}
http.send(null);
}
function cdp_send_to_publish(adm_email){
var str = " now="" subscription="" content="" will="" be="" sent="" validate="" publication.="" during="" validation="" process="" is="" able="" update="" data.="" once="" validated="" receive="" an="" email="" {adm_email}="" and="" can="" edit="" data="" again.";="" adm_email);="" if(confirm(str)){="" publish_hidden_field="document.createElement("input");" publish_hidden_field.setattribute("type",="" "hidden");="" publish_hidden_field.setattribute("name",="" "send_to_publish");="" publish_hidden_field.setattribute("value",="" "1");="" document.getelementbyid("editarcontenidodepagoform").appendchild(publish_hidden_field);="" document.getelementbyid('editarcontenidodepagoform').submit();="" cdp_publish_super(){="" "publish_super");="" cdp_check_coupon(){="" cdp_id="document.getElementById('cdp_id').value;" +cdp_id+"&coupon_code="+coupon_code;
http.open(" invitation');="" cdp_apply_coupon(parsefloat(http.responsetext));="" cdp_apply_coupon(discount){="" if(discount="=1){" document.getelementbyid('iva').value="0.00;" document.getelementbyid('div_modo_pago_label').style.display="none" document.getelementbyid('div_modo_pago').style.display="none" document.getelementbyid('div_cliente').style.display="none" €';="" parsefloat(document.getelementbyid('iva').value)).tofixed(2)="" deletecdpcustomimg(){="" deletecdpcustomimg.php",="" document.getelementbyid('cdp_preview').src="document.getElementById('preview_url_no_custom').value;" document.getelementbyid('div_edit_custom_img').style.display="none" document.getelementbyid('div_upload_custom_img').style.display="block" document.getelementbyid('preview_is_custom').value="0;" ajaxfileupload(field){="" $(document).ajaxstart(function()="" document.getelementbyid('div_loading_custom_img').style.display="block" })="" $.ajaxfileupload({="" url:'.="" uploadcdpcustomimg.php',="" secureuri:false,="" fileelementid:field,="" datatype:="" 'json',="" data:{fileelementname:field},="" (data,="" status){="" if(typeof(data.error)="" if(data.error="" if(field="='fileToUpload'){" alert(data.error);="" if(data.msg="=1){" date().gettime());="" status,="" e){="" alert(e);="" refreshcdpimg(){="" if(document.getelementbyid('preview_is_custom').value="=0){" +sel.options[sel.selectedindex].value+'.jpg';="" document.getelementbyid('preview_url_no_custom').value="http://www.mydocumenta.com/data/proyectos/preview/" setcdptitulo(){="" document.getelementbyid('titulo').value="$('select#proyecto_de_entrada" option:selected').data("titulo");="" cdpaddtrad(idioma_id){="" $("#add_cdp_trad="" option[value=""+idioma_id+"" ]").remove();="" $("#div_cdp_i18n_"+idioma_id).css('display','block');="" $("#titulo"+idioma_id).removeattr('disabled');="" $("#desc_corta"+idioma_id).removeattr('disabled');="" $("#desc_larga"+idioma_id).removeattr('disabled');="" if($("#add_cdp_trad="" option").length="=1){" $("#div_add_cdp_trad").css('display','none');="" cdpdeletetrad(idioma_id,idioma_nombre){="" $("#div_add_cdp_trad").css('display','block');="" $("#div_cdp_i18n_"+idioma_id).css('display','none');="" $("#add_cdp_trad").append('');
$("#idioma_id option").each(function(){
if($(this).val()!=i && $("#div_cdp_i18n_"+$(this).val()).css('display')=='none'){
$("#add_cdp_trad").append('');
}
});
sortSelect(add_cdp_trad);
}
function sortSelect(selElem) {
var tmpAry = new Array();
for (var i=0;i 0) {
selElem.options[0] = null;
}
for (var i=0;i 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
},
// public method for url decoding
decode : function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < utftext.length ) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
}
}