swfobject.embedSWF('swf/icon.swf', 'icon', '1000', '84', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {}); 
swfobject.embedSWF('swf/bcastr.swf', 'flash', '200', '120', '9', 'swf/expressInstall.swf', {xml: 'cycle_image.php'}, {quality: 'high', wmode: 'transparent', menu: false}, {});
swfobject.embedSWF('swf/bcastr.swf', 'flashBanner', '970', '360', '9', 'swf/expressInstall.swf', {xml: 'banner_image.php'}, {quality: 'high', wmode: 'transparent', menu: false}, {});
swfobject.embedSWF('swf/pbanner.swf', 'pbanner', '1000', '215', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {}); 
swfobject.embedSWF('swf/pbanner2.swf', 'pbanner2', '1000', '215', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {});
swfobject.embedSWF('swf/pbanner3.swf', 'pbanner3', '1000', '215', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {});
swfobject.embedSWF('swf/map.swf', 'map', '150', '280', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {});
swfobject.embedSWF('swf/slogan.swf', 'slogan', '432', '100', '10', 'swf/expressInstall.swf', {}, { wmode: 'transparent', menu: 'false'}, {}); 

function addBookmarkForBrowser(sTitle, sUrl)
{
  var userAgent = navigator.userAgent.toLowerCase();
  var browser = {
    version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
    safari: /webkit/.test( userAgent ),
    opera: /opera/.test( userAgent ),
    msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
    mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
  }

  if (browser.mozilla) {
    addBookmarkForBrowser = function(sTitle, sUrl) {
      window.sidebar.addPanel(sTitle, sUrl, "");
    }
  } else if (browser.msie) {
    addBookmarkForBrowser = function(sTitle, sUrl) {
      window.external.AddFavorite(sUrl, sTitle);
    }
  } else if (browser.safari) {
    addBookmarkForBrowser = function() {
      alert("do it yourself");
    }
  } else {
    addBookmarkForBrowser = function() {
      alert("do it yourself");
    }
  }
  return addBookmarkForBrowser(sTitle, sUrl);
}

$jQuery(document).ready(function(){
	
	$jQuery("input[name='keyword']")
		.focus(function(){
			$jQuery(this).removeClass("inputKeywords");
		})
		.blur(function(){ 
			if (this.value.length == 0) {
				$jQuery(this).addClass("inputKeywords");
			}
			else {
				$jQuery(this).removeClass("inputKeywords");
			}
	});
		
  // PNG 在 IE5.5 IE6 透明及滑鼠改變圖像
  $jQuery('img[src$="_out.png"], input[src$="_out.png"]')
    .ifixpng()
    .css({cursor: 'pointer'})
    .hover(
      function () {
        $jQuery(this).iunfixpng();
        var img_src = this.src;
        if (img_src != '_out.png') {
          var over_src = img_src.substring(0, img_src.lastIndexOf('_out.png')) + '_over.png';
          if (over_src != '_over.png') {
            $jQuery(this).attr('src', over_src).ifixpng();
          }
        }
      },
      function () {
        $jQuery(this).iunfixpng();
        var img_src = this.src;
        if (img_src != '_over.png') {
          var out_src = img_src.substring(0, img_src.lastIndexOf('_over.png')) + '_out.png';
          if (out_src != '_out.png') {
            $jQuery(this).attr('src', out_src).ifixpng();
          }
        }
      }
    );

  // 全部 PNG 在 IE5.5 IE6 透明
  $jQuery('img[src$=".png"], input[src$="_out.png"], .png').ifixpng().iunfixpng().ifixpng();

  // GIF 滑鼠改變圖像
  $jQuery('img[src$="_out.gif"], input[src$="_out.gif"]')
    .css({cursor: 'pointer'})
    .hover(
      function () {
        var img_src = this.src;
        if (img_src != '_out.gif') {
          var over_src = img_src.substring(0, img_src.lastIndexOf('_out.gif')) + '_over.gif';
          if (over_src != '_over.gif') {
            $jQuery(this).attr('src', over_src);
          }
        }
      },
      function () {
        var img_src = this.src;
        if (img_src != '_over.gif') {
          var out_src = img_src.substring(0, img_src.lastIndexOf('_over.gif')) + '_out.gif';
          if (out_src != '_out.gif') {
            $jQuery(this).attr('src', out_src);
          }
        }
      }
    );

  // JPG 滑鼠改變圖像
  $jQuery('img[src$="_out.jpg"], input[src$="_out.jpg"]')
    .css({cursor: 'pointer'})
    .hover(
      function () {
        var img_src = this.src;
        if (img_src != '_out.jpg') {
          var over_src = img_src.substring(0, img_src.lastIndexOf('_out.jpg')) + '_over.jpg';
          if (over_src != '_over.jpg') {
            $jQuery(this).attr('src', over_src);
          }
        }
      },
      function () {
        var img_src = this.src;
        if (img_src != '_over.jpg') {
          var out_src = img_src.substring(0, img_src.lastIndexOf('_over.jpg')) + '_out.jpg';
          if (out_src != '_out.jpg') {
            $jQuery(this).attr('src', out_src);
          }
        }
      }
    );
});

$jQuery("#iSearchIcon").click(function() {
	$jQuery("form[id='iSearchForm']")[0].submit();
	return false;
});	

$jQuery("#pSearchIcon").click(function() {
	$jQuery("form[id='pSearchForm']")[0].submit();
	return false;
});	
