woodworkersFixPictures =
{
	init:function()
	{
		var imgVars = null;
		var tempImg = null;
		var	className = null;
		var browserVersion = '';
		var msg		= '';
		orgW = orgH = dspW = dspH = 0;
		ratioDiff = 0;
		
		browserVersion = GRCGeneral.browserVersion();
		if ((browserVersion != 'IE6') &&
			(browserVersion != 'IE5') &&
			(browserVersion != 'firefox') &&
			(browserVersion != 'IE4'))
		{
			return;
		}
		imgVars = document.getElementsByTagName('img');
		tempImg = new Image();
		for (i = 0; i < imgVars.length; i++)
		{
			tempImg.src = imgVars[i].src;
			className = DOMhelp.cssjs('get',imgVars[i],'');
//			msg = msg + className + '-' + tempImg.src + '\n';
//			msg = msg + (className.indexOf("wide") > -1) + '\n';
			orgW = tempImg.width;
			orgH = tempImg.height;
			dspW = imgVars[i].width;
			dspH = imgVars[i].height;
			ratioDiff = Math.abs((dspW / orgW) - (dspH / orgH));
			if (ratioDiff > 0.01)
			{
				if (className.indexOf("wide") > -1)
				{
					imgVars[i].height = Math.round(dspH * orgW / dspW);
				}
				else if (className.indexOf("long") > -1)
				{
					imgVars[i].width = Math.round(dspW * orgH / dspH);
				}
				else if (className.indexOf("small") > -1)
				{
					imgVars[i].height = Math.round(dspH * orgW / dspW);
				}
				else if (className.indexOf("logo") > -1)
				{
					imgVars[i].width = Math.round(dspW * orgH / dspH);
				}
//				if (DOMhelp.cssjs('check',imgVars[i],'wide'))
//				{
//					imgVars[i].height = Math.round(dspH * orgW / dspW);
//				}
//				if (DOMhelp.cssjs('check',imgVars[i],'bigwide'))
//				{
//					imgVars[i].height = Math.round(dspH * orgW / dspW);
//				}
//				else if (DOMhelp.cssjs('check',imgVars[i],'long'))
//				{
//					imgVars[i].width = Math.round(dspW * orgH / dspH);
//				}
				else if (DOMhelp.cssjs('check',imgVars[i],'column'))
				{
					imgVars[i].width = Math.round(dspW * orgH / dspH);
				}
//				else if (DOMhelp.cssjs('check',imgVars[i],'small'))
//				{
//					imgVars[i].height = Math.round(dspH * orgW / dspW);
//				}
				else
				{
				}
			}
		}	//	end for
//		alert(msg);
	}
}
DOMhelp.addEvent(window,'load',woodworkersFixPictures.init,false);
