var _base = "http://www.corporacioncasa.com.ve/sie"

var _baseUrl = "http://www.corporacioncasa.com.ve/site/index.php"
/*
var _base = "http://localhost/appweb"

var _baseUrl = "http://localhost/appweb/index.php"
*/


function main()

{

		document.getElementById('dnavega').style.display = 'none'

		$('ifnavegacion').style.display = 'block'

		$('ifnavegacion').width = '965px'

		$('ifnavegacion').height = '468px'

		$('ifnavegacion').src = _baseUrl + '/portal/home/main'

}





window.addEvents(

{

'domready': function()

	{

		/* thumbnails example , div containers */

		/**

			Function: SlideItMoo

			Tipo: publica

			Parametros: (none)

			Retorno: objeto SlideItMoo de mootools 1.2

			Descripción: realiza el slider en la parte inferior del portal web y el scroll de las noticias

			Autor: Rodolfo Suárez

			<Divide>	

		**/

		new SlideItMoo({

			overallContainer: 'SlideItMoo_outer',

			elementScrolled: 'SlideItMoo_inner',

			thumbsContainer: 'SlideItMoo_items',		

			itemsVisible:6,

			elemsSlide:5,

			duration:1800,

			itemsSelector: '.SlideItMoo_element',

			itemWidth: 148,

			autoSlide: true,

			mouseWheelNav: false,

			showControls:0});

	

			// instancio el siguiente plugin de mootools

		 SexyLightbox = new SexyLightBox();

	

	}

}

);



function abrir(valor)

{

	window.open(valor, "_blank", "toolbar=yes,menubar=no,directories=yes,status=yes,resizable=no,location=no,scrollbars=yes")

}





// para abrir las páginas y navegar

function abrir_pagina(pagina,activa)

{

	try

	{

		if(activa)

		{

			$('ifnavegacion').style.display = 'none'

			$('dnavega').style.display = 'block'

			$('dnavega').width = '965px'

			$('dnavega').height = '468px'	

			

			var prueboRequest = new Request({

			evalScripts: true,

			url: _baseUrl+'/portal/home/pagina/'+pagina,

			onRequest: function() 

			{ 

				$('dnavega').set('html',"<div class='ajax_loading'><img src='assets/images/icons/ajax_loader.gif'><br>Cargando, espere unos segundos . . .</div>")

			},  

			onSuccess: function(texto, responseHTML)

			{

				$('dnavega').set('html',texto)

			}

			}).send()		

		}

		else

		{

			$('dnavega').empty();

			$('dnavega').style.display = 'none'

			$('ifnavegacion').style.display = 'block'

			$('ifnavegacion').width = '965px'

			$('ifnavegacion').height = '468px'

			$('ifnavegacion').src = _baseUrl + '/portal/home/'+pagina

		}

	}

	catch(err)

	{

		txt="Se ha encontrado un error en el portal de la Corporación CASA.\n\n";

		txt+="Descripción: " + err.description + "\n\n";

		txt+="Click para continuar.\n\n";

		alert(txt);

	}

}





function abrir_aplicacion(value)

{

	if(value != 4)

	{

		switch(value)

		{

			case 1:

				url = "http://sistema.corporacioncasa.com.ve"

			break;

			

			case 2:

				url = "http://sistema.corporacioncasa.com.ve/sistemas/captacion_rrhh/principal.php"

			break;

			

			case 3:

				url = "http://sistema.corporacioncasa.com.ve/sistemas/mercado_virtual/"

			break;

		}

		window.open(url, "","");

	}

	else

	{

		window.top.location	= _baseUrl;

	}	

}

// para leer las noticias
function cargar(valor1)
{
	valor1 = 'all'
	$('dnavega').empty();
	$('dnavega').style.display = 'none'
	$('ifnavegacion').style.display = 'block'
	$('ifnavegacion').width = '965px'
	$('ifnavegacion').height = '468px'
	$('ifnavegacion').src =  "http://sistema.corporacioncasa.com.ve/appweb/index.php/portal/publicacion/cargar_publicacion/"+valor1
	$('ifnavegacion').scrolling =  'no'
}
