
function elsomenucsere() { 

    $('#overlay').animate({"opacity": 0}, 0, function() { 
        $("#overlay").hide(); 
        $("#overlay").css("display","block");
    });    
                          
    var newurl = 'http://intranet.freeway-entertainment.com/';
    var h1 = $(window).height() - 60;
    var w1 = $(window).width() - 60;
    $("#iframe0").css("height", h1);
    $("#iframe0").css("width", w1);    
    $("#iframe0").attr("src", newurl);  
    
    $('#overlay').animate({"opacity": 1}, 800, function() { 
        $("#overlay").show(); 
    });    
    
}

function masodikmenucsere() { 
    
    $('#overlay2').animate({"opacity": 0}, 0, function() { 
        $("#overlay2").hide(); 
        $("#overlay2").css("display","block");
    });    
    
    var newurl = 'http://www.nftc.co.uk/login/';
    var h1 = $(window).height() - 60;
    var w1 = $(window).width() - 60;
    $("#iframe1").css("height", h1);
    $("#iframe1").css("width", w1);
    $("#iframe1").attr("src", newurl);  
    //window.frames["iframe1"].location.reload();
    
    $('#overlay2').animate({"opacity": 1}, 800, function() { 
        $("#overlay2").show(); 
    });    
    
}

function elsomenueltuntet() { 

    $('#overlay').animate({"opacity": 0}, 800, function() { 
        $("#overlay").hide(); 
    });        
    
}
function harmadikmenueltuntet() { 

    $('#overlay3_content').animate({"opacity": 0}, 800, function() { 
        $("#overlay3_content").remove(); 
    });        
    
}


function masodikmenueltuntet() { 

    $('#overlay2').animate({"opacity": 0}, 800, function() { 
        $("#overlay2").hide(); 
    });        
    
}


function loadpage(target) { 
    //$.prettyLoader.show();
    $('#content_box').animate({opacity: 1,top: 50}, 800);
    $('#content_close').animate({opacity: 0}, effekt_ido);
    $('#content_fader').animate({opacity: 0}, effekt_ido, function() { 
    $('#actual_content').load('./'+target+' #actual_content', function() {
          var tartalma =  $("#actual_content").find("#actual_content").html();
          $("#fotartalom").html(tartalma);
          var magasss = $(window).height() - 290;
          $('#pane3').css("height",magasss+"px");
          var pane = $('#pane3');
          pane.jScrollPane({verticalDragMinHeight: 54, verticalDragMaxHeight: 54, reinitialiseOnImageLoad: true });
          var api = pane.data('jsp');
          api.scrollTo(0,0);
            $('#content_close').animate({opacity: 1}, effekt_ido);
            $('#content_fader').animate({opacity: 1}, effekt_ido, function() { 
                //$.prettyLoader.hide();
            });
        });     
    });
}

function loadsinglepage(target, elem){
    $('#submenu_container').animate({opacity: 0}, effekt_ido, function() {
        $('#submenu_bar').animate({bottom: -20}, effekt_ido);
    });
    $('#content_box').animate({opacity: 1,top: 50}, 800);
    $('#content_close').animate({opacity: 0}, effekt_ido);
    $('#content_fader').animate({opacity: 0}, effekt_ido, function() {
        $('#actual_content').load('./'+target+' #actual_content', function() {
            var tartalma =  $("#actual_content").find("#actual_content").html();
            $("#fotartalom").html(tartalma);
            var magasss = $(window).height() - 250;
            $('#pane3').css("height",magasss+"px");
            var pane = $('#pane3');
            pane.jScrollPane({verticalDragMinHeight: 54, verticalDragMaxHeight: 54, reinitialiseOnImageLoad: true });
            var api = pane.data('jsp');
            api.scrollTo(0,0);
            $('#content_close').animate({opacity: 1}, effekt_ido);
            $('#content_fader').animate({opacity: 1}, effekt_ido, function() {
                //$.prettyLoader.hide();
            });
        });    
    });
}

function closePane() {
            
    //$.prettyLoader.show();


    $(".menugombok").removeClass("active");
    
    $('#content_scroller').animate({
            opacity: 0
        }, effekt_ido, function() {
        });
    $('#content_close').animate({
            opacity: 0
        }, effekt_ido, function() {

        });
    $('#content_fader').animate({
            opacity: 0
        }, effekt_ido, function() {            
            $('#content_box').animate({
                    opacity: 0,
                    top: 1500
                }, 800, function() {            
                    $('#submenu_container').animate({
                        opacity: 0
                    }, 200, function() {            
                        $('#submenu_bar').animate({ bottom: -20 }, 200);
                    });
                });
        });
}

function openWin(id)
{

  var left = (screen.width/2)-(790/2);
  var top = (screen.height/2)-(480/2);
  var targetWin;

//anims
 if (id<9) {
   $(document).ready(function(){
           document.getElementById('lapcim').innerHTML = 'About us';
           document.getElementById('alcim').innerHTML = 'About us';
           loadsinglepage('./menu/about-us', 'logo');

    });
  } else

//plakatok
  if (id==9) {
    targetWin = window.open ("http://www.tmf-group.com", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=790, height=480, top='+top+', left='+left);
  } else 
  if (id==10) {
   targetWin = window.open ("http://www.coe.int/t/dg4/eurimages/reimbursement/collectionaccountmanagement_EN.asp", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=790, height=480, top='+top+', left='+left);
  
    } else 

  if (id==11) {
 targetWin = window.open ("http://www.revcheck.net", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=790, height=480, top='+top+', left='+left);
  } else 

  if (id==12) {
//    targetWin = window.open ("http://www.tmf-group.com", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=790, height=480, top='+top+', left='+left);
  } else 
  if (id==13) {
//    targetWin = window.open ("http://www.tmf-group.com", "title", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=790, height=480, top='+top+', left='+left);
  } else 

//doboz felso
  if (id==14) {
       $(document).ready(function(){
                elsomenucsere();
        });
  } else
//doboz also 
  if (id==15) {
   $(document).ready(function(){
               masodikmenucsere();

    });
  } else 


//jobb szelso nagy plakat
  if (id==16) {
  } else 



//borond
  if (id==17) {
    //document.getElementById('lapcim').innerHTML = 'Market Attendance';
    //document.getElementById('alcim').innerHTML = 'Market Attendance';
    //loadpage('./index.php?node=static&id=34');
  }


}

function resize() {
    var navWidth, navHeight;
    if (self.innerWidth != undefined) {
        navWidth = self.innerWidth;
        navHeight = self.innerHeight;
    } 
    else {
    navWidth = document.documentElement.clientWidth;
    navHeight = document.documentElement.clientHeight;
    }
        var p = $('#menu_bar');
        var offset = p.offset();
}

function testres() {
    if (self.innerWidth != undefined) {
        navWidth = self.innerWidth;
        navHeight = self.innerHeight;
    } 
    else {
        navWidth = document.documentElement.clientWidth;
        navHeight = document.documentElement.clientHeight;
    }
    if (navHeight <= 625) {
        document.getElementById("menu_bar").style.marginTop = "250px";
    }
}


function windowHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return myHeight; 
}
function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
return myWidth
 // window.alert( 'Width = ' + myWidth );
 // window.alert( 'Height = ' + myHeight );
}

function xresize(val) {
//     var flashMovie=getFlashMovieObject("freeway");

//     flashMovie.SetVariable("myVarX", 1024);//@@window.innerWidth);

//    if(window.freeway)
//    if(document.freeway) {

var wiiidth = alertSize();

 document.freeway.SetVariable("myVarX", wiiidth );
 window.document["freeway"].SetVariable("myVarX", wiiidth );
//}

}

