/*==============================================
 insert swf
==============================================*/
$.fn.insertSWF = function(opt) {
  var cfg = $.extend({
    wmode             : 'transparent',
    allowScriptAccess : 'always',
    allowFullScreen   : 'always',
    menu              : 'false',
    base              : '.',
    version           : 8,
    addMode           : 'html',
    requireCode       : ''
  }, opt);
  $(this).each(function(){
  	var addMode = cfg.addMode;
	var code    = '';
    if(DetectFlashVer(cfg.version,0,0) && cfg.src && cfg.width && cfg.height) {
      cfg.version = cfg.addMode = cfg.requireCode = null;
      code = AC_FL_RunContent(cfg);
	} else {
      code = cfg.requireCode;
    }
       (addMode == 'html')    ? $(this).html(code)
      :(addMode == 'append')  ? $(this).append(code)
      :(addMode == 'prepend') ? $(this).prepend(code)
      :(addMode == 'after')   ? $(this).after(code)
      :(addMode == 'before')  ? $(this).before(code)
      :(addMode == 'replace') ? $(this).replaceWith(code) : '';
  });
};

/*==============================================
 easily RollOver
==============================================*/
$.fn.imageRollOver = function(){
	var obj = obj || {};
	$(this).each(function(){
		var src  = this.src;
		var osrc = src.replace("_off.","_on.");
		obj[src] = new Image();
		obj[src+"_d"] = new Image();
		obj[src].src = osrc;
		obj[src+"_d"].src = src;
		$(this).hover(function(){
			this.src = obj[src].src;
		},function(){
			this.src = obj[src+"_d"].src;
		})
	})
}

/*==============================================
 IE bgfix
==============================================*/
try{document.execCommand("BackgroundImageCache", false, true);} catch(e){}

