// JavaScript Document
function uploadThumbnail(){
	window.open ("../FCKeditor/editor/filemanager/browser/default/NotituBrowser.html", 
				 "fileupload","width=300,height=50, status=0,toolbar=0");

}

function changeThumbnail(fileName){
	document.getElementById("ThumbnailElementText").innerHTML = '<br><img src="..' + fileName + '" width="120" height="70">' +
		'<br><a href="javascript:uploadThumbnail()"> Cambiar imagen ...</a>';
	document.getElementById("Thumbnail").value = '..' + fileName;
	
}

function changeFilterKeyWords(){
	keywordsBox = document.getElementById('FilterKeywords');
	if (keywordsBox.value == 'Escribe tu ciudad, un tema o palabras claves'){
		keywordsBox.value  = '';
	}
}

function modifyReportDeleteLanguage(){
	document.getElementById("DeleteElements").innerHTML = '<span class="DeleteElementsText">Eliminar elementos seleccionados</span>';
}

function displayCButton(spanName){
	document.getElementById(spanName).style.visibility = 'visible';
}

function hideCButton(spanName){
	document.getElementById(spanName).style.visibility = 'hidden';
}

function hideExtraNews(uuid){
	var buble = jmaki.attributes.get(uuid);
	if (buble == null){
		// Internet Explorer ...
	} else {
		jmaki.attributes.get(uuid).hideTooltip();
		hideCButton('Close' + uuid);
	}
}

function showExtraNews(uuid){
	var buble = jmaki.attributes.get(uuid);
	if (buble == null){
		
	} else {	
		jmaki.attributes.get(uuid).showTooltip();
		displayCButton('Close' + uuid);	
	}
}

function loadMapFrame(){
	document.getElementById('MapIFrame').src='../jsp/NewsMap.jsp';
	
}


function writeYourVersion(i){
	var title = document.getElementById("RssEntryTitle" + i).innerHTML;
	var link = document.getElementById("RssEntryLink" + i).href;
	document.getElementById("RssExternalTitle").value = title;
	document.getElementById("RssExternalLink").value = link;
	document.RssEntryForm.submit();	
	
}

function openWindow(urlopen, width, height){
	//alert(urlopen + " == " + "width=" + width + ", height=" + height +",status=0,toolbar=0,scrollbars=1");
	window.open(urlopen, 'Notitu','width=' + width + ',height=' + height +',status=0,toolbar=0,scrollbars=1,resizable=yes');
}

function openImage(url){
	window.open('../jsp/imagePopup.jsp?imageUrl=' + escape(url), 'Notitu','width=540,height=420,status=0,toolbar=0,scrollbars=1,resizable=yes');
	
}

function changeNewsPaper(){
	var url = document.getElementById("newsfeeds").value;
	document.getElementById("newspaperframe").src = "../jsp/ExternalRSSFeed.report?uniqueKeyValue=" + url;
	
}
