﻿
//globals
var wsUrl = "http://www.bmminiparts.com/Service.asmx";

var windowWidth = 0
var windowHeight = 0;

var aspectRatios = {};

//get window size

function GetWindowSize()
{
	if(typeof(window.innerWidth) == 'number')
	{
		//Non-IE
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		//IE 6+ in 'standards compliant mode'
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		//IE 4 compatible
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
}

//save aspect ratio

function SaveAspectRatio(ImageToSave)
{
	image = document.getElementById(ImageToSave);
	
	aspectRatios[ImageToSave] = image.height / image.width;
}
