﻿function CreateActiveXFlash(FlashPath, FlashStyle, Alink)
{
    document.write('<OBJECT id="objFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
    document.write('style="' + FlashStyle + '" viewastext>');
    document.write('<PARAM NAME="movie" VALUE=http://' + FlashPath + ' ref>');
    document.write('<PARAM NAME="quality" VALUE="high">');
    document.write('<PARAM NAME="Menu" VALUE="0">');
    document.write('<PARAM NAME="Scale" VALUE="ExactFit">');
    document.write('<PARAM NAME="BGColor" VALUE="#495A74">');
       if (Alink != "")
    {        
    document.write('<PARAM NAME="flashvars" VALUE="alink1=' + escape(Alink) + '">');
    }
    document.write('<embed src=http://' + FlashPath + ' scale="ExactFit" quality="high" bgcolor="#495A74" ');
    document.write('type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ');
    document.write('style="' + FlashStyle + '" FlashVars="alink1=' + escape(Alink) + '"></embed>');
    document.write('</object>');
}

function CreateExternalAdd (path)
{
var str = path.replace(/qe/g, "\"").replace(/qw/g, "\'").replace(/qr/g, "\,").replace(/scripta/g, "script");
 document.write(str);
}

function CreateTextAdd (text, link)
{
var str;
str = "<A HREF='" + link + "'>" + text + "</A>";
 
 document.write(str.replace(/qe/g, "\"").replace(/qw/g, "\'").replace(/qr/g, "\,").replace(/scripta/g, "script"));
}

function CreateImageAdd (image, link)
{
var str;
str = "<A HREF='" + link + "' class='shoreshimage'>";
str = str + "<IMG border=\"0\" alt='' src='" + image + "' />";
str = str + "</A>";
  
document.write(str);
} 

function showadd(arr)
{
if (arr[1]=="swf")
{ 
CreateActiveXFlash(arr[0], 'width: ' + arr[2] + 'px; height: ' + arr[3] + 'px' ,arr[4]);
}
else if (arr[1]=="ext")
{
 CreateExternalAdd (arr[0]);
}
else if (arr[1]=="txt")
{
 CreateTextAdd (arr[0], arr[4]);
}
else if (arr[1]=="jpg")
{
 CreateImageAdd (arr[0], arr[4]);
}
}
