// DictJugglerサイト用の共通ライブラリ

// IEのみ例外処理ができないので、HTTPRequestを使う  --> SafariのHTTPRequestがどうも変
function createHttpRequestForIE() {
  //  return null;

/*
  var agentname = window.navigator.userAgent;
  var version = window.navigator.appVersion;
  // alert(version);
  version = version.substr(0,1);
  var safari = new RegExp("Safari");
  var oldwebkit = /Webkit\/[12348]/;
  //  var firefox = new RegExp("Firefox");

  //  alert (version);
  // alert (agentname);
  if (agentname && agentname.test(oldwebkit) ) {
    alert ("oldwebkit");
    return null;
  }
*/
  if (window.XMLHttpRequest) {
    return new XMLHttpRequest();
  }
	
  // return null;
	//Win ie6以下用
  // alert("no XMLHttpRequest available");
  if (window.ActiveXObject){
    try {
      return new ActiveXObject("Msxml2.XMLHTTP") 
	}
    catch (e) {
      try {
	      return new ActiveXObject("Microsoft.XMLHTTP") 
	  }
      catch (e2) {
	      return null;
      }
    }
  }
  
  return null;

}


function googleVerticalTextAd () {
  document.writeln('<div style="text-align: center; margin: 20px 0px 20px 0px; padding: 0px; background-color: #74D4D5;">');
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-0478687313408094";');
  document.writeln('google_ad_width = 160;');
  document.writeln('google_ad_height = 600;');
  document.writeln('google_ad_format = "160x600_as";');
  document.writeln('google_ad_type = "text_image";');
  document.writeln('google_ad_channel = "";');
  document.writeln('google_color_border = "74D4D5";');
  document.writeln('google_color_bg = "74D4D5";');
  document.writeln('google_color_link = "FF3333";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "002E3F";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script> ');
      
  document.writeln('</div>');
}


function googleVerticalImageAd () {
  document.writeln('<div style="text-align: center; margin: 20px 0px 20px 0px; padding: 0px; background-color: #74D4D5;">');
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-0478687313408094";');
  document.writeln('google_ad_width = 120;');
  document.writeln('google_ad_height = 240;');
  document.writeln('google_ad_format = "120x240_as";');
  document.writeln('google_ad_type = "text_image";');
  document.writeln('google_ad_channel = "";');
  document.writeln('google_color_border = "74D4D5";');
  document.writeln('google_color_bg = "74D4D5";');
  document.writeln('google_color_link = "FF3333";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "002E3F";');
  document.writeln('//-->');
  document.writeln('</script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
  document.writeln('</div>');
}

function googleVerticalImageAd2 () {
  document.writeln('<div style="text-align: center; margin: 20px 0px 20px 0px; padding: 0px; background-color: #74D4D5;">');
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-0478687313408094";');
  document.writeln('google_ad_width = 160;');
  document.writeln('google_ad_height = 600;');
  document.writeln('google_ad_format = "160x600_as";');
  document.writeln('google_ad_type = "image";');
  document.writeln('google_ad_channel = "";');
  document.writeln('google_color_border = "74D4D5";');
  document.writeln('google_color_bg = "74D4D5";');
  document.writeln('google_color_link = "FF3333";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "002E3F";');
  document.writeln('//-->');
  document.writeln('</script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
  document.writeln('</div>');
}


function googleVerticalImageAd3 () {
  document.writeln('<div style="text-align: center; margin: 20px 0px 20px 0px; padding: 0px; background-color: #74D4D5;">');

  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-0478687313408094";');
  document.writeln('google_ad_width = 250;');
  document.writeln('google_ad_height = 250;');
  document.writeln('google_ad_format = "250x250_as";');
  document.writeln('google_ad_type = "image";');
  document.writeln('google_ad_channel = "";');
  document.writeln('google_color_border = "74D4D5";');
  document.writeln('google_color_bg = "74D4D5";');
  document.writeln('google_color_link = "000000";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "002E3F";');
  document.writeln('//-->');
  document.writeln('</script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');

  document.writeln('</div>');
}
