# File lib/fusion_charts_helper.rb, line 118
  def render_chart_html(chart_swf,str_url,str_data,chart_id,chart_width,chart_height,debug_mode=false,register_with_js=false)
    chart_width=chart_width.to_s
    chart_height=chart_height.to_s
    options={}
    
    debug_mode_num= debug_mode ? "1" : "0"
    register_with_js_num= register_with_js ? "1" : "0" 
      w_mode = ""
      color = ""
      scale_mode = ""
      lang = ""
      
      
    if !options.nil? && options.is_a?(Hash)
      w_mode = options[:w_mode].nil? ? "" : options[:w_mode]
      color = options[:color].nil? ? "" : options[:color]
      scale_mode = options[:scale_mode].nil? ? "" : options[:scale_mode]
      lang = options[:lang].nil? ? "" : options[:lang]
     
    end
    
    str_flash_vars=""
    if str_data.empty?
      str_flash_vars="chartWidth="+chart_width+"&chartHeight="+chart_height+"&debugmode="+debug_mode_num+"&registerWithJS="+register_with_js_num+"&DOMId="+chart_id+"&dataURL="+str_url
      logger.info("The method used is setDataURL.The URL is " + str_url)
    else
      str_flash_vars="chartWidth="+chart_width+"&chartHeight="+chart_height+"&debugmode="+debug_mode_num+"&registerWithJS="+register_with_js_num+"&DOMId="+chart_id+"&dataXML="+str_data
      logger.info("The method used is setDataXML.The XML is " + str_data)
    end
    
    str_flash_vars+="&scaleMode="+scale_mode+"&lang="+lang
    
    concat("\t\t<!-- START Code Block for Chart "+chart_id+" -->\n\t\t")
    
    object_attributes={:classid=>"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"}
    object_attributes=object_attributes.merge(:codebase=>"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0")
    object_attributes=object_attributes.merge(:width=>chart_width)
    object_attributes=object_attributes.merge(:height=>chart_height)
    object_attributes=object_attributes.merge(:id=>chart_id)
    
    param_attributes1={:name=>"allowscriptaccess",:value=>"always"}
    param_tag1=content_tag("param","",param_attributes1)
    
    param_attributes2={:name=>"movie",:value=>chart_swf}
    param_tag2=content_tag("param","",param_attributes2)
    
    param_attributes3={:name=>"FlashVars",:value=>str_flash_vars}
    param_tag3=content_tag("param","",param_attributes3)
    
    param_attributes4={:name=>"quality",:value=>"high"}
    param_tag4=content_tag("param","",param_attributes4)
    
    # w_mode, by default is set to be "window"
    w_mode = (w_mode=='transparent' || w_mode=='opaque') ? w_mode : "window"
    
    param_attributes5={:name=>"wmode",:value=>w_mode}
    param_tag5=content_tag("param","",param_attributes5)
    
    param_attributes6={:name=>"bgcolor",:value=>color}
    param_tag6=content_tag("param","",param_attributes6)
    
    embed_attributes={:src=>chart_swf}
    embed_attributes=embed_attributes.merge(:FlashVars=>str_flash_vars)
    embed_attributes=embed_attributes.merge(:quality=>"high")
    embed_attributes=embed_attributes.merge(:width=>chart_width)
    embed_attributes=embed_attributes.merge(:height=>chart_height).merge(:name=>chart_id)
    embed_attributes=embed_attributes.merge(:allowScriptAccess=>"always")
    embed_attributes=embed_attributes.merge(:type=>"application/x-shockwave-flash")
    embed_attributes=embed_attributes.merge(:pluginspage=>"http://www.macromedia.com/go/getflashplayer")
    embed_attributes=embed_attributes.merge(:wmode=>w_mode)
    embed_attributes=embed_attributes.merge(:bgColor=>color)
    
    embed_tag=content_tag("embed","",embed_attributes)
    
    concat(content_tag("object","\n\t\t\t\t"+param_tag1+"\n\t\t\t\t"+param_tag2+"\n\t\t\t\t"+param_tag3+"\n\t\t\t\t"+param_tag4+"\n\t\t\t\t"+param_tag5+"\n\t\t\t\t"+param_tag6+"\n\t\t\t\t"+embed_tag+"\n\t\t",object_attributes))
    concat("\n\t\t<!-- END Code Block for Chart "+chart_id+" -->\n")
  end