///////////////////////////////
/*Begin - Simiinforma Code*/
///////////////////////////////
var ELEMENT_NODE = 1
//TEXT_NODE
var xmlDoc;
var arrnoticias = null;
var contador = 0;
var tiempo = 0;
var tempor = null;

function cargaCarruselNoticias(){
	var xmlnews = "noticiasPrincipal.xml";
	if (window.ActiveXObject){ 
		/////////////////////////////////////////////////////////////////
		// Internet Explorer, create a new XML document using ActiveX 
		// and use loadXML as a DOM parser. 
		/////////////////////////////////////////////////////////////////
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 
		xmlDoc.async=false; 
		xmlDoc.load(xmlnews);
  	} else if(document.implementation.createDocument){ 
		/////////////////////////////////////////////////////////////////
		// Mozilla, create a new DOMParser 
		//var parser = new DOMParser(); 
		//xmlDoc = parser.parseFromString(xmlnews, "text/xml"); 
		/////////////////////////////////////////////////////////////////
		xmlDoc=document.implementation.createDocument("","",null);
		xmlDoc.async=false; 
		xmlDoc.load(xmlnews);
	}
	getNotasRun();	
}

function getNotasRun(){
	/*document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"Style.css\" />");
	document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"featuredcontentglider.css\" />");
	document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"cssbuttonstoggler.css\" />");*/
	var currentNotice = null;
	var labels = xmlDoc.getElementsByTagName('item');
	var noticias = "";
	var nombre;
	var numdespliegue=4;
	if (labels.length > 0 && labels.length < numdespliegue){
		numdespliegue = labels.length
	}
	arrnoticias = new Array(4); 
	for (i=0; i < numdespliegue; i++){
		currentNotice = new Array(4);
		currentNotice[0] = labels[i].getElementsByTagName("title")[0].firstChild.nodeValue//TITLE
		currentNotice[1] = labels[i].getElementsByTagName("description")[0].firstChild.nodeValue//DESCRIPTION
		currentNotice[2] = labels[i].getElementsByTagName("link")[0].firstChild.nodeValue//LINNK
		currentNotice[3] = labels[i].getElementsByTagName("media:content")[0].getAttribute("url");//IMAGE
		arrnoticias[i] = currentNotice;
		//alert("Imagen: " + arrnoticias[i][3])
	}

	//document.getElementById('ntcssiminfrm').innerHTML = noticias;
}
//cargaCarrusel();
cargaCarruselNoticias();
///////////////////////////////
/*End - Simiinforma Code*/
///////////////////////////////

//If using image buttons as controls, Set image buttons' image preload here true
//(use false for no preloading and for when using no image buttons as controls):
var preload_ctrl_images=true;

//And configure the image buttons' images here:
var previmg='http://www.dynamicdrive.com/dynamicindex14/swissarmy/left.gif';
var stopimg='http://www.dynamicdrive.com/dynamicindex14/swissarmy/stop.gif';
var playimg='http://www.dynamicdrive.com/dynamicindex14/swissarmy/play.gif';
var nextimg='http://www.dynamicdrive.com/dynamicindex14/swissarmy/right.gif';

var slides=[]; //FIRST SLIDESHOW
//configure the below images and descriptions to your own.
for(x = 0; x < arrnoticias.length; x++){
	slides[x] = [arrnoticias[x][3], "<a href="+arrnoticias[x][2]+" class='tindex1'>"+ arrnoticias[x][1].substring(0,120)+"...</a>", arrnoticias[x][2]/*arrnoticias[x][1].substring(0,80)+"..."*/];
}

/*
slides[0] = [arrnoticias[0][3], arrnoticias[0][1]];
slides[1] = [arrnoticias[1][3], arrnoticias[1][1]];
slides[2] = [arrnoticias[2][3], arrnoticias[2][1]];
slides[3] = [arrnoticias[3][3], arrnoticias[3][1]];
*/
//slides[4] = [arrnoticias[x][3], "John, Mary and Jesus"];
/////////////////////////////////////
//Config managment
////////////////////////////////////
//slides.controls_top=1; //use for top controls
//above slide show uses only the defaults
//Notes:
//slides#.target will set a target for a slide group, will be overridden by slides#[#][3], if present
//slides#.specs will set new window specifications for a slide group, will be overridden by slides#[#][4], if present
//slides#.fadecolor will set fading images background color, defaults to white
//slides#.no_controls will set a slide show with no controls
//slides#.random will set a random slide sequence on each page load
//slides#.delay=3000 will set miliseconds delay between slides for a given show, may also be set in the call as the last parameter
//slides#.jumpto=1 will display added controls to jump to a particular image by its number
//slides#.no_added_linebreaks=1; use for no added line breaks in formatting of texts and controls
//use below to create a customized onclick event for linked images in a given show:
//slides#.onclick="window.open(this.href,this.target,'top=0, left=0, width='+screen.availWidth+', height='+screen.availHeight);return false;"
///////////////////////////////
/*Begin - Simiinforma Code*/
///////////////////////////////
slides.no_controls=1;
slides.jumpto=0;
slides.no_auto=0;
slides.delay=8000;
///////////////////////////////
/*End - Simiinforma Code*/
///////////////////////////////