// JavaScript Document

function arreglaTexto(texto){
	return unescape(texto.replace(/\+/gi," "));
}

function wopen(url, name, w, h)
{
	w += 32;
	h += 96;
	wleft = (screen.width - w) / 2;
	wtop = (screen.height - h) / 2;
	var win = window.open(url,
	name,
	'width=' + w + ', height=' + h + ', ' +
	'left=' + wleft + ', top=' + wtop + ', ' +
	'location=no, menubar=no, ' +
	'status=no, toolbar=no, scrollbars=no, resizable=no');
	// Just in case width and height are ignored
	win.resizeTo(w, h);
	// Just in case left and top are ignored
	win.moveTo(wleft, wtop);
	win.focus();
}
function wopen2(url, name, w, h)
{
	w += 32;
	h += 96;
	wleft = (screen.width - w) / 2;
	wtop = (screen.height - h) / 2;
	var win = window.open(url,
	name,
	'width=' + w + ', height=' + h + ', ' +
	'left=' + wleft + ', top=' + wtop + ', ' +
	'location=no, menubar=no, ' +
	'status=no, toolbar=no, scrollbars=yes, resizable=no');
	// Just in case width and height are ignored
	win.resizeTo(w, h);
	// Just in case left and top are ignored
	win.moveTo(wleft, wtop);
	win.focus();
}
function wopen3(url, name)
{
	wleft = (screen.width) / 2;
	wtop = (screen.height) / 2;
	var win = window.open(url,
	name,
	'width=' + screen.width + ', height=' + screen.height + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' +
	'location=no, menubar=no, fullscreen=no, status=no, toolbar=auto, scrollbars=yes, resizable=no, maximized=yes');
	// Just in case width and height are ignored
	//win.resizeTo(w, h);
	// Just in case left and top are ignored
	win.moveTo(0,0);
	win.focus();
}

function saluda(){
	alert("holaaaa");
}
function abrecapaIdioma(){
	$("#cpIdiomas").slideToggle();	
}
function cambiaIdioma(){
	data="lang="+$("#cmbIdioma").val();
	$.ajax({
		type:	'POST',
		data:	data,
		url:	'scripts/cambiaIdioma.scr.php',
		success:	function(datos){			
			location.reload();			
		},
	});
}

function html_entity_decode (string, quote_style) {
    var hash_map = {},
        symbol = '',
        tmp_str = '',
        entity = '';
    tmp_str = string.toString();

    if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }

    
    delete(hash_map['&']);
    hash_map['&'] = '&amp;';

    for (symbol in hash_map) {
        entity = hash_map[symbol];
        tmp_str = tmp_str.split(entity).join(symbol);
    }
    tmp_str = tmp_str.split('&#039;').join("'");

    return tmp_str;
}


