//
// Javascripts File For F's Store Customer Voices at Contents
//
// version  : $Id: customer_voice_in_content.js,v 1.1 2007/01/07 09:29:26 yfujii Exp $ 
// author   : yfujii
// modifier : $Author: yfujii $

//クッキーの取得
times = getCookie("Times");

if (times == "" || times > voicesNum ) {
    times = 1;
}

document.open();

document.write("<div class=\"customer_voice\">");

document.write("  <dl>");
document.write("    <dt>");
document.write("      −ご利用者からのご評価−");
document.write("    </dt>");
document.write("    <dd>");
document.write("      <img src=\"/images/icons/" + customerVoices[times].image + "\" alt=\"" + customerVoices[times].grade + "\"><small>（" + customerVoices[times].grade + "）</small><br>");
document.write("      評価者：");
document.write("      <span class=\"feedbacker\">" + customerVoices[times].name + "</span>");
document.write("    </dd>");
document.write("    <dd>");
document.write("      <p>");
document.write(       customerVoices[times].feedback);
document.write("      </p>");
document.write("    </dd>");
document.write("  </dl>");

document.write("</div>");

document.close();


//クッキーに再セット
times++;

setCookie("Times", times);


function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {

    tmp1 = " " + document.cookie + ";";

    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    tmp += "path=/; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}
