﻿if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";
if (document.all) type="IE";
if (document.layers) type="NN";
if (!document.all && document.getElementById) type="MO";

function setContentHeightIMG() {
	if (type=="IE") main_div_width=document.all['colcont_layouts'].offsetWidth;
	if (type=="NN") main_div_width=document.layer['colcont_layouts'].offsetWidth;
    if (type=="MO" || type=="OP")  main_div_width=document.getElementById('colcont_layouts').offsetWidth;
        
	if (main_div_width==0) main_div_width = 600;
    var new_image_width1 = (main_div_width/3)-20;
	var new_image_width2 = (main_div_width/3)-20;
	var new_image_width3 = (main_div_width/3)-20;
	
    var new_image_height1 = new_image_width1*(original_height1/original_width1) ;
	if (new_image_height1 > MAX_height1)
		{
			new_image_width1 = MAX_height1/original_height1*original_width1;
			new_image_height1=MAX_height1;
		}
    if (new_image_width1 > MAX_width1)
		{
			new_image_height1 = (new_image_height1/new_image_width1)*MAX_width1;
			new_image_width1=MAX_width1;
		}
		
	var new_image_height2 = new_image_width2*(original_height2/original_width2) ;
	if (new_image_height2 > MAX_height2)
		{
			new_image_width2 = MAX_height2/original_height2*original_width2;
			new_image_height2=MAX_height2;
		}
    if (new_image_width2 > MAX_width2)
		{
			new_image_height2 = (new_image_height2/new_image_width2)*MAX_width2;
			new_image_width2=MAX_width2;
		}
		
	var new_image_height3 = new_image_width3*(original_height3/original_width3) ;
	if (new_image_height3 > MAX_height3)
		{
			new_image_width3 = MAX_height3/original_height3*original_width3;
			new_image_height3=MAX_height3;
		}
    if (new_image_width3 > MAX_width3)
		{
			new_image_height3 = (new_image_height3/new_image_width3)*MAX_width3;
			new_image_width3=MAX_width3;
		}
	
		
	if (type=="IE") 
		{
            document.all['colboxleft_layouts'].src = document.all['colboxleft_layouts_large'].src;
            document.all['colboxmiddle_layouts'].src = document.all['colboxmiddle_layouts_large'].src;
            document.all['colboxright_layouts'].src = document.all['colboxright_layouts_large'].src;
            document.all['colboxleft_layouts'].height = new_image_height1;
	        document.all['colboxleft_layouts'].width = new_image_width1;
	        document.all['colboxright_layouts'].height = new_image_height2;
	        document.all['colboxright_layouts'].width = new_image_width2;
			document.all['colboxmiddle_layouts'].height = new_image_height3;
	        document.all['colboxmiddle_layouts'].width = new_image_width3;
		}

	if (type=="NN")
		{
                document.layer['colboxleft_layouts'].src = document.layer['colboxleft_layouts_large'].src;
                document.layer['colboxright_layouts'].src = document.layer['colboxright_layouts_large'].src;
                document.layer['colboxmiddle_layouts'].src = document.layer['colboxmiddle_layouts_large'].src;
                document.layer['colboxleft_layouts'].height = new_image_height1;
                document.layer['colboxleft_layouts'].width = new_image_width1;
                document.layer['colboxright_layouts'].height = new_image_height2;
                document.layer['colboxright_layouts'].width = new_image_width2;
                document.layer['colboxmiddle_layouts'].height = new_image_height3;
                document.layer['colboxmiddle_layouts'].width = new_image_width3;
		}
  	if (type=="MO" || type=="OP")
		{ 
            document.getElementById('colboxleft_layouts').src = document.getElementById('colboxleft_layouts_large').src;
            document.getElementById('colboxright_layouts').src = document.getElementById('colboxright_layouts_large').src;
            document.getElementById('colboxmiddle_layouts').src = document.getElementById('colboxmiddle_layouts_large').src;
            document.getElementById('colboxleft_layouts').height = new_image_height1;
	        document.getElementById('colboxleft_layouts').width = new_image_width1;
	        document.getElementById('colboxright_layouts').height = new_image_height2;
	        document.getElementById('colboxright_layouts').width = new_image_width2;
	        document.getElementById('colboxmiddle_layouts').height = new_image_height3;
	        document.getElementById('colboxmiddle_layouts').width = new_image_width3;
	        
	  	}
}

