var min_width = 1000;
var min_height = 600;

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 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 forcesize ()
{
	if ( getWindowWidth() < min_width)
		document.getElementById("content").style.width = min_width +"px";
	else
		document.getElementById("content").style.width = "100%";
	
	if ( getWindowHeight() < min_height)
		document.getElementById("content").style.height = min_height + "px";
	else
		document.getElementById("content").style.height = "100%";
}

window.onload = function()
{
	forcesize();
}

window.onresize = function()
{
	forcesize();
}


function open_popup()
{
	show_addthis();
	//window.open( 'http://addthis.com/bookmark.php?url=http%3A%2F%2Fwww.sigasx4.com.br%2F&title=suzuki-sx4&pub=suzuki&v=200','share','height=600,width=500,scrollbars=yes', 0 );
}

function current_height()
{
	return document.getElementById("content").style.height;
}

function set_min_window_height ( value )
{
	min_height = value;
	forcesize();
}


var freezed_scroll;
function freeze_scroll ()
{
	freezed_scroll = {
		x: window.pageXOffset,
		y: window.pageYOffset
	};
}

function unfreeze_scroll()
{
	window.scroll(
		freezed_scroll.x,
		freezed_scroll.y
	);
}