﻿function openwin(goto_URL)
{
var advPage = "http://click.dtiserv2.com/Direct/9290999-290-us6051/index.html";
if(goto_URL!=''){
//var advPage = "http://" + goto_URL;
window.open(advPage);
self.focus();
}
}

function setCookie (name, value){
var days=2;
var dname="jdooga.com";
var expire_date=new Date();
var ms_from_now=days*24*60*60*1000;
expire_date.setTime(expire_date.getTime()+ms_from_now);
var expire_string=expire_date.toGMTString();
document.cookie = name + "=" + escape(value)+";expires="+expire_string+";domain="+dname;
}

function getCookie(name) {var search;
search = name + "=";
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.substring(offset, end));
}
else{
return 0
}}

function aa(goto_URL){
if (getCookie("c1")==0){
openwin(goto_URL);
setCookie("c1",1);
}
}

function MM_openBrWindow(theURL,winName,features){ 
  window.open(theURL,winName,features);
}

function showComment(name,comment,article_ID,vericode,vericode123)
{
  if(name==""){
    alert("お名前をご記入ください!");
    document.comment.c_name.focus();
    return false;
  }	
  else if(comment==""){
    alert("コメントをご記入ください!");
    document.comment.c_comment.focus();
    return false;
  }	
  else if(vericode==""){
    alert("正しい検証コードをご記入ください!");
    document.comment.vericode.focus();
    return false;
  } 
	
  if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  }
  else{// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  xmlhttp.onreadystatechange=function()
 {
    if(xmlhttp.readyState==4 && xmlhttp.status==200){
	  if(xmlhttp.responseText=="bad"){
	    document.getElementById("clue").innerHTML="<font color=red>正しい検証コードをご記入ください!</font>";
	  }
	  else{
        document.getElementById("comment_list").innerHTML=xmlhttp.responseText;
		document.getElementById("clue").innerHTML="";
		document.comment.vericode.value="";
		document.comment.c_comment.value="";
      }
	}
  }
  
  xmlhttp.open("POST","/comment.php",true);
  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  post = "c_name="+name+"&c_comment="+comment+"&c_article_ID="+article_ID+"&vericode="+vericode+"&vericode123="+vericode123;
  xmlhttp.send(post);
}


function show_v(image_URL,file_URL,link_URL){ 
  var image_URL;
  var file_URL;
  var link_URL;
  var v = '<object width="510" height="410" ><param name="allowFullScreen" value="true"></param>'
  + '<param name="allowscriptaccess" value="always"></param>'
  + '<param name="wmode" value="transparent"></param>'
  + '<param name="quality" value="hight"></param>'
  + '<embed width="510" height="410" name="movie1" id="movie1" src="http://www.heydouga.com/common/source/player_v3.swf?image=http://'
  + image_URL
  + '&file=http://'
  + file_URL
  + '&autostart=false&displayclick=link&link=http://'
  + link_UR
  + '&linktarget=_blank" type="application/x-shockwave-flash"/></object>';
  document.write(v);
}
