function showInsidePicture(id)
{
      document.getElementById('insidepicture').src = '/picture_w.php?ID='+id;
}

function showProductInsidePicture(id, maxwidth, maxheight)
{
	var strUrl = '/productpicture_w.php?ID='+id;
	if(maxwidth > 0)
	{
	    strUrl += "&maxwidth=" + maxwidth;
	}
	if(maxheight > 0)
	{
	    strUrl += "&maxheight=" + maxheight;
	}
    document.getElementById('product-insidepicture').src = strUrl;
}

function showPicture(content, width, height)
{
	var popup = window.open(content, 'popup', 'location=no,menubar=no,status=no,titlebar=no,toolbar=no,width='+width+',height='+height+'');
	popup.focus();
}
var OS,browser,version,total,thestring;		

function doOnLoad()
{
	resizeWindow();
}

function checkIt(string)
    {
	var detect = navigator.userAgent.toLowerCase();
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
    } 	
    function iframeBackground()
    {
	var detect = navigator.userAgent.toLowerCase();
	if (checkIt('konqueror'))
	{
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser = "Safari"
	else if (checkIt('omniweb')) browser = "OmniWeb"
	else if (checkIt('opera')) browser = "Opera"
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab"
	else if (checkIt('msie')) browser = "Internet Explorer"
	else if (!checkIt('compatible'))
        {
		browser = "Netscape Navigator"
		version = detect.charAt(8);
        }
	else browser = "An unknown browser";
	if (!version)version = detect.charAt(place + thestring.length);

	if(!((browser == "Netscape Navigator" && version >= 5) || (browser == "Internet Explorer" && parseInt(version) > 5)))
	{
	    frames['iframe'].document.body.style.background = '#051302';
	}
    }


    function stopFrameScroll()
    {
        loop = false;
	clearTimeout(scrolltimer);
    }

    function getBodySize()
    {
        var myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' )
        {
            //Non-IE
            myHeight = window.innerHeight;
        }
        else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
        {
            //IE 6+ in 'standards compliant mode'
            myHeight = document.documentElement.clientHeight;
        }
        else if(document.body && (document.body.clientWidth || document.body.clientHeight))
        {
            //IE 4 compatible
            myHeight = document.body.clientHeight;
        }
        return myHeight;
    }

    function resizeWindow()
    {

        if(document.getElementById)
        {
            var middle = document.getElementById('middle-container');
            var leftmenu = document.getElementById('leftmenu-container');
            var contact = document.getElementById('contact-container');
        }
        else if(document.layers)
        {
            var middle = document.layers['middle-container'];
            var leftmenu = document.layers['leftmenu-container'];
            var contact = document.layers['contact-container'];
        }
        else if(document.all)
        {
            var middle = document.all['middle-container'];
            var leftmenu = document.all['leftmenu-container'];
            var contact = document.all['contact-container'];
        }
	
	if(document.body.scrollHeight)
	{
	    var middle_height = middle.scrollHeight;
		var leftmenu_height = leftmenu.scrollHeight;
		var contact_height = contact.scrollHeight;
	}
	else if(document.body.offsetHeight)
	{
	    var middle_height = middle.offsetHeight;
		var leftmenu_height = leftmenu.offsetHeight;
		var contact_height = contact.offsetHeight;
	}

	var stripe_height = 3;

	var new_contactheight = middle_height - leftmenu_height - stripe_height;

	if(new_contactheight > contact_height)
	{
	    contact.style.height = new_contactheight + 'px';
	}
}

