jQuery(document).ready(function() {
	if (jQuery.browser.mobile == true) {
    if (jQuery.query.get('m')) {
			jQuery.cookie('pc', 1);
		}
		if (jQuery.cookie('pc') === null) {
			document.location.href = "http://m.grnet.com.tw/";
		}
  }
	
  swfobject.embedSWF('images/inpage-banner.swf', 'SWFBanner', '740', '106', '8', 'data/images/expressInstall.swf', {}, {menu: 'false', wmode: 'transparent'}, {});
  swfobject.embedSWF('images/icon2.swf', 'SWFNav', '450', '190', '8', 'data/images/expressInstall.swf', {}, {menu: 'false', wmode: 'transparent'}, {});
  swfobject.embedSWF('images/littleicon.swf', 'SWFLinks', '416', '46', '6', 'data/images/expressInstall.swf', {}, {menu: 'false', wmode: 'transparent'}, {});
  swfobject.embedSWF(pTFPath, 'SWFTitle', '324', '104', '8', 'data/images/expressInstall.swf', {}, {menu: 'false', wmode: 'transparent'}, {});
	
	jQuery('#pJQAds').skitter({
    label: false,
    interval: 5000,
    numbers: false,
    navigation: false,
    animation: 'randomSmart'
  });

  // 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);
          }
        }
      }
    );
});
