/*  RedTram Goods 31.05.2011 13:57:54 */   
var tmp_align=1;// 1- left 2- right 3- top
var elem='n4p_1687';
var show_desc=0;
var row_all=1;
var col_all=3;
var row_count= 0;
var col_count= 0;
var rtn4p_1687_domain='http://goods.redtram.com/';
var rtn4p_host='http://g4p.redtram.com/';
var tmp_photo='http://img3.ru.redtram.com/90x90/';
var rtn4p_item=1687;
var tbl=document.createElement("TABLE");
var classname='class';
if(!+"\v1" && (navigator.appVersion.indexOf('MSIE 8.0') == -1)) classname = 'className';

var rtn4p_css_styles = 'div#n4p_1687{background-color:#fff}table.rt_table_1687{width:600px;border:1px solid #dfdfdf}.rt_table_1687 td{padding:0}div.rt_block_1687{margin:2px;padding:5px}div.rt_photo_1687{width:90px;height:90px;border:0px}.rt_photo_1687 img{width:90px;height:90px;border:0}div.rt_title_1687_div{max-height:28px;overflow:hidden;line-height:14px}* HTML .rt_title_1687_div{height:28px}a.rt_title_1687,a.rt_title_1687:visited{font-family:Tahoma;font-size:12px;color:#444444;line-height:14px;text-decoration:none;text-transform:none;font-weight:bold;font-style:normal}a.rt_title_1687:hover,a.rt_title_1687:active{color:#444444;text-decoration:none}div.rt_descr_1687_div{max-height:28px;overflow:hidden;margin-top:3px;line-height:14px}* HTML .rt_descr_1687_div{height:28px}a.rt_descr_1687,a.rt_descr_1687:visited{font-family:Tahoma;font-size:12px;color:#000000;line-height:14px;font-weight:normal;text-decoration:none;text-transform:none;font-style:normal}a.rt_descr_1687:hover,a.rt_descr_1687:active{color:#000000;text-decoration:none}a.rt_price_1687,a.rt_price_1687:visited,a.rt_price_1687:hover,a.rt_price_1687:active{display:block;margin-top:3px;font-family:Tahoma;font-size:10px;color:#666;line-height:12px;text-decoration:none;font-weight:bold;text-transform:none;font-style:normal}';

if (tmp_align == 1) rtn4p_css_styles += 'div.rt_block_1687{text-align:left}div.rt_main_1687{margin-left:100px/*;min-width:120px*/}div.rt_photo_1687{float:left}.rt_photo_1687 img{margin-bottom:5px}a.rt_price_1687{text-align:right;padding-right:5px}';
if (tmp_align == 2) rtn4p_css_styles += 'div.rt_block_1687{text-align:right}div.rt_main_1687{margin-right:100px/*;min-width:120px*/}div.rt_photo_1687{float:right}.rt_photo_1687 img{margin-bottom:5px}a.rt_price_1687{text-align:left;padding-left:5px}';
if (tmp_align == 3) rtn4p_css_styles += 'div.rt_block_1687{text-align:center}div.rt_photo_1687{margin:0 auto}a.rt_price_1687{padding-left:5px;padding-right:5px}';

document.write('<style type="text/css">'+rtn4p_css_styles+'<'+'/style>');
tbl.setAttribute(classname, "rt_table_1687");
tbl.setAttribute("cellpadding", "0");
tbl.setAttribute("cellspacing", "0");

document.getElementById(elem).innerHTML = '<a href="http://goods.redtram.com" target="_blank" style="display:block !important;text-decoration:none;width:100px !important;overflow:hidden !important;outline:0;margin:0 !important;padding:2px !important;height:11px !important;line-height:11px !important;font-size:11px !important;font-family:verdana !important;color:black;"><span style="color:#f11e26 !important;">Red</span>Tram&nbsp;Goods</a>';
document.getElementById(elem).appendChild(tbl);
tb = document.createElement("TBODY");
tbl.appendChild(tb);

function GoodsH(id) { }
function GoodsF(id) { }
function toword(str,letter,limit){if (str.length<=letter) {return str;}if (limit == undefined) { limit = '';}var word=str.split(" ");str=word[0] + ' ';for (i=1;i<word.length;i++) {if ((str+word[i]).length>letter) {return (str + " " + limit).replace(/(^\s+)|(\s+$)/g, "");}else {str+=word[i] + ' ';}}return str.replace(/(^\s+)|(\s+$)/g, "");}
function setCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?";domain="+domain:"")+((secure)?"; secure":"");}
function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0){return null;}}else{begin += 2;}var end=dc.indexOf(";", begin);if (end==-1){end=dc.length;} return unescape(dc.substring(begin+prefix.length,end)); }
function rtn4p_RedTramCookies(value){ var cn="rgoods_1"; if(value){ rtn4p_page=value; }else{ var c=getCookie(cn); if (c != null && parseInt(c) < 5) { rtn4p_page = parseInt(c) + 1; } else { rtn4p_page = 1; } setCookie(cn,rtn4p_page,"","/"); } }
rtn4p_RedTramCookies();

scriptsrc= rtn4p_host+'?i='+rtn4p_item+'&p='+rtn4p_page;
document.write('<scr'+'ipt language="javascript" type="text/javascript" src="'+scriptsrc+'" charset="UTF-8"> </'+'scr'+'ipt>');

function base64_encode( data ) { var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc=''; do {    o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1<<16 | o2<<8 | o3; h1 = bits>>18 & 0x3f; h2 = bits>>12 & 0x3f; h3 = bits>>6 & 0x3f; h4 = bits & 0x3f; enc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); switch( data.length % 3 ){ case 1: enc = enc.slice(0, -2) + '=='; break; case 2: enc = enc.slice(0, -1) + '='; break; } return enc; }

function AddGood(id,title,desc,cost,vcost,lnk, iid, part) {
    var tmp_ak = akg[" + iid + "];
    var url = '/';

    a = 'a=' + iid + '&b=' + id + '&c=' + lnk.replace(/&/gi, '+||+') + '&d=' + document.referrer.replace(/&/gi, '+||+') + '&e=' + document.location.href.replace(/&/gi, '+||+') + '&f=0&ak='+tmp_ak;
    url = rtn4p_1687_domain+'go/'+iid+'/'+id+url;
    url += base64_encode(a) + '?ref=' + document.location.href;
    if (row_count >= row_all && col_count >= col_all)
        return true;
    var max_desc = 40;
    var max_title = 40;
    var dsclimit = '..';

    if (max_desc != 0 && desc.length>max_desc)                        
        desc=toword(desc, max_desc, dsclimit);

    if (max_title != 0 && title.length>max_title)                        
        title=toword(title, max_title, dsclimit);

    if (row_count == 0 || col_count == col_all)
    {
        row = document.createElement("TR");
        tb.appendChild(row);
        row_count++;
        col_count = 0;
    }else
    {
        row = tb.getElementsByTagName("TR")[row_count-1];
    }
    td = document.createElement("TD");
    td.setAttribute("valign", "top");
    td.setAttribute("width", parseInt(100/col_all) + "%");
    col_count++;
    row.appendChild(td);

    divp = document.createElement("div");
    divp.setAttribute(classname, "rt_block_1687");
    td.appendChild(divp);

    div_photo = document.createElement("div");div_photo.setAttribute(classname, "rt_photo_1687");if (tmp_align == 0)  div_photo.style.display = 'none';divp.appendChild(div_photo);a_img = document.createElement("a");a_img.setAttribute("target", "_blank");a_img.setAttribute("href", url);div_photo.appendChild(a_img);img_i = document.createElement("img");img_i.setAttribute("src", tmp_photo + id + ".jpg");img_i.setAttribute("width", "90");img_i.setAttribute("height", "90");img_i.setAttribute("border", "0");a_img.appendChild(img_i);

    divt = document.createElement("div");
    divt.setAttribute(classname, "rt_main_1687");
    divp.appendChild(divt);

    divtit = document.createElement("div");
    divtit.setAttribute(classname, "rt_title_1687_div");
    divt.appendChild(divtit);

    a_tit = document.createElement("a");
    a_tit.setAttribute("target", "_blank");
    a_tit.setAttribute(classname, "rt_title_1687");
    a_tit.setAttribute("href", url);
    divtit.appendChild(a_tit);
    a_tit.innerHTML = title;

    divdesc = document.createElement("div");divdesc.setAttribute(classname, "rt_descr_1687_div");divt.appendChild(divdesc);a_desc = document.createElement("a"); a_desc.setAttribute("target", "_blank");a_desc.setAttribute(classname, "rt_descr_1687");a_desc.setAttribute("href", url);divdesc.appendChild(a_desc);a_desc.innerHTML = desc;
    if (cost>0) {
        a_cost = document.createElement("a");
        a_cost.setAttribute("target", "_blank");
        a_cost.setAttribute(classname, "rt_price_1687");
        a_cost.setAttribute("href", url);
        divt.appendChild(a_cost);
        a_cost.innerHTML = cost+' '+vcost;
    }
}
