IE = (document.all && document.all.item && !(navigator.userAgent.indexOf("Opera")>-1)) ? 1: 0;
if (IE) {var flashObject = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.5");}
	else {var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;}



function maingetpos_r () {
	if (IE) {s_w=screen.width;i_w=document.body.clientWidth;} else {s_w=screen.width;i_w=innerWidth-19;}
	switch (true) {

		case (s_w <= 1024)		: {sx=45;width=650;break;}
		case (s_w > 1024 && s_w <= 1280): {sx=57;width=810;break;}
		case (s_w > 1280 && s_w <= 1400): {sx=62;width=886;break;}
		case (s_w > 1400 && s_w <= 1600): {sx=71;width=1014;break;}
		case (s_w > 1600 && s_w <= 1856): {sx=82;width=1176;break;}
		case (s_w > 1856 && s_w <= 1920): {sx=85;width=1217;break;}
		case (s_w > 1920)		: {sx=91;width=1298;break;}
	
	}

	if (i_w<=width) {start_x=0;wdth=width-start_x-sx;x=0;} else {start_x=Math.round(i_w/2-width/2);wdth=i_w-start_x-sx;x=1;}

	document.getElementById("wmain").style.left=start_x;
if (plugin || flashObject) {
	document.getElementById("wback").style.left=start_x + sx;

	if (IE)	{
		document.getElementById("wback").style.width=wdth;
		}
	else {
		document.getElementById("wback").style.width=wdth+4*x;
		}
}

}

function maingetpos(w_t,w_st) {
	if (IE) {s_w=screen.width;i_w=document.body.clientWidth;} else {s_w=screen.width;i_w=innerWidth-20;}

	switch (true) {
		case (s_w <= 1024)		: {sx=45;start_y=-338;width=650;height=450;banheight=60;menu_w=171;width_b=1050;h_w=353;sh_w=295;h_h=38;sh_h=83;break;}
		case (s_w > 1024 && s_w <= 1280): {sx=57;start_y=-424;width=810;height=561;banheight=75;menu_w=214;width_b=1313;h_w=441;sh_w=369;h_h=48;sh_h=104;break;}
		case (s_w > 1280 && s_w <= 1400): {sx=62;start_y=-464;width=886;height=613;banheight=82;menu_w=234;width_b=1436;h_w=484;sh_w=400;h_h=52;sh_h=114;break;}
		case (s_w > 1400 && s_w <= 1600): {sx=71;start_y=-529;width=1014;height=702;banheight=94;menu_w=267;width_b=1641;h_w=550;sh_w=461;h_h=59;sh_h=130;break;}
		case (s_w > 1600 && s_w <= 1856): {sx=82;start_y=-614;width=1176;height=814;banheight=109;menu_w=310;width_b=1903;h_w=640;sh_w=536;h_h=69;sh_h=151;break;}
		case (s_w > 1856 && s_w <= 1920): {sx=85;start_y=-635;width=1217;height=843;banheight=113;menu_w=320;width_b=1969;h_w=661;sh_w=553;h_h=71;sh_h=156;break;}
		case (s_w > 1920)		: {sx=91;start_y=-677;width=1298;height=899;banheight=120;menu_w=342;width_b=2100;h_w=706;sh_w=590;h_h=76;sh_h=166;}
	}

if (plugin || flashObject) {
	if (w_t) {
		document.getElementById("div_Head_Title").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+h_w+'" height="'+h_h+'"><param name="movie" value="images/'+w_t+'.swf"><param name="wmode" value="transparent"><embed src="images/'+w_t+'.swf" wmode="transparent" width="'+h_w+'" height="'+h_h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
		document.getElementById("div_Head_Subtitle").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+sh_w+'" height="'+sh_h+'"><param name="movie" value="images/'+w_st+'.swf"><param name="wmode" value="transparent"><embed src="images/'+w_st+'.swf" wmode="transparent" width="'+sh_w+'" height="'+sh_h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
		}
	else {
		menu_h=Math.round(menu_w/3.8);
		document.getElementById("banner").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+banheight+'"><param name="movie" value="http://www.chempack.ru/images/empty.swf"><param name="wmode" value="transparent"><embed src="http://www.chempack.ru/images/empty.swf" wmode="transparent" width="'+width+'" height="'+banheight+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';

		document.getElementById("homemain").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'"><param name="movie" value="images/index.swf"><param name="wmode" value="transparent"><embed src="images/index.swf" wmode="transparent" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
		document.getElementById("homemenu").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+menu_w+'" height="'+menu_h+'"><param name="movie" value="images/menu_home_s.swf"><embed src="images/menu_home_s.swf" width="'+menu_w+'" height="'+menu_h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
		document.getElementById("homemenu").style.visibility='visible';
		document.getElementById("wback").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width_b+'" height="'+width_b+'"><param name="movie" value="images/circle_back.swf"><param name="wmode" value="transparent"><embed src="images/circle_back.swf" wmode="transparent" width="'+width_b+'" height="'+width_b+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
		}

	}
else  {
	if (w_t) {
		document.getElementById("div_Head_Title").innerHTML='<img src="images/'+w_t+'.gif" width="'+h_w+'" height="'+h_h+'">';
		document.getElementById("div_Head_Subtitle").innerHTML='<img src="images/'+w_st+'.gif" width="'+sh_w+'" height="'+sh_h+'">';
		}
	else {


		document.getElementById("homemain").innerHTML='<br><br><img src="images/main.jpg" width="'+width+'" height="'+height+'" usemap="#homemap" border=0><map name="homemap"><area shape=rect coords="15,364,144,382" href="http:\/\/www.chempack.ru\/company\/index.html"><area shape=rect coords="15,387,188,404" href="http:\/\/www.chempack.ru\/big-bag\/index.html"><area shape=rect coords="15,409,200,428" href="http:\/\/www.chempack.ru\/chemistry\/index.html"><\/map>';
		document.getElementById("homemenu").style.visibility='visible';
		}
	}

	if (i_w<=width) {start_x=0;wdth=width-start_x-sx;x=0;} else {start_x=Math.round(i_w/2-width/2);wdth=i_w-start_x-sx;x=1;}

	document.getElementById("wmain").style.width=width;
	document.getElementById("wmain").style.left=start_x;

if (plugin || flashObject) {
	document.getElementById("wback").style.left=start_x + sx;
	document.getElementById("wback").style.top=start_y;
	
	if (IE)	{
		document.getElementById("wback").style.width=wdth;
		}
	else {
		document.getElementById("wback").style.width=wdth+4*x;
		}

	document.getElementById("wback").style.height=width_b+50;
	document.getElementById("wback").style.visibility='visible';
	document.getElementById("wmain").style.visibility='visible';

	}

}


function get_style () {


	s_w=screen.width;
	switch (true) {

		case (s_w <= 1024)		: {f_s=11;l_h=19;break;}
		case (s_w > 1024 && s_w <= 1280): {f_s=14;l_h=24;break;}
		case (s_w > 1280 && s_w <= 1400): {f_s=15;l_h=26;break;}
		case (s_w > 1400 && s_w <= 1600): {f_s=17;l_h=30;break;}
		case (s_w > 1600 && s_w <= 1856): {f_s=20;l_h=34;break;}
		case (s_w > 1856 && s_w <= 1920): {f_s=21;l_h=36;break;}
		case (s_w > 1920)		: {f_s=22;l_h=38;}
	
	}
	f_s_b=f_s-1; l_h_b=l_h-1;
	document.write('<style type="text\/css">td { font-family: verdana, tahoma, arial, helvetica, sans-serif; COLOR: #000000;font-size:'+f_s+'px;line-height:'+l_h+'px}</style>');
}