﻿function getWindowWidth() {
    var windowWidth = 0;
    if (typeof(window.innerWidth) == 'number') {
        windowWidth = window.innerWidth;
    } else {
        if (document.documentElement && document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        } else {
        if (document.body && document.body.clientWidth) {
            windowWidth = document.body.clientWidth;
        }
      }
    }
    return windowWidth;
}

function getWindowHeight() {
    var windowHeight = 0;
    if (typeof(window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    } else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        } else {
        if (document.body && document.body.clientHeight) {
            windowHeight = document.body.clientHeight;
        }
      }
    }
    return windowHeight;
}

function getWidthValue(){
    var winFlashWidth = getWindowWidth();
    if( winFlashWidth <= 990 ){
        winFlashWidth = 990;
    } else{
        winFlashWidth = '100%';
    }
    return winFlashWidth;
  }

function getHeightValue(){
        var winHeight = 620; 
        var winWidth = 0;
        //var winRate = 0;        
        winWidth = getWindowWidth(); 
        
        if( winWidth <= 990 ){
            winWidth = 990;
        } else{
            winHeight = getWindowHeight();
        }
        //winRate = winWidth/990;
        //var winHeight = parseInt(winRate*620);
        
        if (typeof(window.innerWidth) == 'number') {
            return winHeight;
        } else {
            return winHeight + 2;
        }
  }
  
 $(document).ready(function(){
    if($().flash.hasFlash.playerVersion().split(',')[0] < 8){
        window.location = "index.aspx";
    }
 
    var yukseklik = getHeightValue()+240;
    var genislik = getWidthValue();
    //alert(yukseklik)
    //var yukseklik = $(window).height()+240;
    $('#home').flash({
        src: '_swf/Rotavirus.swf',
        width: '100%',
        height: yukseklik,
        id : "rotavirus",
        name : "rotavirusName"
    });
    
    $(window).bind("resize",function(){
       //$("#rotavirus").attr("width",getWidthValue())
       $("#rotavirus").attr("height",getHeightValue()+240)
    })
    
})


function abcz()
{
    var rota = document.getElementById("rotavirus");
    rota.openYasal();
}
