	var url = "http://www.fsis.usda.gov/alex/test/fswg/";

	function f_call(nw, nh)
	{
		// selecting the right resolution image
		var image = "FSWG-Widget2b-188.jpg";

		if (nw<158) 
		{
			image="FSWG-Widget2b-148.jpg";
		}	
		else if ((nw>158) && (nw<178))
		{
			image="FSWG-Widget2b-168.jpg";
		}
		else if ((nw>178) && (nw<198))
		{
			image="FSWG-Widget2b-188.jpg";
		}	
		else if ((nw>198) && (nw<218))
		{
			image="FSWG-Widget2b-208.jpg";
		}	
		else if ((nw>218) && (nw<238))
		{
			image="FSWG-Widget2b-228.jpg";
		}
		else if (nw>238)
		{
			image="FSWG-Widget2b-248.jpg";
		}
		
		//DEFAULT IMAGE PARAMETERS
		var w = 188;
		var h = 253;

		//DEFAULT MAP AREA PROPORTIONS		
		i1_x1 = 33/188; 	i1_y1 = 78/253;
		i1_x2 = 153/188; 	i1_y2 = 111/253;

		i2_x1 = 33/188; 	i2_y1 = 114/253;
		i2_x2 = 153/188;	i2_y2 = 146/253;

		i3_x1 = 33/188;		i3_y1 = 149/253;
		i3_x2 = 151/188;	i3_y2 = 183/253;


		i4_x1 = 63/188;		i4_y1 = 202/253;
		i4_x2 = 92/188;		i4_y2 = 225/253;

		i5_x1 = 96/188;		i5_y1 = 202/253;
		i5_x2 = 122/188;	i5_y2 = 227/253;

		i6_x1 = 11/188;		i6_y1 = 230/253;
		i6_x2 = 174/188;	i6_y2 = 247/253;

		n_i1_x1 = Math.round(i1_x1*nw); 	n_i1_y1 = Math.round(i1_y1*nh);
		n_i1_x2 = Math.round(i1_x2*nw); 	n_i1_y2 = Math.round(i1_y2*nh);

		n_i2_x1 = Math.round(i2_x1*nw); 	n_i2_y1 = Math.round(i2_y1*nh);
		n_i2_x2 = Math.round(i2_x2*nw);		n_i2_y2 = Math.round(i2_y2*nh);

		n_i3_x1 = Math.round(i3_x1*nw); 	n_i3_y1 = Math.round(i3_y1*nh);
		n_i3_x2 = Math.round(i3_x2*nw);		n_i3_y2 = Math.round(i3_y2*nh);

		n_i4_x1 = Math.round(i4_x1*nw); 	n_i4_y1 = Math.round(i4_y1*nh);
		n_i4_x2 = Math.round(i4_x2*nw);		n_i4_y2 = Math.round(i4_y2*nh);

		n_i5_x1 = Math.round(i5_x1*nw); 	n_i5_y1 = Math.round(i5_y1*nh);
		n_i5_x2 = Math.round(i5_x2*nw);		n_i5_y2 = Math.round(i5_y2*nh);

		n_i6_x1 = Math.round(i6_x1*nw); 	n_i6_y1 = Math.round(i6_y1*nh);
		n_i6_x2 = Math.round(i6_x2*nw);		n_i6_y2 = Math.round(i6_y2*nh);

		var snip = '';

		snip = snip + "<img id='fswg' src='" + url + image + "' usemap='#Image-Maps_fswg' border='0' width='" + nw + "' height='"+nh+"' alt='FSWG Widget Image'/>";
		snip = snip + "<map id='_Image-Maps_1' name='Image-Maps_fswg'>";

		snip = snip + "<area shape='rect' coords='" + n_i1_x1 +","+n_i1_y1+","+n_i1_x2+","+n_i1_y2+"' href='#' alt='Learn' title='Learn'/>";
		snip = snip + "<area shape='rect' coords='" + n_i2_x1 +","+n_i2_y1+","+n_i2_x2+","+n_i2_y2+"' href='#' alt='Participate' title='Participate'/>";
		snip = snip + "<area shape='rect' coords='" + n_i3_x1 +","+n_i3_y1+","+n_i3_x2+","+n_i3_y2+"' href='#' alt='Stay Informed' title='Stay Informed'/>";
		snip = snip + "<area shape='rect' coords='" + n_i4_x1 +","+n_i4_y1+","+n_i4_x2+","+n_i4_y2+"' href='http://www.usda.gov/' alt='USDA' title='USDA'/>";
		snip = snip + "<area shape='rect' coords='" + n_i5_x1 +","+n_i5_y1+","+n_i5_x2+","+n_i5_y2+"' href='http://www.fda.gov/' alt='FDA' title='FDA'/>";
		snip = snip + "<area shape='rect' coords='" + n_i6_x1 +","+n_i6_y1+","+n_i6_x2+","+n_i6_y2+"' href='#' alt='FSWG' title='FSWG'/>";

		document.write(snip);
	}
	
	function f_recalc(nw)
	{
		//DEFAULT IMAGE PARAMETERS
		// This is ==> widht/height
		if (nw=="") nw=188;
			
		var r = 253/188; 
		
		var nh = r*nw;
		f_call(nw, nh);
	}

	f_recalc(gadget_width);	
