function setResult(o) {

    var table = "<div class='listRow clearfix'>";
    var trtd;
    for(i = 0; i < o.length; i = i +1) {

        var tableSet =  "<div class='list'>"+
                        "<a href='portfolio.html?id=" + o[i]['id'] + "'><img src='./images/thumbnail_big/id_"+ o[i]['zero_id'] + ".jpg' width='290' height='200' alt='" + o[i]['project_name'] + "'></a>"+
                        "<ul>" +
                        "<li><a href='portfolio.html?id=" + o[i]['id'] + "'>" + o[i]['project_name'] + "</a></li>"+
                        "</ul>" +
                        "</div>";

        var tableSet2 = "<div class='listRight'>"+
                        "<a href='portfolio.html?id=" + o[i]['id'] + "'><img src='./images/thumbnail_big/id_"+ o[i]['zero_id'] + ".jpg' width='290' height='200' alt='" + o[i]['project_name'] + "'></a>"+
                        "<ul>" +
                        "<li><a href='portfolio.html?id=" + o[i]['id'] + "'>" + o[i]['project_name'] + "</a></li>"+
                        "</ul>" +
                        "</div>";

        if (i == 0) {
            trtd = tableSet;
        } else if(i % 3 == 2) {
            trtd = trtd + tableSet2;
        } else if(i != 0 && i % 3 == 0 && o.length != i){
            trtd = trtd + "</div><div class='listRow clearfix'>" + tableSet
        }else {
            trtd = trtd + tableSet;
        }

    }
    table = table + trtd + "</div>";
    return table;
}

function doAction(){
    var id = $('#parent').val();
    $.post('sys/satellite/async.php',{id:id},callback);
}

function callback(result){
    $('#child').html(result);
}

function move(){
    if(document.getElementById("child").options[document.getElementById("child").selectedIndex].value != ""){
        var domain = location.hostname;
        location.href="https://" + domain + "/shop/reserve.html?id=" + document.getElementById("child").options[document.getElementById("child").selectedIndex].value;
        
    } else {
        return false;
    }
}

function getRequest(){
      if(location.search.length > 1) {
        var get = new Object();
        var ret = location.search.substr(1).split("&");
            for(var i = 0; i < ret.length; i++) {
              var r = ret[i].split("=");
              get[r[0]] = r[1];
            }
            return get;
      } else {
        return false;
      }
    }

