function screenSize() {
      var w, h;
      w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
      h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
      return {w:w, h:h};
}
function initPage() {
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++) {
		if (inputs[i].className.indexOf("bt-") != -1 ) {
			inputs[i].onmouseover = function() {
				this.src = this.src.replace(".gif", "-hover.gif");
			}
			inputs[i].onmouseout = function()			{
					this.src = this.src.replace("-hover.gif", ".gif");
			}
		}
	}
	var _image_holder = document.getElementById('cropWrap');
	var _image_width = _image_holder.getElementsByTagName('img')[0].offsetWidth;
	if(_image_holder){
		_cont = document.getElementById('content');
		_main = document.getElementById('main');
		_footer = document.getElementById('footer');

		if (_image_width >800) {
			_cont.style.width = ((_image_width - 800) + 1212) + "px";
			_footer.style.width = ((_image_width - 800) + 1212) + "px";
		}

		if(_cont) {
			if(_footer) {
				if(1212>screenSize().w) {
//					_cont.style.width = '1212px';
//					_footer.style.width = '1212px';
				}
			}
		}
//		if(_main) {
//					if((_image_width +2)>1212) {
//					_main.style.width = (_image_width +2 ) + 'px';
//					}else {                      
//					_main.style.width = '805px';
//					}
//		}
	}
}

if (window.addEventListener)
window.addEventListener("load", initPage, false);
else if (window.attachEvent)
window.attachEvent("onload", initPage);
