var goto = {}; goto["link0"] = "/go?to=http://chel.dipo.ru/company/firm_2404_metpromterminal"; goto["link1"] = "/go?to=http://chel.dipo.ru/company/firm_2404_metpromterminal"; goto["link2"] = "/go?to=http://metpromterminal.urif.ru/contact"; goto["link3"] = "/go?to=http://chel.dipo.ru/company/firm_2404_metpromterminal/products"; goto["link4"] = "http://chel.dipostroi.ru/go?to=http://chel.dipo.ru/product/p39930713_vtulka-pod-flanec-udlinennaja-l400mm-pe100-sdr26-d"; goto["link5"] = "http://chel.dipostroi.ru/go?to=http://chel.dipo.ru/product/p3770921_almaznyi-zatochnoi-kolpachok--16"; goto["link6"] = "http://chel.dipostroi.ru/go?to=http://chel.dipo.ru/product/p3770919_almaznyi-zatochnoi-kolpachok--15"; goto["link7"] = "/go?to=http://metpromterminal.urif.ru/product/p39928612_kvadrat-45---stalnoi-10-20-45-40h-a12-as14-u8a-u10"; goto["link8"] = "/go?to=http://metpromterminal.urif.ru/document/info_deliv"; /** Преобразовать все span в ссылки*/ $("span.jsGoto").each(function(){ var attr_array = ["id","rel","target","class","itempro","data-href","data-id","stype","alt"]; var attr_str = ''; var idspan = $(this).attr("data-span"); var key = 'link'+idspan; var id = $(this).attr("id"); var rel = $(this).attr("rel"); var target = $(this).attr("target"); var clas = $(this).attr("class"); var itemprop = $(this).attr("itemprop"); var href = goto[key]; var dataid = $(this).attr("data-id"); var style = $(this).attr("style"); var alt = $(this).attr("alt"); if (id!=undefined) { attr_str = attr_str+' id="'+id+'"';} if (rel!=undefined) { attr_str = attr_str+' rel="'+rel+'"';} if (target!=undefined) { attr_str = attr_str+' target="'+target+'"';} if (clas!=undefined) { attr_str = attr_str+' class="'+clas+'"';} if (itemprop!=undefined) { attr_str = attr_str+' itemprop="'+itemprop+'"';} if (dataid!=undefined) { attr_str = attr_str+' data-id="'+dataid+'"';} if (style!=undefined) { attr_str = attr_str+' style="'+style+'"';} if (alt!=undefined) { attr_str = attr_str+' alt="'+alt+'"';} if (href!=undefined) { attr_str = attr_str+' href="'+href+'"';} $(this).replaceWith(""+$(this).html()+""); });