﻿function getBG() {
    var winW, winH;
    if (parseInt(navigator.appVersion)>3) {
        winW = screen.width;
        winH = screen.height;
    }
    else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled()) 
    {
        var jToolkit = java.awt.Toolkit.getDefaultToolkit();
        var jScreenSize = jToolkit.getScreenSize();
        winW = jScreenSize.width;
        winH = jScreenSize.height;
    }
    
    if (winW <= 1024)
    {
        return '1024x768.jpg';
    }
    else if (winW <= 1152)
    {
        return '1152x864.jpg';
    }
    else if (winW <= 1280)
    {
        if (winH <= 800)
        {
            return '1280x800.jpg';
        }
        else
        {
            return '1280x1024.jpg';
        }
    }
    else
    {
        return '1600x1200.jpg';
    }
};

function getHeight()
{
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape" || navigator.appName=="Opera") {
            winH = window.innerHeight;
        }
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            winH = document.body.offsetHeight;
        }
    }
    
    return winH;
}

function getWidth()
{
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape" || navigator.appName=="Opera") {
            winW = window.innerWidth;
        }
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            winW = document.body.offsetWidth;
        }
    }
    
    return winW;
}

function setOfHeight(obj)
{
    obj.style.height=(getHeight() > 680) ? (680-100) : (getHeight() - 100);
}

function setHeaderXY() {    
    obj=document.getElementById("KareParent");
    obj1=document.getElementById("_Head");
    var px = (typeof obj1.style.top == "string") ? "px" : 0;
    if (getHeight() > 686)
        obj1.style.top = (getHeight() / 2 - 711 / 2) + px;
    else
        obj1.style.top = 0 + px;

    px = (typeof obj1.style.left == "string") ? "px" : 0;
    obj1.style.left = obj.offsetLeft + px;
    
}

function setFooterXY() {
    if (getHeight() > 682)
        document.getElementById("Kare").style.height='682px';
    else
        document.getElementById("Kare").style.height=getHeight() + 'px';
}
        
function findPosX(obj)
{
    var curleft = 0;
    if(obj.offsetParent)
    {
        while(1) 
        {
            curleft += obj.offsetLeft;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
    }
    else if(obj.x)
    {
        curleft += obj.x;
    }
    return curleft;
}

function findPosY(obj)
{
    var curtop = 0;
    if(obj.offsetParent)
    {
        while(1)
        {
            curtop += obj.offsetTop;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
    }
    else if(obj.y)
    {
        curtop += obj.y;
    }
    return curtop;
}

function MenuRollOver(obj, ek) {
    obj.src="Image/"+obj.id+ek+".jpg";
}

function BedenTablosu(s)
{
    var obj = document.getElementById('SizeSet');
    obj.style.top = getHeight() / 2 - 200;
    obj.style.left = getWidth() / 2 - 200;
    obj.style.display = '';
    window.frames["fSize"].location.href='sizeset.aspx?s='+s;
    //window.open('sizeset.aspx?s='+s,'sizeset','scrollbars=auto,height=300,width=400');
}