var max_h = 0;

function eval_(object){
	if(document.getElementById)return document.getElementById(object);
	if(document.all)return eval('document.all.'+object); return false;
}

function checkHeight() {

	max_h = (window.innerHeight ? window.innerHeight : document.body.clientHeight);

	if (max_h < eval_('footer').offsetTop + eval_('footer').offsetHeight) {
		eval_('subcont2').style.height = (eval_('footer').offsetTop + eval_('footer').offsetHeight) + 'px';
	} else {
		eval_('mainBl').style.position = 'relative';
		eval_('footer').style.position = 'absolute';
		eval_('footer').style.bottom = '0px';
		eval_('footer').style.left = '0px';
	}

	preloadImages();
}

function resize() {

	if (max_h < eval_('footer').offsetTop + eval_('footer').offsetHeight) {
		eval_('subcont2').style.height = (eval_('footer').offsetTop + eval_('footer').offsetHeight) + 'px';
	} else {
		eval_('mainBl').style.position = 'relative';
		eval_('footer').style.position = 'absolute';
		eval_('footer').style.bottom = '0px';	
		eval_('footer').style.left = '0px';		
	}
	
}


function preloadImages() {
if (document.images) {
    imgarray = new Array(5);
    imgarray[0] = new Image();
    imgarray[0].src = "img/m1a.jpg";
    imgarray[1] = new Image();
    imgarray[1].src = "img/m2a.jpg";
    imgarray[2] = new Image();
    imgarray[2].src = "img/m3a.jpg";
    imgarray[3] = new Image();
    imgarray[3].src = "img/m4a.jpg";
    imgarray[4] = new Image();
    imgarray[4].src = "img/m5a.jpg";
  }
}

function selectImage(img) {
    if (document.images) {
      var tmp = img.src;
      img.src = img.lowsrc;
      img.lowsrc = tmp;
    }
}

function show_popup(image, width, height) {
	myRef = window.open(''+image,'mywin','left=20,top=20,width=' + width + ',height=' + height + ',toolbar=1,resizable=0');	
	return(false);
}  

function show_popup_res(image, width, height) {
	myRef = window.open(''+image,'mywin','left=20,top=20,width=' + width + ',height=' + height + ',toolbar=1,resizable=1,scrollbars=1');	
	return(false);
}  

  
