/*
   This Javascript code was generated by Jemplate, the Javascript
   Template Toolkit. Any changes made to this file will be lost the next
   time the templates are compiled.

   Copyright 2006 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['item.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 23 "item.html"
if (1 == stash.get('no_item')) {
output += '\n    ';
//line 6 "item.html"
if (stash.get('adult')) {
output += '\n        <div style="margin:0 0 10px 0; padding: 10px 0 0 0; text-align:center; border-top:1px solid #ccc;">\n        <iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=socialtunes-22&o=9&p=48&l=st1&mode=dvd-jp&search=%E3%82%A2%E3%83%80%E3%83%AB%E3%83%88&=1&fc1=&lt1=&lc1=&bg1=&f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>\n        </div>\n    ';
}

output += '\n';
}
else {
output += '\n    <div style="margin:0 0 10px 0; padding:10px 0 0 0; border-top:1px solid #ccc; text-align:center;">\n    <div id="item_title">Amazon</div>\n    ';
//line 20 "item.html"

// FOREACH 
(function() {
    var list = stash.get('items');
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['row'] = value;
output += '\n        <a href="http://www.amazon.co.jp/exec/obidos/ASIN/';
//line 11 "item.html"
output += stash.get(['row', 0, 'ASIN', 0]);
output += '/socialtunes-22/ref=nosim" target="_blank">\n        <span onmouseover="setItemTitle(\'';
//line 12 "item.html"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '\');" onmouseout="setItemTitle(\'\');">\n        ';
//line 17 "item.html"
if (stash.get('undefined') == stash.get(['row', 0, 'SmallImage', 0, 'URL', 0])) {
output += '\n            <img src="/images/no_image_s.png" alt="';
//line 14 "item.html"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" title="';
//line 14 "item.html"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" />\n        ';
}
else {
output += '\n            <img src="';
//line 16 "item.html"
output += stash.get(['row', 0, 'SmallImage', 0, 'URL', 0]);
output += '" alt="';
//line 16 "item.html"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" title="';
//line 16 "item.html"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" />\n        ';
}

output += '\n        </span>\n        </a>\n    ';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n    <div class="clearing"></div>\n    </div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['item.html.bak'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 21 "item.html.bak"
if (stash.get('items')) {
output += '\n    <div style="margin:10px 0 10px 0; padding:10px 0 0 0; border-top:1px solid #ccc; text-align:center;">\n    <div id="item_title">Amazon</div>\n    ';
//line 14 "item.html.bak"

// FOREACH 
(function() {
    var list = stash.get('items');
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['row'] = value;
output += '\n        <a href="http://www.amazon.co.jp/exec/obidos/ASIN/';
//line 5 "item.html.bak"
output += stash.get(['row', 0, 'ASIN', 0]);
output += '/socialtunes-22/ref=nosim" target="_blank">\n        <span onmouseover="setItemTitle(\'';
//line 6 "item.html.bak"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '\');" onmouseout="setItemTitle(\'\');">\n        ';
//line 11 "item.html.bak"
if (stash.get('undefined') == stash.get(['row', 0, 'SmallImage', 0, 'URL', 0])) {
output += '\n            <img src="/images/no_image_s.png" alt="';
//line 8 "item.html.bak"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" title="';
//line 8 "item.html.bak"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" />\n        ';
}
else {
output += '\n            <img src="';
//line 10 "item.html.bak"
output += stash.get(['row', 0, 'SmallImage', 0, 'URL', 0]);
output += '" alt="';
//line 10 "item.html.bak"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" title="';
//line 10 "item.html.bak"
output += stash.get(['row', 0, 'ItemAttributes', 0, 'Title', 0]);
output += '" />\n        ';
}

output += '\n        </span>\n        </a>\n    ';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n    <div class="clearing"></div>\n    </div>\n';
}
else {
output += '\n    ';
//line 20 "item.html.bak"
if (stash.get(stash.get('adult'))) {
output += '\n        <iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=socialtunes-22&o=9&p=6&l=st1&mode=dvd-jp&search=%E3%82%A2%E3%83%80%E3%83%AB%E3%83%88&=1&fc1=&lt1=&lc1=&bg1=&f=ifr" marginwidth="0" marginheight="0" width="120" height="150" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>\n    ';
}

output += '\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['player.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += 'i\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['popular_queries.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span style="cursor:pointer; color:silver;" onclick="toggleQueryList();">recent_queries <img src="/images/reload_gray.gif" /></span>\n|\npopular queries\n<br />\n';
//line 7 "popular_queries.html"

// FOREACH 
(function() {
    var list = stash.get('queries');
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['row'] = value;
output += '\n    <span class="tag" onclick="searchVideo(\'';
//line 6 "popular_queries.html"
output += stash.get(['row', 0, 'query', 0]);
output += '\')"><a>';
//line 6 "popular_queries.html"
output += stash.get(['row', 0, 'query', 0]);
output += '</a></span>&nbsp;&nbsp;\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['popup.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n<meta http-equiv="Content-Script-Type" content="text/javascript" />\n<meta http-equiv="Content-Style-Type" content="text/css" />\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/prototype.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/Jemplate.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/templates.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/objectdump.js"></script>\n<script>\nfunction onSubmit() {\n    if (!window.opener || window.opener.closed) {\n        var url = \'http://video.qooqle.jp/#\'+encodeURI($F(\'query\'));\n        window.open(url, \'qooqle_video\');\n    } else {\n        window.opener.$(\'query\').value = $F(\'query\');\n        window.opener.onSubmit();\n    }\n}\nfunction toggleOptions() {\n    Element.toggle(\'options\');\n    Element.toggle(\'options_loader\');\n}\nfunction getDownloadLink(id) {\n    pars = \'mode=ajax&act=get_download_url&id=\'+id;\n    new Ajax.Request(\'/\', {parameters:pars, onComplete:\n        function(r) {\n            var res = r.responseText;\n            if (0 == res) {\n                $(\'download_link\').innerHTML = \'error: cannot get download url\';\n            } else {\n                $(\'download_link\').innerHTML = \'<a href="\'+res+\'" style="color:red; text-decoration:none;">download (right click here & save as "*.flv")</a>\';\n            }\n        }\n    });\n    $(\'download_link\').innerHTML = \'<img src="/images/spinner.gif" />\';\n}\n</script>\n<style type="text/css">\nbody {\n    font-family: "Trebuchet MS", "Century Gothic", geneva, verdana, "Hiragino Maru Gothic Pro", HiraMaruPro-W4, "ヒラギノ丸ゴ Pro W4", "ＭＳ Ｐゴシック", Osaka,sans-serif;\n   margin: 0;\n   padding: 0 0 0 0;\n   text-align: center;\n   background: #fff;\n}\n</style>\n<title>Qooqle Video</title>\n</head>\n<body>\n\n<div id="dumparea"></div>\n\n<object width="425" height="350" style="margin:0;">\n<param name="movie" value="http://www.youtube.com/v/';
//line 56 "popup.html"
output += stash.get('id');
output += '"></param>\n<embed src="http://www.youtube.com/v/';
//line 57 "popup.html"
output += stash.get('id');
output += '" type="application/x-shockwave-flash" width="425" height="350"></embed>\n</object>\n\n<form onsubmit="onSubmit(); return false;" style="margin:0;">\n<fieldset style="text-align:right; border:none; font-size:10pt;">\n<span id="options_loader" style="cursor:pointer;" onclick="toggleOptions();">options</span>&nbsp;\n<span id="options" style="display:none;">\n<a href="http://www.youtube.com/watch?v=';
//line 64 "popup.html"
output += stash.get('id');
output += '&eurl=http%3A%2F%2Fvideo%2Eqooqle%2Ejp%2F" target="_blank">permalink</a> | \n<span id="download_link">\n<a href="javascript:getDownloadLink(\'';
//line 66 "popup.html"
output += stash.get('id');
output += '\');">get download link</a> \n</span>\n<!--\n<a href="http://youtube.com/get_video.php?video_id=';
//line 69 "popup.html"
output += stash.get('id');
output += '" title="download">download</a>\n(<a href="http://solvalou.net/mt/archives/2006/04/qooqle_video_ho.php" target="_blank">?</a>) |\n-->\n| <input type="text" id="query" name="query" style="width:100px; padding:0; font-size:12px; line-height:12px;" ';
//line 72 "popup.html"
if (stash.get('undefined') != stash.get('query')) {
output += 'value="';
//line 72 "popup.html"
output += stash.get('query');
output += '"';
}

output += ' />\n<input type="submit" value="search" style="font-size:12px; line-height:1.2;" />\n[<span style="cursor:pointer;" onclick="toggleOptions();">x</span>]\n</span>\n</fieldset>\n</form>\n\n<script type="text/javascript"><!--\ngoogle_ad_client = "pub-2924271326653369";\ngoogle_ad_width = 234;\ngoogle_ad_height = 60;\ngoogle_ad_format = "234x60_as";\ngoogle_ad_type = "text_image";\ngoogle_ad_channel ="";\ngoogle_color_border = "FFFFFF";\ngoogle_color_link = "0066CC";\ngoogle_color_bg = "FFFFFF";\ngoogle_color_text = "6F6F6F";\ngoogle_color_url = "666677";\n//--></script>\n<script type="text/javascript"\n  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\n</script>\n\n<div id="search_result"></div>\n\n</body>\n</html>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['popup.html.bak'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n<meta http-equiv="Content-Script-Type" content="text/javascript" />\n<meta http-equiv="Content-Style-Type" content="text/css" />\n<link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/prototype.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/Jemplate.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/templates.js"></script>\n<script type="text/javascript" src="http://video.qooqle.jp/javascripts/objectdump.js"></script>\n<script>\nfunction onSubmit() {\n    if (!window.opener || window.opener.closed) {\n        var url = \'http://video.qooqle.jp/#\'+encodeURI($F(\'query\'));\n        window.open(url, \'qooqle_video\');\n    } else {\n        window.opener.$(\'query\').value = $F(\'query\');\n        window.opener.onSubmit();\n    }\n}\n</script>\n<style type="text/css">\nbody {\n   margin: 0;\n   padding: 0 0 0 0;\n   text-align: center;\n   background: #fff;\n}\n</style>\n<title>Qooqle Video</title>\n</head>\n<body>\n\n<div id="dumparea"></div>\n\n<object width="425" height="350">\n<param name="movie" value="http://www.youtube.com/v/';
//line 38 "popup.html.bak"
output += stash.get('id');
output += '"></param>\n<embed src="http://www.youtube.com/v/';
//line 39 "popup.html.bak"
output += stash.get('id');
output += '" type="application/x-shockwave-flash" width="425" height="350"></embed>\n</object>\n\n<br />\n\n<form onsubmit="onSubmit(); return false;">\n<fieldset style="text-align:right; border:none;">\n<a href="http://www.youtube.com/get_video.php?video_id=';
//line 46 "popup.html.bak"
output += stash.get('id');
output += '">download</a>&nbsp;\n<input type="text" id="query" name="query" style="height:1.5em; font-size:12px; line-height:1.2;" ';
//line 47 "popup.html.bak"
if (stash.get('undefined') != stash.get('query')) {
output += 'value="';
//line 47 "popup.html.bak"
output += stash.get('query');
output += '"';
}

output += ' />\n<input type="submit" value="search" style="height:1.5em; font-size:12px; line-height:1.2;" />\n</fieldset>\n</form>\n\n<div id="search_result"></div>\n\n</body>\n</html>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['recent_queries.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\nrecent queries <span id="reloader" style="cursor:pointer;" onclick="update_recent_queries();"><img src="/images/reload.gif" alt="reload" /></span>\n|\n<!--span style="cursor:pointer; color:#999;" onclick="toggleQueryList();">popular queries</span -->\n<span class="queries_link">\n<a href="javascript:toggleQueryList();">popular queries</a>\n</span>\n&nbsp;&nbsp;\n<span style="color:red;">new</span> <a href="http://clippers.qooqle.jp/">clippers!</a>\n<!-- span class="bookmark_link"><a href="javascript:showBookmarked();">bookmarked</a></span -->\n<br />\n';
//line 14 "recent_queries.html"

// FOREACH 
(function() {
    var list = stash.get('queries');
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['row'] = value;
output += '\n    <span class="tag" onclick="searchVideo(\'';
//line 13 "recent_queries.html"
output += stash.get(['row', 0, 'query_escaped', 0]);
output += '\');"><a>';
//line 13 "recent_queries.html"
output += stash.get(['row', 0, 'query', 0]);
output += '</a></span>&nbsp;&nbsp;\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['youtube.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div style="border-top:1px solid #ccc; padding: 5px 0 0 0;">\n<!-- div style="text-align:center; margin:10px 0 5px 0; padding:10px 0 0 0; border-top:1px solid #ccc;">YouTube</div -->\n\n<div id="sort_by" style="margin-bottom:10px; color:#666;">\nsort by: \n';
//line 10 "youtube.html"
if ('' == stash.get(['result', 0, 'sort', 0])) {
output += '\n    relevance | \n';
}
else {
output += '\n    <a href="javascript:searchVideo(\'';
//line 9 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', 1, \'\')">relevance</a> | \n';
}

output += '\n';
//line 15 "youtube.html"
if ('video_date_uploaded' == stash.get(['result', 0, 'sort', 0])) {
output += '\n    date | \n';
}
else {
output += '\n    <a href="javascript:searchVideo(\'';
//line 14 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', 1, \'video_date_uploaded\')">date</a> | \n';
}

output += '\n';
//line 20 "youtube.html"
if ('video_view_count' == stash.get(['result', 0, 'sort', 0])) {
output += '\n    view count | \n';
}
else {
output += '\n    <a href="javascript:searchVideo(\'';
//line 19 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', 1, \'video_view_count\')">view count</a> | \n';
}

output += '\n';
//line 25 "youtube.html"
if ('rating_sort' == stash.get(['result', 0, 'sort', 0])) {
output += '\n    rating\n';
}
else {
output += '\n    <a href="javascript:searchVideo(\'';
//line 24 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', 1, \'rating_sort\')">rating</a>\n';
}

output += '\n</div>\n\n<div id="sort_by_loading" style="display:none; margin-bottom:10px; color: silver;">\nsort by: relevance | date | view count | rating\n</div>\n\n';
//line 41 "youtube.html"

// FOREACH 
(function() {
    var list = stash.get(['result', 0, 'items', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['row'] = value;
output += '\n    <div style="float:left; width:210px; margin:0 0 10px 0; border:0px solid red;">\n    <div style="width:200px; height:20px; overflow:hidden;">\n    <span onclick="play(\'';
//line 35 "youtube.html"
output += stash.get(['row', 0, 'id', 0]);
output += '\');" style="cursor:pointer;">';
//line 35 "youtube.html"
output += stash.get(['row', 0, 'title', 0]);
output += '</span>\n    </div>\n    ';
//line 39 "youtube.html"

// FOREACH 
(function() {
    var list = stash.get(['row', 0, 'images', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['image'] = value;
output += '\n        <span onclick="play(\'';
//line 38 "youtube.html"
output += stash.get(['row', 0, 'id', 0]);
output += '\');" style="cursor:pointer;"><img src="';
//line 38 "youtube.html"
output += stash.get('image');
output += '" width="65" height="48" /></span>\n    ';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n    </div>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<div class="clearing"></div>\n<div id="pager" style="text-align:center;">\n';
//line 46 "youtube.html"
if (2 <= stash.get(['result', 0, 'page', 0])) {
output += '\n    &nbsp;<span class="pager" onclick="searchVideo(\'';
//line 45 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', ';
//line 45 "youtube.html"
output += stash.get(['result', 0, 'page', 0]) - 1;
output += ', \'';
//line 45 "youtube.html"
output += stash.get(['result', 0, 'sort', 0]);
output += '\');"><a>prev</a></span>&nbsp;\n';
}

output += '\n';
//line 49 "youtube.html"
if (0 != stash.get(['result', 0, 'next_page', 0])) {
output += '\n    &nbsp;<span class="pager" onclick="searchVideo(\'';
//line 48 "youtube.html"
output += stash.get(['result', 0, 'query_escaped', 0]);
output += '\', ';
//line 48 "youtube.html"
output += stash.get(['result', 0, 'next_page', 0]);
output += ', \'';
//line 48 "youtube.html"
output += stash.get(['result', 0, 'sort', 0]);
output += '\');"><a>next</a></span>&nbsp;\n';
}

output += '\n</div>\n\n</div>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

