	function selectWidgetColor(size, color) {


		document.getElementById('color'+wEdition+(wEdition=='Big'?wColorBig:wColorSmall)).style.border = '1px solid #000000';
	
		if (size != wEdition) {
			document.getElementById('widgetRadio'+size).checked = true;

			if (size == 'Big') {
				document.getElementById('widgetRadioSmall').checked = false;
			} else {
				document.getElementById('widgetRadioBig').checked = false;
			}
			
			wEdition = size;
		} 
		
		if (size == 'Big') {
			wColorBig = color;
			document.getElementById('widgetBig').src = Script_URL+'images/examples/widgetBig'+color+'.png';
		} else {
			wColorSmall = color;
			document.getElementById('widgetSmall').src = Script_URL+'images/examples/widgetSmall'+color+'.png';
		}
		

         
		document.getElementById('color'+size+color).style.border = '2px dotted #FF3333';
                updateWidgetCode();
        }
        function update_widget_pos(pos){
                var m = {lefttop: 'Left Top', leftcenter: 'Left Center', leftbottom: 'Left Bottom',
                         righttop: 'Right Top', rightcenter: 'Right Center', rightbottom: 'Right Bottom',
                         bottomleft: 'Bottom Left', bottomcenter: 'Bottom Center', bottomright: 'Bottom Right' };
                         
                $(".widgetpos .label").text(m[pos]);
                        
                wPos = pos;
                updateWidgetCode();
        }

        function updateWidgetCode(){
            
          
 //var color = (wEdition=='Big' ? wColorBig : wColorSmall);
 var color = "Green";

                $(".widget-preview img").hide();
                if(wPos.match(/^left/)){
                  var w = $(".left-widget"); w.show();
                  if(wPos.match(/top/)) w.css({top: '15px', left:'-9px'});
                  if(wPos.match(/center/)) w.css({top:'48px', left:'-9px'});
                  if(wPos.match(/bottom/)) w.css({top: '80px', left:'-9px'});
                }else if(wPos.match(/^right/)){
                  var w = $(".right-widget"); w.show();
                  if(wPos.match(/top/)) w.css({top: '15px', right:'-9px'});
                  if(wPos.match(/center/)) w.css({top:'48px', right:'-9px'});
                  if(wPos.match(/bottom/)) w.css({top: '80px', right:'-9px'});

                }else{
                  var w = $(".bottom-widget"); w.show();
                  if(wPos.match(/left/)) w.css({left: '20px', bottom:'-9px'});
                  if(wPos.match(/center/)) w.css({left:'114px', bottom:'-9px'});
                  if(wPos.match(/right/)) w.css({left: '200px', bottom:'-9px'});

                }


		document.getElementById('codeinput').value = '<script type="text/javascript" src="'+Script_URL+'js/radarurl_widget.js"><\/script><script type="text/javascript">radarurl_call_radar_widgetv2({edition:"'+wEdition+'"'+(wPos?',location:"'+wPos+'"':'')+'})<\/script><noscript><a href="'+Script_URL+'">'+randkey+'</a></noscript>';
	}
	
	function changeWidget(size) {
		document.getElementById('color'+wEdition+(wEdition=='Big'?wColorBig:wColorSmall)).style.border = '1px solid #000000';
		document.getElementById('color'+size+(size=='Big'?wColorBig:wColorSmall)).style.border = '2px dotted #FF3333';
		wEdition = size;
		
		updateWidgetCode();
	}
