<%
'' /**
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''  Script Name: screenad.js
''
''  Description: Manipulate the Flash Object and Display Big Ads
''
''  Author: Pablo Viquez Rogers
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Call: 
'<script language="JavaScript" src="js/screenad.js?affid=12&from=34&sub=56"></script>
'<script language="JavaScript">
'<!--
'LoadAll();
'//-->
'</script>

'' **/
Option Explicit
On Error Resume Next

Dim intAffid, intFrom, intSub, intTop, intLeft
intAffid	= Request.QueryString("affid")
intFrom		= Request.QueryString("from")
intSub		= Request.QueryString("sub")
intTop		= Request.QueryString("top")
intLeft		= Request.QueryString("left")

If Len(intAffid) = 0 Or Not IsNumeric(intAffid) Then
	intAffid = 0
End If

If Len(intFrom) = 0 Or Not IsNumeric(intFrom) Then
	intFrom = 0
End If

If Len(intSub) = 0 Or Not IsNumeric(intSub) Then
	intSub = 0
End If

If Len(intTop) = 0 Or Not IsNumeric(intTop) Then
	intTop = 50
End If

If Len(intLeft) = 0 Or Not IsNumeric(intLeft) Then
	intLeft = 50
End If

%>
var GObjLoaded = false;var GDivLoaded = false;var GDivIntLeft = <%=intLeft%>;var GDivIntTop = <%=intTop%>;var SWF_AdW = 360;var SWF_AdH = 510;var SWF_AdName = "vm_bunny.swf";var SWF_AdPath = "http://www.vegasmagic.com/ad/" + SWF_AdName;var GURL_To = "http://www.vegasmagic.com/remote/aiddownload.asp";var GintAffidId = <%=intAffid%>;var GintFromId = <%=intFrom%>;var GintSubId = <%=intSub%>;var GBolPlaying = false;var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;function SWF_Ad_DoFSCommand(command, args){var SWF_AdObj = InternetExplorer ? SWF_Ad : document.SWF_Ad;if(command == "window" && args == "open") GET_SWFClick();else{StopSWF_Ad();}}if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {document.write('<SCRIPT LANGUAGE=VBScript\> \n');document.write('on error resume next \n');document.write('Sub SWF_Ad_FSCommand(ByVal command, ByVal args)\n');document.write('call SWF_Ad_DoFSCommand(command, args)\n');document.write('end sub\n');document.write('</SCRIPT\> \n');}function LoadDiv(){if(!GDivLoaded){document.write('<div id=divSWFAd style="position: absolute; height:'+SWF_AdH+'; width: '+SWF_AdW+'; top: '+GDivIntTop+'; left: '+GDivIntLeft+'; visibility: hidden; display: inline; z-index: 102"></div>');GDivLoaded = true;}}function LoadSWFObj(){if(!GObjLoaded){divSWFAd.innerHTML = '<A HREF=FSCommand:website></A><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID=SWF_Ad WIDTH='+SWF_AdW+' HEIGHT='+SWF_AdH+' style="visibility: hidden; display: none"><PARAM NAME=movie VALUE='+SWF_AdPath+'><PARAM NAME=quality VALUE=autohigh><PARAM NAME=loop VALUE=false><param name=wmode value=transparent><param name=play value=false></OBJECT>';GObjLoaded = true;}}function LoadAll(bolPlay){LoadDiv();LoadSWFObj();if(bolPlay){PlaySWF_Ad();}}function PlaySWF_Ad(){if(!GBolPlaying){LoadDiv();LoadSWFObj();document.all.SWF_Ad.style.visibility = "visible";document.all.SWF_Ad.style.display = "inline";document.all.SWF_Ad.rewind();document.all.SWF_Ad.play();GBolPlaying = true;}}function StopSWF_Ad(){document.all.SWF_Ad.stop();document.all.SWF_Ad.style.visibility = "hidden";document.all.SWF_Ad.style.display = "none";document.all.SWF_Ad.style.visibility = "hidden";GBolPlaying = false;}function GET_SWFClick(){var strQuery = "";strQuery = (GintAffidId > 0) ? "?affid=" + GintAffidId : "";strQuery += (GintFromId > 0) ? ((strQuery == "") ? "?from=" + GintFromId : "&from=" + GintFromId) : "";strQuery += (GintSubId > 0) ? ((strQuery=="") ? "?sub=" + GintSubId : "&sub=" + GintSubId) : "";window.open(GURL_To + strQuery);}function PlayAd(){LoadAll();setTimeout("PlaySWF_Ad();",500);}PlayAd();