document.write(""); function onTuugoWidgetbutton_collector(frame){ if (typeof window.postMessage=="function"){ window.addEventListener("message", function(event){ if(event.origin==="http://www.tuugo.pt/" || "http://www.tuugo.pt/".substring(0, 20)===event.origin.substring(0, 20) && event.data.type=='button_collector'){ frame.setAttribute("height", event.data.h+"px"); frame.setAttribute("width", event.data.w+"px"); } }, false); } else { setTimeout(function() { var h=null;var w=null; if(location.hash.match(/^#h_(\d+)_w_(\d+)/)){ h=RegExp.$1; w=RegExp.$2; location.hash=''; } if (!h){ top: for (var i=100; i<1000; i+=1){ for (var j=100; j<1000; j+=1){ if (top.frames["h_"+i + '_w_'+j]) { h=i; w=j; break top; } } } } if (h){ frame.style.height=h+"px"; } if (w){ frame.style.width=w+"px"; } },10); } }