// setup path to ajax php page
var ajax_url = "/ajax.php";
var resize_this = 0;

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 finishedLoading()
{

}

function resize()
{
    if (resize_this) {

        var wheight = getWindowHeight();
        var resizeme = $('resizeme');
        var content  = $('content');
        var pc  = $('product_content');

        if (resizeme) {
            var new_height = wheight-115;
            if (pc) {
                //pc.style.height = new_height + 'px';
            }
        }
    }
}


function getData(r)
{
    try {
        eval("var result = "+r.responseText);
    } catch(exception) {
        alert(exception);
        alert(r.responseText);
        return false;
    }
    return result;
}

function aeProductSwapImage(img_url)
{

    // get main image
    var main_image = $('main_image');

    if (main_image) {
        main_image.src = img_url;
    }
}


// add onload events
Event.observe(window, 'load', function() {finishedLoading();}, false);

// add resize event
Event.observe(window, 'resize', function() { resize(); }, false);

