/* sIFR (Scalable Inman Flash Replacement) Version 2.0 RC3 Copyright 2004 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben Hacked by Vanja Bertalan for two-color sIFR variation This software is licensed under the CC-GNU LGPL */ /* ** BEGIN SECURITY CHECK ** */ // Security currentDomain = _root._url.split("/"); currentDomain = currentDomain[2]; function domainMatch() { for (i=0; i < allowedDomains.length; i++) { if (allowedDomains[i] == "*" || currentDomain == allowedDomains[i]) { return true; break; } } } islocal = (_root._url.indexOf("http://") == -1 || _root._url.indexOf("https://") == -1) ? true : false; /* ** END SECURITY CHECK ** */ function launchURL (index) { launchURL_anchor = eval("sifr_url_"+index); launchURL_target = eval("sifr_url_"+index+"_target"); if (Key.getCode() == 16 || Key.getCode() == 17) { getURL(launchURL_anchor, "_blank"); } else { getURL(launchURL_anchor,launchURL_target); } } function buildText () { // Sets stage parameters Stage.scaleMode="noscale"; Stage.align = "TL"; Stage.showMenu=false; // Sets height and width of textbox if (w == null) { w=300; } if (h == null) { h=100; } if (txt == null) { txt="Please pass in your text."; // txt='­GALERIJA:­  ­Pornić­ sa Šare'; } orig_width = Number(w)+4-Number(pleft)-Number(pright); orig_height = Number(h)+4-Number(ptop)-Number(pbottom); // Sets styles if (textcolor != undefined) { if (textcolor.indexOf("#") > -1) { textcolor = textcolor.substring(1,7); } textcolor = "0x" + textcolor; } else { textcolor = "0x000000"; } if (hovercolor != undefined) { if (hovercolor.indexOf("#") > -1) { hovercolor = hovercolor.substring(1,7); } hovercolor = "0x" + hovercolor; } if (linkcolor != undefined) { if (linkcolor.indexOf("#") > -1) { linkcolorhex = "0x" + linkcolor.substring(1,7); } else { linkcolorhex = "0x" + linkcolor; } } holder.txtF._width = orig_width; holder.txtF._height = orig_height; holder.txtF._x = 0-2+Number(pleft); holder.txtF._y = 0-2+Number(ptop); holder.txtF.autoSize = "left"; holder.txtF.condenseWhite = true; var fmt = new TextFormat(); fmt.color = textcolor; fmt.size = Number(textsize); if (!leading) { leading = 1; } else { leading = Number(leading); } fmt.leading = leading; if (textalign != null) { fmt.align = textalign; } if (holder.txtF.htmlText.indexOf("") > -1) { fmt.bold = true; } if (holder.txtF.htmlText.indexOf("") > -1) { fmt.italic = true; } holder.txtF.htmlText = txt; holder.txtF.setTextFormat(fmt); textsize = 6; breaker1 = 0; while (holder.txtF.maxscroll == 1 && holder.txtF.textHeight <= (orig_height-4) && breaker1 < 300) { textsize++; fmt.size = textsize; holder.txtF.setTextFormat(fmt); holder.txtF._width = orig_width; holder.txtF._height = orig_height; ismax = holder.txtF.maxscroll; breaker1++; } textsize = textsize-1; fmt.size = textsize; holder.txtF.setTextFormat(fmt); holder.txtF._width = orig_width; holder.txtF._height = orig_height; if (offsetTop != undefined) { holder.txtF._y = holder.txtF._y + Number(offsetTop); } if (offsetLeft != undefined) { holder.txtF._x = holder.txtF._x + Number(offsetLeft); } // if text contains an anchor, enable click actions placeholder = holder.txtF.htmlText; if (placeholder.indexOf(" -1) { breaker2 = 0; while (placeholder.indexOf(" -1 && breaker2 < 300) { tempString = placeholder.substring(placeholder.indexOf("")+4); tempArray = placeholder.split(tempString); tempBlock += tempArray[0]+""+tempString+""; placeholder = tempArray[1]; breaker2++; } tempBlock += tempArray[1]; holder.txtF.htmlText = tempBlock; if (hovercolor != undefined || underline != undefined) { urlString = holder.txtF.htmlText.substring(holder.txtF.htmlText.indexOf("HREF=")+6); urlArray = urlString.split('"'); var link_color = new Color(holder); holder.onRollOver = function () { if (hovercolor != undefined) { // link_color.setRGB(parseInt(hovercolor)); fmt.color = hovercolor; holder.txtF.setTextFormat(fmt); } if (underline != undefined) { fmt.underline=true; holder.txtF.setTextFormat(fmt); } // getURL("javascript:setStatus('http://"+currentDomain+sifr_url_0+"')"); } holder.onRollOut = function () { if (hovercolor != undefined) { // link_color.setRGB(linkcolorhex); // fmt.color = linkcolorhex; // holder.txtF.setTextFormat(fmt); holder.txtF.htmlText = defaultHtmlText; } if (underline != undefined) { fmt.underline=false; holder.txtF.setTextFormat(fmt); } // getURL("javascript:setStatus(' ')"); } holder.onRelease = function () { getURL(urlArray[0]); } } } placeholder = holder.txtF.htmlText; debug.text = placeholder; // custom code for 24sata.hr - allow parts of the text to be in the different color if (altcolor != undefined && placeholder.indexOf(colorDelimiter) > -1) { tempBlock = ""; breaker3 = 0; while (placeholder.indexOf(colorDelimiter) > -1 && breaker3 < 300) { tempString = placeholder.substring(placeholder.indexOf(colorDelimiter)); tempString = (tempString.indexOf(colorDelimiter, colorDelimiterLen) > -1) ? tempString.slice(0,tempString.indexOf(colorDelimiter, colorDelimiterLen)+colorDelimiterLen) : tempString.slice(0); tempArray = placeholder.split(tempString); tempString = (tempString.indexOf(colorDelimiter, colorDelimiterLen) > -1) ? tempString.substring(colorDelimiterLen, tempString.length-colorDelimiterLen) : tempString.substring(colorDelimiterLen); tempBlock += tempArray[0]+""+tempString+""; placeholder = tempArray[1]; breaker3++; } tempBlock += tempArray[1]; holder.txtF.htmlText = tempBlock; // debug.text = tempBlock; } defaultHtmlText = holder.txtF.htmlText; holder._alpha = 100; } // if all security tests are passed, build the text if ((allowlocal && islocal) || domainMatch()) { buildText(); }