function go(){
closesymbolalignmentlines2.disabled=true
displaypositionspecifyline.disabled=true
document.spform.displaypositionspecifyxpos.disabled=true
document.spform.displaypositionspecifyypos.disabled=true
}


function includeclosebarchange(){

if(document.spform.includeclosebar.checked){
closebarlines.disabled=false
document.spform.closebarposition.disabled=false
document.spform.closebarbgcolor.disabled=false
document.spform.closesymbolcolor.disabled=false
closesymbolalignmenttable.disabled=false
closesymbolalignmentlines1.disabled=false
closesymbolalignmentlines2.disabled=false
closebarpositionchange()
}
else{
closebarlines.disabled=true
document.spform.closebarposition.disabled=true
document.spform.closebarbgcolor.disabled=true
document.spform.closesymbolcolor.disabled=true
closesymbolalignmenttable.disabled=true
closesymbolalignmentlines1.disabled=true
closesymbolalignmentlines2.disabled=true
}

}

var alreadychecked1=0
var alreadychecked2=0

function closebarpositionchange(){

alreadychecked1=0
alreadychecked2=0

if(document.spform.closebarposition.value=="top" || document.spform.closebarposition.value=="bottom"){
closesymbolalignmentlines1.disabled=false

for(var i=0;i<3;i++){
if(document.spform.closesymbolalignment[i].checked){
alreadychecked1=1
}
}

if(alreadychecked1==0){
document.spform.closesymbolalignment[2].checked=true
}

closesymbolalignmentlines2.disabled=true
}
else{
closesymbolalignmentlines1.disabled=true


for(var i=3;i<6;i++){
if(document.spform.closesymbolalignment[i].checked){
alreadychecked2=1
}
}

if(alreadychecked2==0){
document.spform.closesymbolalignment[4].checked=true
}

closesymbolalignmentlines2.disabled=false
}


}





function displaypositionchange(){

if(document.spform.displayposition.value=="10"){
displaypositionspecifyline.disabled=false
document.spform.displaypositionspecifyxpos.disabled=false
document.spform.displaypositionspecifyypos.disabled=false
}
else{
displaypositionspecifyline.disabled=true
document.spform.displaypositionspecifyxpos.disabled=true
document.spform.displaypositionspecifyypos.disabled=true
}

}




var incompletetot=0
var incompletelist

var formspopupcontenturl, formspopupwidth, formspopupheight
var formspopupborderstyle, formspopupborderthickness, formspopupbordercolor
var formincludeclosebar, formclosebarposition, formclosebarbgcolor
var formclosesymbolcolor, formclosesymbolalignment
var formdisplayposition, formdisplaypositionspecifyxpos, formdisplaypositionspecifyypos
var formnumberofspins, formspinstyle, formtimeperspin
var formdisplayfreq
var formdisplayfdays, formdisplayfhours, formdisplayfminutes, formdisplayfseconds


function validate(num){

incompletetot=0

incompletelist=""

formspopupcontenturl=document.spform.spopupcontenturl.value
formspopupwidth=document.spform.spopupwidth.value
formspopupwidth=formspopupwidth*1
formspopupheight=document.spform.spopupheight.value
formspopupheight=formspopupheight*1
formspopupborderstyle=document.spform.spopupborderstyle.value
formspopupborderthickness=document.spform.spopupborderthickness.value
formspopupbordercolor=document.spform.spopupbordercolor.value
formincludeclosebar=document.spform.includeclosebar.checked
formclosebarposition=document.spform.closebarposition.value
formclosebarbgcolor=document.spform.closebarbgcolor.value
formclosesymbolcolor=document.spform.closesymbolcolor.value


for(var i=0;i<document.spform.closesymbolalignment.length;i++){
if(document.spform.closesymbolalignment[i].checked){
if(i==0){
formclosesymbolalignment="left"
}
if(i==1){
formclosesymbolalignment="center"
}
if(i==2){
formclosesymbolalignment="right"
}
if(i==3){
formclosesymbolalignment="top"
}
if(i==4){
formclosesymbolalignment="center"
}
if(i==5){
formclosesymbolalignment="bottom"
}
}
}



formdisplayposition=document.spform.displayposition.value
formdisplaypositionspecifyxpos=document.spform.displaypositionspecifyxpos.value
formdisplaypositionspecifyypos=document.spform.displaypositionspecifyypos.value
formnumberofspins=document.spform.numberofspins.value
formspinstyle=document.spform.spinstyle.value
formtimeperspin=document.spform.timeperspin.value



for(var i=0;i<document.spform.displayfreq.length;i++){
if(document.spform.displayfreq[i].checked){
formdisplayfreq=i+1
}
}

formdisplayfdays=document.spform.displayfdays.value
formdisplayfhours=document.spform.displayfhours.value
formdisplayfminutes=document.spform.displayfminutes.value
formdisplayfseconds=document.spform.displayfseconds.value



if(!formspopupcontenturl){
incompletetot++
incompletelist+="- Spinning Popup Content URL\n"
}

if(!formspopupwidth){
incompletetot++
incompletelist+="- Spinning Popup Width\n"
}
else{
if(isNaN(formspopupwidth)){
incompletetot++
incompletelist+="- Spinning Popup Width\n"
}
}


if(!formspopupheight){
incompletetot++
incompletelist+="- Spinning Popup Height\n"
}
else{
if(isNaN(formspopupheight)){
incompletetot++
incompletelist+="- Spinning Popup Height\n"
}
}






if(formdisplayposition=="10"){
if(!formdisplaypositionspecifyxpos){
incompletetot++
incompletelist+="- Display Position (X-Pos)\n"
}
else{
if(isNaN(formdisplaypositionspecifyxpos)){
incompletetot++
incompletelist+="- Display Position (X-Pos)\n"
}
}
}


if(formdisplayposition=="10"){
if(!formdisplaypositionspecifyypos){
incompletetot++
incompletelist+="- Display Position (Y-Pos)\n"
}
else{
if(isNaN(formdisplaypositionspecifyypos)){
incompletetot++
incompletelist+="- Display Position (Y-Pos)\n"
}
}
}


formdisplaypositionspecifyxpos=formdisplaypositionspecifyxpos*1
formdisplaypositionspecifyypos=formdisplaypositionspecifyypos*1





if(incompletetot>0){

alert("*** Incomplete Form Submission ***\n\nPlease enter the following:\n\n"+incompletelist)

}
else{

if(num==1){
// Preview

if(!formincludeclosebar){
if(noclosewarning!=1){
noclosewarning=1
alert("You have set the Spinning Popup to *not* include a close bar.\n\nSo, in order to exit the preview, simply click anywhere on the preview Spinning Popup.")
}
}

preview()

}

if(num==2){
// Generate Code
generatecode()
}

}



}




var noclosewarning=0

var pvint




function preview(){


var selelm=document.getElementsByTagName("SELECT")
for(var a=0;a<selelm.length;a++){
selelm[a].style.visibility="hidden"
}

var prevhtml=""


if(formincludeclosebar){

if(formclosebarposition=="top"){

prevhtml+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
prevhtml+='<tr>\n'
prevhtml+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:hand;" valign=center align="'+formclosesymbolalignment+'" title="Close" onClick="previewclose()">\n'
prevhtml+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
prevhtml+='<tr><td>\n'
prevhtml+='<table border=0 style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;background-color:#FFFFFF;font-family:arial;font-size:10pt;"><tr><td align=center valign=center><b>Your Spinning Popup Content URL<br>will load here</b></td></tr></table></td>\n'
prevhtml+='</tr>\n'
prevhtml+='</table>\n'

}


if(formclosebarposition=="bottom"){

prevhtml+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
prevhtml+='<tr><td>\n'
prevhtml+='<table border=0 style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;background-color:#FFFFFF;font-family:arial;font-size:10pt;"><tr><td align=center valign=center><b>Your Spinning Popup Content URL<br>will load here</b></td></tr></table></td>\n'
prevhtml+='</tr>\n'
prevhtml+='<tr>\n'
prevhtml+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:hand;" valign=center align="'+formclosesymbolalignment+'" title="Close" onClick="previewclose()">\n'
prevhtml+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
prevhtml+='</table>\n'

}


if(formclosebarposition=="left"){

prevhtml+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
prevhtml+='<tr>\n'
prevhtml+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:hand;" align=center valign="'+formclosesymbolalignment+'" title="Close" onClick="previewclose()">\n'
prevhtml+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td>\n'
prevhtml+='<td>\n'
prevhtml+='<table border=0 style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;background-color:#FFFFFF;font-family:arial;font-size:10pt;"><tr><td align=center valign=center><b>Your Spinning Popup Content URL<br>will load here</b></td></tr></table></td>\n'
prevhtml+='</tr>\n'
prevhtml+='</table>\n'

}


if(formclosebarposition=="right"){

prevhtml+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
prevhtml+='<tr><td>\n'
prevhtml+='<table border=0 style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;background-color:#FFFFFF;font-family:arial;font-size:10pt;"><tr><td align=center valign=center><b>Your Spinning Popup Content URL<br>will load here</b></td></tr></table></td>\n'
prevhtml+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:hand;" align=center valign="'+formclosesymbolalignment+'" title="Close" onClick="previewclose()">\n'
prevhtml+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
prevhtml+='</table>\n'

}



}
else{


prevhtml+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';"><tr><td onClick="previewclose()">\n'
prevhtml+='<table border=0 style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;background-color:#FFFFFF;font-family:arial;font-size:10pt;"><tr><td align=center valign=center><b>Your Spinning Popup Content URL<br>will load here</b></td></tr></table>\n'
prevhtml+='</td></tr></table>\n'



}


closestarted=0

goon=1






previewad.innerHTML=prevhtml


fullspopupwidth=previewad.offsetWidth+(formspopupborderthickness*2)
fullspopupheight=previewad.offsetHeight+(formspopupborderthickness*2)


previewad.style.visibility="visible"

previewad.style.filter="progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')"


deg=0

totspins=formnumberofspins
timeperspin=formtimeperspin
maxdeg=totspins*360
sizemult=0



previewspin()
pvspinint=setInterval("previewspin()",100)





}
// end preview

var goon=0


var pvspinint, pvscrollint

var deg, totspins, timeperspin, maxdeg


var fullspopupwidth, fullspopupheight




function previewspin(){

rad=deg*Math.PI/180
cosval=Math.cos(rad)
sinval=Math.sin(rad)

if(deg<=maxdeg){

previewad.filters.item(0).M11=cosval

if(formspinstyle=="1"){
previewad.filters.item(0).M12=-sinval
previewad.filters.item(0).M21=sinval
}

if(formspinstyle=="2"){
previewad.filters.item(0).M12=sinval
previewad.filters.item(0).M21=-sinval
}

if(formspinstyle=="3"){
previewad.filters.item(0).M12=-sinval
previewad.filters.item(0).M21=-sinval
}

if(formspinstyle=="4"){
previewad.filters.item(0).M12=sinval
previewad.filters.item(0).M21=sinval
}


previewad.filters.item(0).M22=cosval

sizechange()

}
else{
spindone=1
previewad.style.filter=""
clearInterval(pvspinint)
}

deg+=36/timeperspin

previewscroll()

}



var sizemult

function sizechange(){


previewad.filters.item(0).M11*=sizemult
previewad.filters.item(0).M12*=sizemult
previewad.filters.item(0).M21*=sizemult
previewad.filters.item(0).M22*=sizemult
if(sizemult<1){
sizemult+=0.1/(timeperspin*totspins)
}
else{
sizemult=1
}



}




var spx, spy, spindone=0



function previewscroll(){

var bodywidth=document.body.clientWidth
var bodyheight=document.body.clientHeight


if(formdisplayposition=="1"){
spx=5
spy=5
}

if(formdisplayposition=="2"){
spx=Math.round((bodywidth-fullspopupwidth)/2)
spy=5
}

if(formdisplayposition=="3"){
spx=bodywidth-fullspopupwidth-5
spy=5
}

if(formdisplayposition=="4"){
spx=5
spy=Math.round((bodyheight-fullspopupheight)/2)
}

if(formdisplayposition=="5"){
spx=Math.round((bodywidth-fullspopupwidth)/2)
spy=Math.round((bodyheight-fullspopupheight)/2)
}

if(formdisplayposition=="6"){
spx=bodywidth-fullspopupwidth-5
spy=Math.round((bodyheight-fullspopupheight)/2)
}

if(formdisplayposition=="7"){
spx=5
spy=bodyheight-fullspopupheight-5
}

if(formdisplayposition=="8"){
spx=Math.round((bodywidth-fullspopupwidth)/2)
spy=bodyheight-fullspopupheight-5
}

if(formdisplayposition=="9"){
spx=bodywidth-fullspopupwidth-5
spy=bodyheight-fullspopupheight-5
}

if(formdisplayposition=="10"){
spx=formdisplaypositionspecifyxpos
spy=formdisplaypositionspecifyypos
}


spx=spx*1+(fullspopupwidth-previewad.offsetWidth-(formspopupborderthickness*2))/2
spy=spy*1+(fullspopupheight-previewad.offsetHeight-(formspopupborderthickness*2))/2

previewad.style.left=spx*1+document.body.scrollLeft
previewad.style.top=spy*1+document.body.scrollTop

if(closestarted!=1){
setTimeout("previewscroll()",100)
}

}




var closestarted=0

function previewclose(){
if(closestarted!=1){


closestarted=1
goon=0

previewad.style.visibility="hidden"

var selelm=document.getElementsByTagName("SELECT")
for(var a=0;a<selelm.length;a++){
selelm[a].style.visibility="visible"
}



}

}




function generatecode(){


var selelm=document.getElementsByTagName("SELECT")
for(var a=0;a<selelm.length;a++){
selelm[a].style.visibility="hidden"
}

var gencodehtml=""

gencodehtml+='<table width=100% height=100% border=0><tr valign=center><td>\n'
gencodehtml+='<center>\n'
gencodehtml+='<font face="verdana,arial,helvetica" style="font-size:20pt;color:#D60000;">\n'
gencodehtml+='<b>Generating Code...\n'
gencodehtml+='</b>\n'
gencodehtml+='</font>\n'
gencodehtml+='</center>\n'
gencodehtml+='</td></tr></table>\n'

gencodebox.style.visibility="visible"
gencodebox.style.top=document.body.scrollTop
gencodebox.style.left=document.body.scrollLeft
gencodebox.style.width=document.body.clientWidth
gencodebox.style.height=document.body.clientHeight
gencodebox.style.backgroundColor="#FFCCCC"
gencodebox.innerHTML=gencodehtml

getcode()


setTimeout("gencode2()",2000)


}



function gencode2(){

var gencodehtml=""

gencodehtml+='<table width=100% height=100% border=0><tr valign=center><td>\n'
gencodehtml+='<center>\n'
gencodehtml+='<font face="verdana,arial,helvetica" style="font-size:20pt;color:#FFFFFF;">\n'
gencodehtml+='<b>Code Generated</b></font><BR><BR><BR>\n'
gencodehtml+='<font face="verdana,arial,helvetica" style="font-size:12pt;color:#FFCCCC;">\n'
gencodehtml+='[Get Installation Instructions Below]</font>\n'
gencodehtml+='</center>\n'
gencodehtml+='</td></tr></table>\n'

gencodebox.style.backgroundColor="#D60000"
gencodebox.innerHTML=gencodehtml

setTimeout("gencode3()",3000)

}


function gencode3(){

gencodebox.style.width="0px"
gencodebox.style.height="0px"
gencodebox.innerHTML=""
gencodebox.style.visibility="hidden"

var selelm=document.getElementsByTagName("SELECT")
for(var a=0;a<selelm.length;a++){
selelm[a].style.visibility="visible"
}


}



function getcode(){

var tnow=new Date()
randckname="sp"+tnow.getTime()



var codetxt1=""


codetxt1+='<div id="'+randckname+'spbox" style="position:absolute;z-index:75;visibility:hidden;top:-1000px;left:-1000px;filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\');">\n'


if(formincludeclosebar){

if(formclosebarposition=="top"){

codetxt1+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
codetxt1+='<tr>\n'
codetxt1+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:pointer;cursor:hand;" valign=center align="'+formclosesymbolalignment+'" title="Close" onClick="'+randckname+'close()">\n'
codetxt1+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
codetxt1+='<tr><td>\n'
codetxt1+='<iframe src="'+formspopupcontenturl+'" style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;" allowtransparency="true" border=0 scrolling="auto" frameborder=0></iframe></td>\n'
codetxt1+='</tr>\n'
codetxt1+='</table>\n'

}


if(formclosebarposition=="bottom"){

codetxt1+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
codetxt1+='<tr><td>\n'
codetxt1+='<iframe src="'+formspopupcontenturl+'" style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;" allowtransparency="true" border=0 scrolling="auto" frameborder=0></iframe></td>\n'
codetxt1+='</tr>\n'
codetxt1+='<tr>\n'
codetxt1+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:pointer;cursor:hand;" valign=center align="'+formclosesymbolalignment+'" title="Close" onClick="'+randckname+'close()">\n'
codetxt1+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
codetxt1+='</table>\n'

}


if(formclosebarposition=="left"){

codetxt1+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
codetxt1+='<tr>\n'
codetxt1+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:pointer;cursor:hand;" align=center valign="'+formclosesymbolalignment+'" title="Close" onClick="'+randckname+'close()">\n'
codetxt1+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td>\n'
codetxt1+='<td>\n'
codetxt1+='<iframe src="'+formspopupcontenturl+'" style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;" allowtransparency="true" border=0 scrolling="auto" frameborder=0></iframe></td>\n'
codetxt1+='</tr>\n'
codetxt1+='</table>\n'

}


if(formclosebarposition=="right"){

codetxt1+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';">\n'
codetxt1+='<tr><td>\n'
codetxt1+='<iframe src="'+formspopupcontenturl+'" style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;" allowtransparency="true" border=0 scrolling="auto" frameborder=0></iframe></td>\n'
codetxt1+='<td bgcolor="'+formclosebarbgcolor+'" style="cursor:pointer;cursor:hand;" align=center valign="'+formclosesymbolalignment+'" title="Close" onClick="'+randckname+'close()">\n'
codetxt1+='<span style="font-family:verdana;font-size:8pt;color:'+formclosesymbolcolor+';">&#215;</span></td></tr>\n'
codetxt1+='</table>\n'

}



}
else{

codetxt1+='<table border=0 cellpadding=0 cellspacing=0 style="border:'+formspopupborderthickness+'px '+formspopupborderstyle+' '+formspopupbordercolor+';"><tr><td onClick="'+randckname+'close()">\n'
codetxt1+='<iframe src="'+formspopupcontenturl+'" style="width:'+formspopupwidth+'px;height:'+formspopupheight+'px;" allowtransparency="true" border=0 scrolling="auto" frameborder=0></iframe>\n'
codetxt1+='</td></tr></table>\n'

}




codetxt1+='</div>\n'




codetxt1+='\<script\>\n'


codetxt1+='function '+randckname+'spgo(){\n'


codetxt1+=randckname+'closestarted=0\n'

codetxt1+=randckname+'goon=1\n'


codetxt1+=randckname+'fullspopupwidth=document.getElementById("'+randckname+'spbox").offsetWidth+'+(formspopupborderthickness*2)+'\n'
codetxt1+=randckname+'fullspopupheight=document.getElementById("'+randckname+'spbox").offsetHeight+'+(formspopupborderthickness*2)+'\n'


codetxt1+='document.getElementById("'+randckname+'spbox").style.visibility="visible"\n'


codetxt1+=randckname+'deg=0\n'

codetxt1+=randckname+'totspins='+formnumberofspins+'\n'
codetxt1+=randckname+'timeperspin='+formtimeperspin+'\n'
codetxt1+=randckname+'maxdeg='+randckname+'totspins*360\n'
codetxt1+=randckname+'sizemult=0\n'


//b moz
codetxt1+='if('+randckname+'moz){\n'
codetxt1+=randckname+'scroll()\n'
codetxt1+='}\n'
codetxt1+='else{\n'
//e moz

codetxt1+=randckname+'spin()\n'
codetxt1+=randckname+'spinint=setInterval("'+randckname+'spin()",100)\n'


//b moz
codetxt1+='}\n'
//e moz


codetxt1+='}\n'




codetxt1+='var '+randckname+'goon=0\n'


codetxt1+='var '+randckname+'spinint, '+randckname+'scrollint\n'

codetxt1+='var '+randckname+'deg, '+randckname+'totspins, '+randckname+'timeperspin, '+randckname+'maxdeg\n'


codetxt1+='var '+randckname+'fullspopupwidth, '+randckname+'fullspopupheight\n'




codetxt1+='function '+randckname+'spin(){\n'

codetxt1+=randckname+'rad='+randckname+'deg*Math.PI/180\n'
codetxt1+=randckname+'cosval=Math.cos('+randckname+'rad)\n'
codetxt1+=randckname+'sinval=Math.sin('+randckname+'rad)\n'

codetxt1+='if('+randckname+'deg<='+randckname+'maxdeg){\n'

codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M11='+randckname+'cosval\n'

if(formspinstyle=="1"){
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M12=-'+randckname+'sinval\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M21='+randckname+'sinval\n'
}

if(formspinstyle=="2"){
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M12='+randckname+'sinval\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M21=-'+randckname+'sinval\n'
}

if(formspinstyle=="3"){
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M12=-'+randckname+'sinval\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M21=-'+randckname+'sinval\n'
}

if(formspinstyle=="4"){
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M12='+randckname+'sinval\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M21='+randckname+'sinval\n'
}


codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M22='+randckname+'cosval\n'

codetxt1+=randckname+'sizechange()\n'

codetxt1+='}\n'
codetxt1+='else{\n'
codetxt1+=randckname+'spindone=1\n'
codetxt1+='document.getElementById("'+randckname+'spbox").style.filter=""\n'
codetxt1+='clearInterval('+randckname+'spinint)\n'
codetxt1+='}\n'

codetxt1+=randckname+'deg+=36/'+randckname+'timeperspin\n'

codetxt1+=randckname+'scroll()\n'

codetxt1+='}\n'



codetxt1+='var '+randckname+'sizemult\n'

codetxt1+='function '+randckname+'sizechange(){\n'


codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M11*='+randckname+'sizemult\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M12*='+randckname+'sizemult\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M21*='+randckname+'sizemult\n'
codetxt1+='document.getElementById("'+randckname+'spbox").filters.item(0).M22*='+randckname+'sizemult\n'
codetxt1+='if('+randckname+'sizemult<1){\n'
codetxt1+=randckname+'sizemult+=0.1/('+randckname+'timeperspin*'+randckname+'totspins)\n'
codetxt1+='}\n'
codetxt1+='else{\n'
codetxt1+=randckname+'sizemult=1\n'
codetxt1+='}\n'



codetxt1+='}\n'




codetxt1+='var '+randckname+'spx, '+randckname+'spy, '+randckname+'spindone=0\n'



codetxt1+='function '+randckname+'scroll(){\n'


//b moz
codetxt1+='if('+randckname+'moz){\n'


codetxt1+='var '+randckname+'bodywidth=self.innerWidth-20\n'
codetxt1+='var '+randckname+'bodyheight=self.innerHeight-20\n'


if(formdisplayposition=="1"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="2"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-'+randckname+'fullspopupwidth)/2)\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="3"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="4"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy=Math.round(('+randckname+'bodyheight-'+randckname+'fullspopupheight)/2)\n'
}

if(formdisplayposition=="5"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-'+randckname+'fullspopupwidth)/2)\n'
codetxt1+=randckname+'spy=Math.round(('+randckname+'bodyheight-'+randckname+'fullspopupheight)/2)\n'
}

if(formdisplayposition=="6"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy=Math.round((bodyheight-'+randckname+'fullspopupheight)/2)\n'
}

if(formdisplayposition=="7"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="8"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-'+randckname+'fullspopupwidth)/2)\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="9"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="10"){
codetxt1+=randckname+'spx='+formdisplaypositionspecifyxpos+'\n'
codetxt1+=randckname+'spy='+formdisplaypositionspecifyypos+'\n'
}


codetxt1+=randckname+'spx='+randckname+'spx*1+('+randckname+'fullspopupwidth-document.getElementById("'+randckname+'spbox").offsetWidth-'+(formspopupborderthickness*2)+')/2\n'
codetxt1+=randckname+'spy='+randckname+'spy*1+('+randckname+'fullspopupheight-document.getElementById("'+randckname+'spbox").offsetHeight-'+(formspopupborderthickness*2)+')/2\n'

codetxt1+='document.getElementById("'+randckname+'spbox").style.left='+randckname+'spx*1+self.pageXOffset\n'
codetxt1+='document.getElementById("'+randckname+'spbox").style.top='+randckname+'spy*1+self.pageYOffset\n'



codetxt1+='}\n'
codetxt1+='else{\n'
//e moz


codetxt1+='var '+randckname+'bodywidth=document.body.clientWidth\n'
codetxt1+='var '+randckname+'bodyheight=document.body.clientHeight\n'


if(formdisplayposition=="1"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="2"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-'+randckname+'fullspopupwidth)/2)\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="3"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy=5\n'
}

if(formdisplayposition=="4"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy=Math.round(('+randckname+'bodyheight-'+randckname+'fullspopupheight)/2)\n'
}

if(formdisplayposition=="5"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-'+randckname+'fullspopupwidth)/2)\n'
codetxt1+=randckname+'spy=Math.round(('+randckname+'bodyheight-'+randckname+'fullspopupheight)/2)\n'
}

if(formdisplayposition=="6"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy=Math.round((bodyheight-fullspopupheight)/2)\n'
}

if(formdisplayposition=="7"){
codetxt1+=randckname+'spx=5\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="8"){
codetxt1+=randckname+'spx=Math.round(('+randckname+'bodywidth-fullspopupwidth'+randckname+')/2)\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="9"){
codetxt1+=randckname+'spx='+randckname+'bodywidth-'+randckname+'fullspopupwidth-5\n'
codetxt1+=randckname+'spy='+randckname+'bodyheight-'+randckname+'fullspopupheight-5\n'
}

if(formdisplayposition=="10"){
codetxt1+=randckname+'spx='+formdisplaypositionspecifyxpos+'\n'
codetxt1+=randckname+'spy='+formdisplaypositionspecifyypos+'\n'
}


codetxt1+=randckname+'spx='+randckname+'spx*1+('+randckname+'fullspopupwidth-'+randckname+'spbox.offsetWidth-'+(formspopupborderthickness*2)+')/2\n'
codetxt1+=randckname+'spy='+randckname+'spy*1+('+randckname+'fullspopupheight-'+randckname+'spbox.offsetHeight-'+(formspopupborderthickness*2)+')/2\n'

codetxt1+=randckname+'spbox.style.left='+randckname+'spx*1+document.body.scrollLeft\n'
codetxt1+=randckname+'spbox.style.top='+randckname+'spy*1+document.body.scrollTop\n'


//b moz
codetxt1+='}\n'
//e moz


codetxt1+='if('+randckname+'closestarted!=1){\n'
codetxt1+='setTimeout("'+randckname+'scroll()",100)\n'
codetxt1+='}\n'


codetxt1+='}\n'




codetxt1+='var '+randckname+'closestarted=0\n'

codetxt1+='function '+randckname+'close(){\n'
codetxt1+='if('+randckname+'closestarted!=1){\n'


codetxt1+=randckname+'closestarted=1\n'
codetxt1+=randckname+'goon=0\n'

codetxt1+='document.getElementById("'+randckname+'spbox").style.visibility="hidden"\n'

codetxt1+='var selelm=document.getElementsByTagName("SELECT")\n'
codetxt1+='for(var a=0;a<selelm.length;a++){\n'
codetxt1+='selelm[a].style.visibility="visible"\n'
codetxt1+='}\n'



codetxt1+='}\n'

codetxt1+='}\n'






var cooklines='function '+randckname+'getCookieVal (offset) {\n'
cooklines+='var endstr = document.cookie.indexOf (";", offset);\n'
cooklines+='if (endstr == -1)\n'
cooklines+='endstr = document.cookie.length;\n'
cooklines+='return unescape(document.cookie.substring(offset, endstr));\n'
cooklines+='}\n'

cooklines+='function '+randckname+'GetCookie (name) {\n'
cooklines+='var arg = name + "=";\n'
cooklines+='var alen = arg.length;\n'
cooklines+='var clen = document.cookie.length;\n'
cooklines+='var i = 0;\n'
cooklines+='while (i < clen) {\n'
cooklines+='var j = i + alen;\n'
cooklines+='if (document.cookie.substring(i, j) == arg)\n'
cooklines+='return '+randckname+'getCookieVal (j);\n'
cooklines+='i = document.cookie.indexOf(" ", i) + 1;\n'
cooklines+='if (i == 0) break; \n'
cooklines+='}\n'
cooklines+='return null;\n'
cooklines+='}\n'

if(formdisplayfreq!=1){
codetxt1+=cooklines
}

codetxt1+='function '+randckname+'spongo(){\n'
codetxt1+=randckname+'spgo()\n'
codetxt1+='}\n'



codetxt1+='var '+randckname+'temp\n'
codetxt1+='var '+randckname+'browsversion=0\n'

//b moz
codetxt1+='var '+randckname+'moz=false\n'
//e moz

codetxt1+='if (navigator.appVersion.indexOf("MSIE")!=-1){\n'
codetxt1+=randckname+'temp=navigator.appVersion.split("MSIE")\n'
codetxt1+=randckname+'browsversion=parseFloat('+randckname+'temp[1])\n'
codetxt1+='}\n'
codetxt1+='if ('+randckname+'browsversion>=5.5){\n'

if(formdisplayfreq!=1){

codetxt1+='var '+randckname+'freqcook='+randckname+'GetCookie("'+randckname+'")\n'
codetxt1+='if(!'+randckname+'freqcook){\n'


if(formdisplayfreq==2){
codetxt1+='document.cookie="'+randckname+'=Y"\n'
}

if(formdisplayfreq==3){
var expdays=formdisplayfdays*86400
var exphours=formdisplayfhours*3600
var expminutes=formdisplayfminutes*60
var expseconds=formdisplayfseconds*1
var expall=expdays+exphours+expminutes+expseconds
codetxt1+='var exp=new Date()\n'
codetxt1+='var sometimefromnow=exp.getTime() + ('+expall+'*1000)\n'
codetxt1+='exp.setTime(sometimefromnow)\n'
codetxt1+='document.cookie="'+randckname+'=Y; expires="\+exp.toGMTString()\n'
}





codetxt1+='window.onload='+randckname+'spongo\n'



codetxt1+='}\n'

}
else{



codetxt1+='window.onload='+randckname+'spongo\n'






}


codetxt1+='}\n'



//b moz
codetxt1+='else{\n'
codetxt1+='if(!document.all && document.getElementById && document.getElementById("'+randckname+'spbox").innerHTML){\n'
codetxt1+=randckname+'moz=true\n'

if(formdisplayfreq!=1){

codetxt1+='var '+randckname+'freqcook='+randckname+'GetCookie("'+randckname+'")\n'
codetxt1+='if(!'+randckname+'freqcook){\n'


if(formdisplayfreq==2){
codetxt1+='document.cookie="'+randckname+'=Y"\n'
}

if(formdisplayfreq==3){
var expdays=formdisplayfdays*86400
var exphours=formdisplayfhours*3600
var expminutes=formdisplayfminutes*60
var expseconds=formdisplayfseconds*1
var expall=expdays+exphours+expminutes+expseconds
codetxt1+='var exp=new Date()\n'
codetxt1+='var sometimefromnow=exp.getTime() + ('+expall+'*1000)\n'
codetxt1+='exp.setTime(sometimefromnow)\n'
codetxt1+='document.cookie="'+randckname+'=Y; expires="\+exp.toGMTString()\n'
}





codetxt1+='window.onload='+randckname+'spongo\n'





codetxt1+='}\n'

}
else{



codetxt1+='window.onload='+randckname+'spongo\n'





}


codetxt1+='}\n'
codetxt1+='}\n'
//e moz



codetxt1+='\<\/script\>\n'




document.codeform.box1.value=codetxt1


// Close link code
document.codeform.closelink.value='<a href="javascript:parent.'+randckname+'close()">Close</a>'








}
// end getcode

