﻿function IsNumeric (strString) {
							
								var strValidChars = "0123456789.-";
								var strChar;
								var blnResult = true;

								if (strString.length == 0) return false;

								for (i = 0; i < strString.length && blnResult == true; i++) {
							
									strChar = strString.charAt(i);

									if (strValidChars.indexOf(strChar) == -1) {
										
										blnResult = false;
									}
								}
	
								return blnResult;
							}



function set_checkboxes(form_name, kontrol_box) {

	for (var i = 0; i < form_name.elements.length; i++) {

		var element = form_name.elements[i];

		if ((element.name != kontrol_box) && (element.type == "checkbox")) {

			element.checked = form_name.elements[kontrol_box].checked;
		}
	}
}


function showoptions () {

	if (checkdocument("options").style.display == "block") {

		checkdocument("options").style.display  = 'none';
		checkdocument("login").style.height     = '222px';
		checkdocument("mainlogin").style.height = '222px';
	} else {
		checkdocument("options").style.display = 'block';
		checkdocument("login").style.height     = '248px';
		checkdocument("mainlogin").style.height = '248px';
	}

	return false;
}
	
	
var show_time;

function checkdocument (nome) {
	
	if   (document.all) return eval("document.all." + nome);
	else 		    return document.getElementById(nome);
}

function switchLangs () {
		
	if (checkdocument("hiddenlangs").style.display == 'block') {
		checkdocument("hiddenlangs").style.display = 'none';
	} else {
		checkdocument("hiddenlangs").style.display = 'block';
	}
}




var numValidateItems = 0
function countToValidate (elemento) {


	if (elemento.checked) {
		numValidateItems++;
		document.getElementById("row" + elemento.value).style.background = '#ff9';
	} else {
		numValidateItems--;
		document.getElementById("row" + elemento.value).style.background = '#eee';
	}

	

	document.validateitems.startvalidate.value = 'Validate Selected items ('+numValidateItems+')';
}

		
var numValidateItems2 = 0
function countToValidate2 (elemento) {


	if (elemento.checked) {
		numValidateItems2++;
		document.getElementById("row" + elemento.value).style.background = '#ff9';
	} else {
		numValidateItems2--;
		document.getElementById("row" + elemento.value).style.background = '#eee';
	}

	

	document.validateitems.startvalidate2.value = 'Go ('+numValidateItems2+')';
}

		
		
		

function checkForDelete () {

	return window.confirm("Va a borrar este contenido. ¿Está Usted seguro?");


}





function redir_NoticiasList_Select(s, tab, cat, year, month, day) {

	window.location = '/kontrolpanel/articulos.php?s='+s+'&tab='+tab+'&cat='+cat+'&cl=1&y='+year+'&m='+month+'&d='+day;
		
} 

function redir_Portada_Select(s, tab, year, month, day) {

	window.location = '/kontrolpanel/portada.php?s='+s+'&tab='+tab+'&cl=1&y='+year+'&m='+month+'&d='+day;
		
} 


function redir_GalleryList_Select(s, tab, cat, year, month, day) {

	window.location = '/kontrolpanel/galerias.php?s='+s+'&tab='+tab+'&cl=1&cat='+cat+'&y='+year+'&m='+month+'&d='+day;
		
} 

function redir_VideoList_Select(s, tab, cat, year, month, day) {

	window.location = '/kontrolpanel/galerias.php?s='+s+'&tab='+tab+'&cl=1&cat='+cat+'&y='+year+'&m='+month+'&d='+day;
		
} 

function redir_epaperList_Select(s, tab, cat, year, month, day) {

	window.location = '/kontrolpanel/epaper.php?s='+s+'&tab='+tab+'&cat='+cat+'&cl=1&y='+year+'&m='+month+'&d='+day;
		
} 

function redir_pzvirtualList_Select(s, tab, year, month, day) {

	window.location = '/kontrolpanel/pzvirtual.php?s='+s+'&tab='+tab+'&cl=1&y='+year+'&m='+month+'&d='+day;
		
} 

function redir_polllist_Select(s, tab, year, month, day) {

	window.location = '/kontrolpanel/encuestas.php?s='+s+'&tab='+tab+'&cl=1&y='+year+'&m='+month+'&d='+day;
		
} 
