﻿function fnAdjustCellSectionHeightAfterTopLink(){
	document.getElementById("cellSectionAfterTopLinkPanel").height = document.documentElement.clientHeight - 235;
}
function fnOpenVacancy(whVacancy) {
    window.open('/HTML/ContentPages/Vacancy.htm#Job'+whVacancy, 'Vacancy', 'directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,top=20,left=50,height=600,width=650');
}
function addBookmark(){
if (document.all) {window.external.AddFavorite(location.href, document.title);}
else if (window.sidebar){window.sidebar.addPanel(document.title, location.href, "");}
}

function updateClock ( )
{
  var currentTime = new Date ( );
  
  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

  // Update the time display
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}

function changeStyle(varStyle) {
    //document.getElementById('stylesheet').href = "/HTML/Includes/JSHTM_net_" + varStyle + ".css";
   // fnSaveCurrentTheme(varStyle);
}


// switch to flash code begins

function detectOS(){
	if(navigator.userAgent.indexOf('Win') == -1) {
		OS = 'Macintosh';
	} else {
		OS = 'Windows';
	}
	return OS;
}

function detectBrowser(){
	if(navigator.appName.indexOf('Netscape') == -1) {
		browser = 'IE';
	} else {
	browser = 'Netscape';
	}
	return browser;
}

function abrir(pagina){
	var randomnumber=Math.floor(Math.random()*100 + 1);
	var tempAdd = "";
	tempAdd = pagina + "?" + randomnumber;
	var OS=detectOS();
	var Browser=detectBrowser();
	if((OS == 'Windows') && (Browser == 'IE')) {
		window.open(pagina,"jag","fullscreen=yes,scrollbars=no,status=no")
	} else {
		flvFPW1(pagina,'jag','width=100%,height=100%,left=0,top=0',1,1,1);
	}
}

function flvFPW1(){
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}

// switch to flash code ends

// alpha slide show begins

Object.prototype.addEvent = function(evtType, func) {
   if (this.addEventListener) {
      this.addEventListener(evtType, func, true);
   } else if (this.attachEvent) { 
      this.attachEvent('on' + evtType, func);
   } else { 
      this['on' + evtType] = func;
   }
}

function SlideShow(slideel, faddingSpeed, stopTime, stopOnMouseOver) {  
        var mouseIsOver = false;
        
        this.next = function() {
                this.current.fadeOut();
                this.current = this.current.nextSlide;
                this.current.fadeIn();
        }
        
        function createSlides() {
                var imgs = slideel.getElementsByTagName('img');
                var slides = [];
                
                for (var i = 0; i < imgs.length; i++) {  
                        slides[i] = new SlideShowImage(imgs[i], self);
                }
                
                for (var i = 0; i < slides.length; i++) {
                        if (i == slides.length - 1)
                                slides[i].nextSlide = slides[0];
                        else
                                slides[i].nextSlide = slides[i + 1];
                }
                
                self.current =  slides[0];
                slides[0].fadeIn();
                
                function SlideShowImage(img, slideShow) {
                        img.style.opacity = '0';
        
                        this.fadeIn = function() {
                                var i = 0;
                                while (++i <= 40) {
                                        window.setTimeout(function() {
                                                img.style.opacity = parseFloat(img.style.opacity) + 0.025;
                                                img.style.filter  = "alpha(opacity=" + (img.style.opacity * 100) + ")";
                                        }, i * faddingSpeed);
                                }
                                
                                window.setTimeout(function() {
                                        slideShow.next();
                                }, 40 * faddingSpeed + stopTime);
                        }
        
                        this.fadeOut = function() {
                                var i = 0;
                                while (++i <= 40) {
                                        window.setTimeout(function() {
                                                img.style.opacity = parseFloat(img.style.opacity) - 0.025;
                                                img.style.filter  = "alpha(opacity=" + (img.style.opacity * 100) + ")";
                                        }, i * faddingSpeed);
                                }
                        }
                }
        }
        
        var self = this;
        createSlides(slideel);
}

// alpha slide show ends