function printNews(newsId, siteId) {
	window.open('printNews.aspx?newsId=' + newsId + '&siteId=' + siteId, 'printWindow', 'toolbar=no,scrollbars=yes,status=no,resizable=no,width=750,height=400');
}

var newwindow;
function popup(url) {
	newwindow = window.open(url, 'name', 'height=850,width=700, toolbar=no, location=no,directories=no,status=no,menubar=yes,scrollbars=yes, resizable=no, copyhistory=no');
	if (window.focus) { newwindow.focus() }
}


var W3CDOM = (document.createElement && document.getElementsByTagName);

function initFileUploads() {
	if (!W3CDOM) return;
	var fakeFileUpload = document.createElement('div');
	fakeFileUpload.className = 'fakefile';
	var ourInput = document.createElement('input');
	
	ourInput.setAttribute("readonly", "readonly");
	
	fakeFileUpload.appendChild(ourInput);
	var image = document.createElement('img');
	image.src='/images/select.gif';
	fakeFileUpload.appendChild(image);
	var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].type != 'file') continue;
		if (x[i].parentNode.className != 'fileinputs') continue;
		x[i].className = 'file hidden';
		var clone = fakeFileUpload.cloneNode(true);
		x[i].parentNode.appendChild(clone);
		x[i].relatedElement = clone.getElementsByTagName('input')[0];
		x[i].onchange = x[i].onmouseout = function () {
			this.relatedElement.value = this.value;
		}
	}
}



function hideDiv(idObject,idLink) { 

 var idFunction = '#' + idObject;

        
      $(idFunction).find('.contentClose').animate({ 
            marginLeft: '70px'
   }, 500 );  
        
      $(idFunction).show().animate({ 
        top: "-22px"
      }, 500, function(){
        $('#' + idLink).removeClass('active');
         show(idLink);
      
      });
} 



function callDelayShowDiv(idObject, idLink){
      window.setTimeout(function(){ 
        showDiv(idObject, idLink)
     },500);
}

function showDiv(idObject,idLink) { 
   $('.contentLogin, .contentNewsletter, .contentSitesCompal').show().animate({ 
        top: "-22px"
     }, 500 , function(){
        $('#contLogin').removeClass('active');
        $('#contSitesCompal').removeClass('active');
        $('#contNewsletter').removeClass('active');
         show('contLogin');
    });

   window.setTimeout(function(){       
       $('#' + idLink).addClass('active') 
    },1000);

   
    var footerHeight = 32;
    var idFunction = '#' + idObject;
    
    var idFuntionHeight = $(idFunction).height()
    var totalHeight = (idFuntionHeight + 32) *-1 ;
     
    $(idFunction).show().animate({ 
            top: totalHeight + 'px'
        }, 500,function(){
            
            $(idFunction).find('.contentClose').animate({ 
                    marginLeft: '20px'
           }, 500 ); 
                hide(idLink);

        });
   
} 

function hide(idLink){
   // alert("hide : " + idLink)
    if (idLink == "contLogin"){
        document.getElementById("FlashLogout").hideArrow();
    }
}

function show(idLink) {
   // alert("show : " + idLink)
    if (idLink == "contLogin"){
        document.getElementById("FlashLogout").showArrow();
    }
}

$(document).ready(function() {
    $("a#linkContactos").toggle(function(){
        $('.contentContactos').fadeIn('slow');
    },function(){
        $('.contentContactos').fadeOut('slow');
    });
    $("#linkContactos").click(function(){
        return false;
    });
});



function flashModules(flashSiteId, flashLogin, swfName, swfId, swfWidth, swfHeight){

    var flashvars = {siteId: flashSiteId};
    var params = { quality: "high", menu: "false", wmode: "window", scale: "noscale", bgcolor: "#FFFFFF" };
    var attributes = { id: flashLogin, bgcolor: "#FFFFFF"};
    swfobject.embedSWF("swf/" + swfName + ".swf", swfId, swfWidth, swfHeight, "9.0.0", "swf/javascript/expressInstall.swf", flashvars, params, attributes);

}








 

