﻿function exoOnLoad(){exoSetFocus();setTimeout("exoQuitarMensajesError();",10000);}
function exoCI(control, img) {control.src="img/"+img;}
function exoQuitarMensajesError (){var object = document.getElementById('error');if(object != null){object.style.filter="revealTrans(duration=3, transition=12)";object.filters.revealTrans.apply();object.style.visibility="hidden";object.filters.revealTrans.play();}var object = document.getElementById('info');if(object != null){object.style.filter="revealTrans(duration=3, transition=12)";object.filters.revealTrans.apply();object.style.visibility="hidden";object.filters.revealTrans.play();}}
function exoSetFocus() {if (document.forms.length > 0) {var field = document.forms[0];for (i=0; i<field.length; i++) {if ((field.elements[i].type != "image") && (field.elements[i].type != "hidden") && (field.elements[i].type != "reset") &&	(field.elements[i].type != "submit") && (field.elements[i].className != "field_ro") &&	 (field.elements[i].className != "field_ronum")) {document.forms[0].elements[i].focus();if ((field.elements[i].type == "text") || (field.elements[i].type == "password"))document.forms[0].elements[i].select();break;}}}}
function exoCheckboxMon(form,checked){for (i=0; i<form.length; i++) {if ((form.elements[i].type == "checkbox")) {form.elements[i].checked = checked;}}}
function exoWO(url) {window.open(url,'exo_window','width=400,height=350,resizable=yes');}
function exoWOC(url,params) {window.open(url,'exo_window',params);}
//function yuiCalendar (fieldName) {YAHOO.namespace("example.calendar");YAHOO.example.calendar.init = function() {function handleSelect(type,args,obj) {var dates = args[0];var date = dates[0];var year = date[0], month = date[1], day = date[2];var txtDate1 = document.getElementById(fieldName);txtDate1.value = year + "/" + month + "/" + day;YAHOO.example.calendar.cal.hide();txtDate1.focus();txtDate1.select();}YAHOO.example.calendar.cal = new YAHOO.widget.Calendar("cal","calContainer", { title:"Elija la fecha:", close:true } );YAHOO.example.calendar.cal.selectEvent.subscribe(handleSelect, YAHOO.example.calendar.cal, true);YAHOO.example.calendar.cal.render();YAHOO.util.Event.addListener(fieldName, "click", YAHOO.example.calendar.cal.show, YAHOO.example.calendar.cal, true);}YAHOO.util.Event.onDOMReady(YAHOO.example.calendar.init);}
//function yuiCalendar2 (fieldName) {YAHOO.namespace("example.calendar");YAHOO.example.calendar.init = function() {function handleSelect(type,args,obj) {var dates = args[0];var date = dates[0];var year = date[0], month = date[1], day = date[2];var txtDate1 = document.getElementById(fieldName);txtDate1.value = year + "/" + month + "/" + day;YAHOO.example.calendar.cal2.hide();txtDate1.focus();txtDate1.select();}YAHOO.example.calendar.cal2 = new YAHOO.widget.Calendar("cal","calContainer2", { title:"Elija la fecha:", close:true } );YAHOO.example.calendar.cal2.selectEvent.subscribe(handleSelect, YAHOO.example.calendar.cal2, true);YAHOO.example.calendar.cal2.render();YAHOO.util.Event.addListener(fieldName, "click", YAHOO.example.calendar.cal2.show, YAHOO.example.calendar.cal2, true);}YAHOO.util.Event.onDOMReady(YAHOO.example.calendar.init);}
function exoGeneraSWF (swf, width, height, id){document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj2"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+width+'" height="'+height+'"> \n');document.write('<param name="movie" value="'+swf+'"> \n');document.write('<param name="bgcolor" value="#ffffff">\n');document.write('<param name="quality" value="High"> \n');document.write('<param name="allowscriptaccess" value="samedomain"> \n');document.write('<param name=menu value="false"> \n');document.write('<param name="wmode" value="transparent"> \n');document.write('<embed src="'+swf+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj2" width="'+width+'" height="'+height+'" quality="High" wmode="transparent"></embed>'+'\n');document.write('</object> \n');if(id){try {document.getElementById(id).style.visibility = 'hidden';document.getElementById(id).style.display = 'none';}catch(e){}}}

var video = [];
video[1] = '<iframe width="370" height="300" src="http://www.youtube.com/embed/5ysYExAArEE" frameborder="0" allowfullscreen></iframe>';
video[2] = '<iframe width="370" height="300" src="http://www.youtube.com/embed/NCta6j5_FdM" frameborder="0" allowfullscreen></iframe>';
video[3] = '<iframe width="370" height="300" src="http://www.youtube.com/embed/mYF2_FBCvXw" frameborder="0" allowfullscreen></iframe>';
video[4] = '<iframe width="370" height="300" src="http://www.youtube.com/embed/NQzYclR8ufM" frameborder="0" allowfullscreen></iframe>';
video[4] = '<iframe width="370" height="300" src="http://www.youtube.com/embed/5ysYExAArEE" frameborder="0" allowfullscreen></iframe>';

/*jQuery Start*/
$(function(){
    
    //VIDEOSLIDE
    $("#videowidget-tabs a").click(function(){
	var container = $("#videowidget-content");
	container.html("");
	var id = $(this).attr("href").slice(1);
	$.get("get_video.pl",{id_video:id},function(data){$("#videowidget-content").html(data);});
	$("#videowidget-tabs li").removeClass("actVid");
	$("#videowidget-tabs a[href=#"+id+"]").parent().addClass("actVid");
	return false;
      });
    $("#videowidget-tabs").hoverscroll({horizontal:true,width:370,height:112,arrows:false});
    
    $("#newsslider").accessNews({slideBy:3, slideShowInterval:6000, slideShowDelay:6000});
    
    var timervideo = window.setInterval("changeVideo()",15000);
    $("#videowidget").live('mouseover',function(){
	window.clearInterval(timervideo);
      });

  });

function changeVideo() {
  $("#videowidget .actVid").next().find('a').trigger('click');
}

