// Begin Popup Window

var svfunct

window.onload=popupwinpos

function popupwinpos(){

if(document.popupsettingsform.popupwindowposition.value=="10"){
popupspecifypos.disabled=false
document.popupsettingsform.popupxpos.disabled=false
document.popupsettingsform.popupypos.disabled=false
}
else{
popupspecifypos.disabled=true
document.popupsettingsform.popupxpos.disabled=true
document.popupsettingsform.popupypos.disabled=true
}

}

function popupltchange(){

popupsvdelays.disabled=false
document.popupsettingsform.popuplaunchtimedelayminutes.disabled=false
document.popupsettingsform.popuplaunchtimedelayseconds.disabled=false

popupspecifypos.disabled=false
document.popupsettingsform.popupxpos.disabled=false
document.popupsettingsform.popupypos.disabled=false

popupdispfreq.disabled=false
document.popupsettingsform.popupfreq.disabled=false
document.popupsettingsform.popupfdays.disabled=false
document.popupsettingsform.popupfhours.disabled=false
document.popupsettingsform.popupfminutes.disabled=false
document.popupsettingsform.popupfseconds.disabled=false

if(document.popupsettingsform.popuplaunchtrigger.value=="pageexit"){
popupsvdelays.disabled=true
document.popupsettingsform.popuplaunchtimedelayminutes.disabled=true
document.popupsettingsform.popuplaunchtimedelayseconds.disabled=true
}
else{

if(document.popupsettingsform.popuplaunchtrigger.value=="linkclick"){

popupsvdelays.disabled=true
document.popupsettingsform.popuplaunchtimedelayminutes.disabled=true
document.popupsettingsform.popuplaunchtimedelayseconds.disabled=true


popupdispfreq.disabled=true
document.popupsettingsform.popupfreq.disabled=true
document.popupsettingsform.popupfdays.disabled=true
document.popupsettingsform.popupfhours.disabled=true
document.popupsettingsform.popupfminutes.disabled=true
document.popupsettingsform.popupfseconds.disabled=true

}


}

popupwinpos()

}




var formpopuplaunchtrigger, popupsvtlaunchdelaytime


function popupgetcode(){

// check for incomplete fields

formpopuplaunchtrigger=document.popupsettingsform.popuplaunchtrigger.value

formpopupwidth=document.popupsettingsform.popupwidth.value
formpopupheight=document.popupsettingsform.popupheight.value
formpopuppageurl=document.popupsettingsform.popuppageurl.value
formpopupstyle=document.popupsettingsform.popupstyle.value
formpopupmenubar=document.popupsettingsform.popupmenubar.checked
formpopuptoolbar=document.popupsettingsform.popuptoolbar.checked
formpopuplocationbar=document.popupsettingsform.popuplocationbar.checked
formpopupdirectories=document.popupsettingsform.popupdirectories.checked
formpopupstatusbar=document.popupsettingsform.popupstatusbar.checked
formpopupscrollbars=document.popupsettingsform.popupscrollbars.checked
formpopupresizable=document.popupsettingsform.popupresizable.checked
formpopupwindowposition=document.popupsettingsform.popupwindowposition.value
formpopupxpos=document.popupsettingsform.popupxpos.value
formpopupypos=document.popupsettingsform.popupypos.value




var inctot=0

var inclist=""


if(!formpopupwidth){
inctot++
inclist+="- Width\n"
}

if(!formpopupheight){
inctot++
inclist+="- Height\n"
}

if(!formpopuppageurl){
inctot++
inclist+="- Page URL\n"
}

if(formpopupwindowposition=="10"){

if(!formpopupxpos){
inctot++
inclist+="- X-Position\n"
}

if(!formpopupypos){
inctot++
inclist+="- Y-Position\n"
}

}



if(inctot>0){
// Incomplete
alert("You must enter the following before you can get the Popup window code...\n\n"+inclist)
}
else{
// Get Code




if(formpopuplaunchtrigger=="scrollview"){

popupsvtlaunchdelaytime=(document.popupsettingsform.popuplaunchtimedelayminutes.value*60)+(document.popupsettingsform.popuplaunchtimedelayseconds.value*1)
popupsvtlaunchdelaytime=popupsvtlaunchdelaytime*1000



var tnow=new Date()
var randckname="popup"+tnow.getTime()

var codetxt='<a href="javascript:'+randckname+'svtpopup2()" id="'+randckname+'lk" style="visibility:hidden;"></a>\n'



codetxt+='\<script\>\n'

var popupwinatt="width="+formpopupwidth+",height="+formpopupheight+","

if(formpopupmenubar){
popupwinatt+="menubar=1,"
}
else{
popupwinatt+="menubar=0,"
}

if(formpopuptoolbar){
popupwinatt+="toolbar=1,"
}
else{
popupwinatt+="toolbar=0,"
}

if(formpopuplocationbar){
popupwinatt+="location=1,"
}
else{
popupwinatt+="location=0,"
}

if(formpopupdirectories){
popupwinatt+="directories=1,"
}
else{
popupwinatt+="directories=0,"
}

if(formpopupstatusbar){
popupwinatt+="status=1,"
}
else{
popupwinatt+="status=0,"
}

if(formpopupscrollbars){
popupwinatt+="scrollbars=1,"
}
else{
popupwinatt+="scrollbars=0,"
}

if(formpopupresizable){
popupwinatt+="resizable=1"
}
else{
popupwinatt+="resizable=0"
}

codetxt+='var popupwinatt="'+popupwinatt+'"\n'
codetxt+='var popuptoppos, popupleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formpopupwindowposition=="1"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=0\n'

}

if(formpopupwindowposition=="2"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="3"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="4"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="5"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="6"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="7"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="8"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="9"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="10"){
codetxt+='popuptoppos='+formpopupypos+'\n'
codetxt+='popupleftpos='+formpopupxpos+'\n'
}

codetxt+='popupwinatt+=",top="+popuptoppos+"px,"\n'
codetxt+='popupwinatt+="left="+popupleftpos+"px"\n'



codetxt+='var '+randckname+'svgodone=0\n'
codetxt+='var '+randckname+'svwinh\n'
codetxt+='var '+randckname+'svgostart=0\n'


codetxt+='function '+randckname+'svgo(){\n'
codetxt+='if('+randckname+'svgostart==1){\n'
codetxt+='if(document.all.svtrigger'+randckname+'){\n'
codetxt+=randckname+'svwinh=document.all.svtrigger'+randckname+'.offsetTop-document.body.clientHeight\n'
codetxt+='if('+randckname+'svgodone!=1){\n'
codetxt+='if(document.body.scrollTop>='+randckname+'svwinh){\n'

codetxt+='if(document.all.svtrigger2'+randckname+'){\n'
codetxt+=randckname+'svwinh2=document.all.svtrigger2'+randckname+'.offsetTop-document.body.clientHeight\n'
codetxt+='if(document.body.scrollTop<='+randckname+'svwinh2){\n'

codetxt+=randckname+'svgodone=1\n'

if(popupsvtlaunchdelaytime==0){
codetxt+=randckname+'svtpopup()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtpopup()",'+popupsvtlaunchdelaytime+')\n'
}

codetxt+='}\n'
codetxt+='}\n'
codetxt+='else{\n'

codetxt+=randckname+'svgodone=1\n'

if(popupsvtlaunchdelaytime==0){
codetxt+=randckname+'svtpopup()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtpopup()",'+popupsvtlaunchdelaytime+')\n'
}


codetxt+='}\n'

codetxt+='}\n'

codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'


codetxt+='function '+randckname+'svtpopup(){\n'
codetxt+=randckname+'lk.click()\n'
codetxt+='}\n'




codetxt+='function '+randckname+'svtpopup2(){\n'


if(formpopupstyle=="1"){

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","",popupwinatt)\n'

}
else{

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","",popupwinatt)\n'
codetxt+='self.focus()\n'
codetxt+='popupwin.blur()\n'


}




codetxt+='}\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'



for(var i=0;i<document.popupsettingsform.popupfreq.length;i++){
if(document.popupsettingsform.popupfreq[i].checked){
var popupfreq=i+1
}
}



codetxt+='var browsversion=0\n'
codetxt+='if (navigator.appVersion.indexOf("MSIE")!=-1){\n'
codetxt+='temp=navigator.appVersion.split("MSIE")\n'
codetxt+='browsversion=parseFloat(temp[1])\n'
codetxt+='}\n'

codetxt+='if (browsversion>=5.5){\n'


if(popupfreq!=1){
codetxt+=cooklines
codetxt+='var '+randckname+'svfreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'svfreqcook){\n'



if(popupfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(popupfreq==3){
var expdays=(document.popupsettingsform.popupfdays.value)*86400
var exphours=(document.popupsettingsform.popupfhours.value)*3600
var expminutes=(document.popupsettingsform.popupfminutes.value)*60
var expseconds=(document.popupsettingsform.popupfseconds.value)*1
var expall=expdays+exphours+expminutes+expseconds
codetxt+='var svexp=new Date()\n'
codetxt+='var svsometimefromnow=svexp.getTime() + ('+expall+'*1000)\n'
codetxt+='svexp.setTime(svsometimefromnow)\n'
codetxt+='document.cookie="'+randckname+'=Y; expires="\+svexp.toGMTString()\n'
}

codetxt+='}\n'

}
else{





}


codetxt+=randckname+'svgostart=1\n'
codetxt+='setInterval("'+randckname+'svgo()",10)\n'


codetxt+='}\n'

codetxt+='\<\/script\>\n'



document.scrollviewform.code1.value=codetxt
document.scrollviewform.code2.value='<a id="svtrigger'+randckname+'" style="position:relative;"></a>'
document.scrollviewform.code2bot.value='<a id="svtrigger2'+randckname+'" style="position:relative;"></a>'

svfunct="cd"+randckname

svcntgetcode()


document.all.popupgetcodetab.style.border="1px solid #000000"
document.all.popupsettingstab.style.border="1px solid #808080"

document.all.popupgetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.popupsettingstab.style.borderBottom="1px solid #000000"

document.all.popupgetcodetab.style.backgroundColor="#99CCFF"
document.all.popupsettingstab.style.backgroundColor="#DCDCDC"

document.all.popupgetcodetab.style.color="#000000"
document.all.popupsettingstab.style.color="#808080"

document.all.popupsettingstab.style.zIndex=0
document.all.popupgetcodetab.style.zIndex=2

document.all.popupsettingsbox.style.visibility="hidden"
document.all.linkclickgetcodebox.style.visibility="hidden"
document.all.pageexitgetcodebox.style.visibility="hidden"
document.all.scrollviewgetcodebox.style.visibility="visible"





}
// end scrollview launch trigger





if(formpopuplaunchtrigger=="pageexit"){



var tnow=new Date()
var randckname="popup"+tnow.getTime()

var codetxt=""


codetxt='\<script\>\n'

var popupwinatt="width="+formpopupwidth+",height="+formpopupheight+","

if(formpopupmenubar){
popupwinatt+="menubar=1,"
}
else{
popupwinatt+="menubar=0,"
}

if(formpopuptoolbar){
popupwinatt+="toolbar=1,"
}
else{
popupwinatt+="toolbar=0,"
}

if(formpopuplocationbar){
popupwinatt+="location=1,"
}
else{
popupwinatt+="location=0,"
}

if(formpopupdirectories){
popupwinatt+="directories=1,"
}
else{
popupwinatt+="directories=0,"
}

if(formpopupstatusbar){
popupwinatt+="status=1,"
}
else{
popupwinatt+="status=0,"
}

if(formpopupscrollbars){
popupwinatt+="scrollbars=1,"
}
else{
popupwinatt+="scrollbars=0,"
}

if(formpopupresizable){
popupwinatt+="resizable=1"
}
else{
popupwinatt+="resizable=0"
}

codetxt+='var popupwinatt="'+popupwinatt+'"\n'
codetxt+='var popuptoppos, popupleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formpopupwindowposition=="1"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=0\n'

}

if(formpopupwindowposition=="2"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="3"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="4"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="5"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="6"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="7"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="8"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="9"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="10"){
codetxt+='popuptoppos='+formpopupypos+'\n'
codetxt+='popupleftpos='+formpopupxpos+'\n'
}

codetxt+='popupwinatt+=",top="+popuptoppos+"px,"\n'
codetxt+='popupwinatt+="left="+popupleftpos+"px"\n'



codetxt+='var peoff=0\n'


codetxt+='function '+randckname+'pego(){\n'
codetxt+='if(peoff==0){\n'

if(formpopupstyle=="1"){

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","","'+popupwinatt+'")\n'

}
else{

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","","'+popupwinatt+'")\n'
codetxt+='self.focus()\n'
codetxt+='popupwin.blur()\n'


}


codetxt+='}\n'
codetxt+='}\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'



for(var i=0;i<document.popupsettingsform.popupfreq.length;i++){
if(document.popupsettingsform.popupfreq[i].checked){
var popupfreq=i+1
}
}


if(popupfreq!=1){
codetxt+=cooklines
}

codetxt+='var browsversion=0\n'
codetxt+='if (navigator.appVersion.indexOf("MSIE")!=-1){\n'
codetxt+='temp=navigator.appVersion.split("MSIE")\n'
codetxt+='browsversion=parseFloat(temp[1])\n'
codetxt+='}\n'

codetxt+='if (browsversion>=4){\n'


if(popupfreq!=1){

codetxt+='var '+randckname+'pefreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'pefreqcook){\n'

codetxt+='document.body.onunload='+randckname+'pego\n'


if(popupfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(popupfreq==3){
var expdays=(document.popupsettingsform.popupfdays.value)*86400
var exphours=(document.popupsettingsform.popupfhours.value)*3600
var expminutes=(document.popupsettingsform.popupfminutes.value)*60
var expseconds=(document.popupsettingsform.popupfseconds.value)*1
var expall=expdays+exphours+expminutes+expseconds
codetxt+='var peexp=new Date()\n'
codetxt+='var pesometimefromnow=peexp.getTime() + ('+expall+'*1000)\n'
codetxt+='peexp.setTime(pesometimefromnow)\n'
codetxt+='document.cookie="'+randckname+'=Y; expires="\+peexp.toGMTString()\n'
}

codetxt+='}\n'

}
else{

codetxt+='document.body.onunload='+randckname+'pego\n'

}



codetxt+='}\n'

codetxt+='\<\/script\>\n'


document.pageexitform.code1.value=codetxt

svfunct="cd"+randckname

pecntgetcode()


document.all.popupgetcodetab.style.border="1px solid #000000"
document.all.popupsettingstab.style.border="1px solid #808080"

document.all.popupgetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.popupsettingstab.style.borderBottom="1px solid #000000"

document.all.popupgetcodetab.style.backgroundColor="#99CCFF"
document.all.popupsettingstab.style.backgroundColor="#DCDCDC"

document.all.popupgetcodetab.style.color="#000000"
document.all.popupsettingstab.style.color="#808080"

document.all.popupsettingstab.style.zIndex=0
document.all.popupgetcodetab.style.zIndex=2

document.all.popupsettingsbox.style.visibility="hidden"
document.all.scrollviewgetcodebox.style.visibility="hidden"
document.all.linkclickgetcodebox.style.visibility="hidden"
document.all.pageexitgetcodebox.style.visibility="visible"



}
// end pageexit launch trigger




if(formpopuplaunchtrigger=="linkclick"){



var tnow=new Date()
var randckname="popup"+tnow.getTime()


var codetxt=""

codetxt='\<script\>\n'

var popupwinatt="width="+formpopupwidth+",height="+formpopupheight+","

if(formpopupmenubar){
popupwinatt+="menubar=1,"
}
else{
popupwinatt+="menubar=0,"
}

if(formpopuptoolbar){
popupwinatt+="toolbar=1,"
}
else{
popupwinatt+="toolbar=0,"
}

if(formpopuplocationbar){
popupwinatt+="location=1,"
}
else{
popupwinatt+="location=0,"
}

if(formpopupdirectories){
popupwinatt+="directories=1,"
}
else{
popupwinatt+="directories=0,"
}

if(formpopupstatusbar){
popupwinatt+="status=1,"
}
else{
popupwinatt+="status=0,"
}

if(formpopupscrollbars){
popupwinatt+="scrollbars=1,"
}
else{
popupwinatt+="scrollbars=0,"
}

if(formpopupresizable){
popupwinatt+="resizable=1"
}
else{
popupwinatt+="resizable=0"
}

codetxt+='var popupwinatt="'+popupwinatt+'"\n'
codetxt+='var popuptoppos, popupleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formpopupwindowposition=="1"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=0\n'

}

if(formpopupwindowposition=="2"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="3"){
codetxt+='popuptoppos=0\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="4"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="5"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="6"){
codetxt+='popuptoppos=Math.round((screenheight-'+formpopupheight+')/2)\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="7"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=0\n'
}

if(formpopupwindowposition=="8"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=Math.round((screenwidth-'+formpopupwidth+')/2)\n'
}

if(formpopupwindowposition=="9"){
codetxt+='popuptoppos=screenheight-'+formpopupheight+'\n'
codetxt+='popupleftpos=screenwidth-'+formpopupwidth+'\n'
}

if(formpopupwindowposition=="10"){
codetxt+='popuptoppos='+formpopupypos+'\n'
codetxt+='popupleftpos='+formpopupxpos+'\n'
}

codetxt+='popupwinatt+=",top="+popuptoppos+"px,"\n'
codetxt+='popupwinatt+="left="+popupleftpos+"px"\n'



codetxt+='function '+randckname+'lcgo(){\n'

if(formpopupstyle=="1"){

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","","'+popupwinatt+'")\n'

}
else{

codetxt+='var popupwin=window.open("'+formpopuppageurl+'","","'+popupwinatt+'")\n'
codetxt+='self.focus()\n'
codetxt+='popupwin.blur()\n'


}

codetxt+='}\n'

codetxt+='\<\/script\>\n'


document.linkclickform.code1.value=codetxt
document.linkclickform.code2.value='<a href="javascript:'+randckname+'lcgo()">Your Link Text Goes Here</a>'
document.linkclickform.code2button.value='<button onClick="'+randckname+'lcgo()">Your Button Text Goes Here</button>'

svfunct="cd"+randckname

lccntgetcode()


document.all.popupgetcodetab.style.border="1px solid #000000"
document.all.popupsettingstab.style.border="1px solid #808080"

document.all.popupgetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.popupsettingstab.style.borderBottom="1px solid #000000"

document.all.popupgetcodetab.style.backgroundColor="#99CCFF"
document.all.popupsettingstab.style.backgroundColor="#DCDCDC"

document.all.popupgetcodetab.style.color="#000000"
document.all.popupsettingstab.style.color="#808080"

document.all.popupsettingstab.style.zIndex=0
document.all.popupgetcodetab.style.zIndex=2

document.all.popupsettingsbox.style.visibility="hidden"
document.all.scrollviewgetcodebox.style.visibility="hidden"
document.all.pageexitgetcodebox.style.visibility="hidden"
document.all.linkclickgetcodebox.style.visibility="visible"




}
// end linkclick launch trigger





}

}
// END popupgetcode function



function svcntgetcode(){

var svcdminutes=document.svcntform1.cdminutes.value
var svcdseconds=document.svcntform1.cdseconds.value

var svcdformat=document.svcntform1.cdformat.value

var cntdwnhtml="\<script\>\n"

cntdwnhtml+='function getCookieVal (offset) {\n'
cntdwnhtml+='  var endstr = document.cookie.indexOf (";", offset);\n'
cntdwnhtml+='  if (endstr == -1)\n'
cntdwnhtml+='    endstr = document.cookie.length;\n'
cntdwnhtml+='  return unescape(document.cookie.substring(offset, endstr));\n'
cntdwnhtml+='}\n'

cntdwnhtml+='function GetCookie (name) {\n'
cntdwnhtml+='  var arg = name + "=";\n'
cntdwnhtml+='  var alen = arg.length;\n'
cntdwnhtml+='  var clen = document.cookie.length;\n'
cntdwnhtml+='  var i = 0;\n'
cntdwnhtml+='  while (i < clen) {\n'
cntdwnhtml+='    var j = i + alen;\n'
cntdwnhtml+='    if (document.cookie.substring(i, j) == arg)\n'
cntdwnhtml+='      return getCookieVal (j);\n'
cntdwnhtml+='	i = document.cookie.indexOf(" ", i) + 1;\n'
cntdwnhtml+='    if (i == 0) break; \n'
cntdwnhtml+='  }\n'
cntdwnhtml+='  return null;\n'
cntdwnhtml+='}\n'

cntdwnhtml+='var tmins='+svcdminutes+'\n'
cntdwnhtml+='var tsecs='+svcdseconds+'\n'
cntdwnhtml+='var t\n'

cntdwnhtml+='var tdiff2\n'

cntdwnhtml+='var stoptime\n'

cntdwnhtml+='function cntdwnst(){\n'
cntdwnhtml+='var timenow=new Date()\n'
cntdwnhtml+='timenow=timenow.getTime()\n'


cntdwnhtml+='// get stoptime cookie if it exists\n'
cntdwnhtml+='var stcook=GetCookie(\"'+svfunct+'\")\n'

cntdwnhtml+='if(stcook){\n'
cntdwnhtml+='stoptime=stcook\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='// set new stoptime and write new stoptime cookie if it doesn\'t exist\n'
cntdwnhtml+='stoptime=timenow+(tmins*60000)+(tsecs*1000)\n'

cntdwnhtml+='document.cookie="'+svfunct+'="+stoptime\n'

cntdwnhtml+='}\n'
cntdwnhtml+='tdiff2=stoptime-timenow\n'

cntdwnhtml+='cntdwn2()\n'

cntdwnhtml+='}\n'

cntdwnhtml+='function cntdwn2(){\n'

cntdwnhtml+='if(tdiff2<0){\n'
cntdwnhtml+='clearTimeout(t)\n'
cntdwnhtml+='self.close()\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='var ttdiff2=new Date(tdiff2)\n'
cntdwnhtml+='var newmin=ttdiff2.getMinutes()\n'
cntdwnhtml+='var newsec=ttdiff2.getSeconds()\n'


// Format 1

if(svcdformat==1){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='if(newmin<10){\n'
cntdwnhtml+='showmin="0"+newmin\n'
cntdwnhtml+='}\n'

cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='if(newsec<10){\n'
cntdwnhtml+='showsec="0"+newsec\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+":"+showsec\n'

}

// Format 2

if(svcdformat==2){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='showminname=" minutes "\n'
cntdwnhtml+='if(newmin==1){\n'
cntdwnhtml+='showminname=" minute "\n'
cntdwnhtml+='}\n'
cntdwnhtml+='if(newmin==0){\n'
cntdwnhtml+='showmin=""\n'
cntdwnhtml+='showminname=""\n'
cntdwnhtml+='}\n'


cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(newsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+showminname+showsec+showsecname\n'


}


// Format 3

if(svcdformat==3){

cntdwnhtml+='showsec=(newmin*60)+newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(showsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showsec+showsecname\n'

}





cntdwnhtml+='tdiff2-=1000\n'
cntdwnhtml+='t=setTimeout("cntdwn2()",1000)\n'

cntdwnhtml+='}\n'

cntdwnhtml+='}\n'

cntdwnhtml+='window.onload=cntdwnst\n'

cntdwnhtml+='\<\/script\>\n'

document.svcntform2.cntdwncode.value=cntdwnhtml

}
// end ScrollView Countdown getcode



function lccntgetcode(){

var svcdminutes=document.lccntform1.cdminutes.value
var svcdseconds=document.lccntform1.cdseconds.value

var svcdformat=document.lccntform1.cdformat.value

var cntdwnhtml="\<script\>\n"

cntdwnhtml+='function getCookieVal (offset) {\n'
cntdwnhtml+='  var endstr = document.cookie.indexOf (";", offset);\n'
cntdwnhtml+='  if (endstr == -1)\n'
cntdwnhtml+='    endstr = document.cookie.length;\n'
cntdwnhtml+='  return unescape(document.cookie.substring(offset, endstr));\n'
cntdwnhtml+='}\n'

cntdwnhtml+='function GetCookie (name) {\n'
cntdwnhtml+='  var arg = name + "=";\n'
cntdwnhtml+='  var alen = arg.length;\n'
cntdwnhtml+='  var clen = document.cookie.length;\n'
cntdwnhtml+='  var i = 0;\n'
cntdwnhtml+='  while (i < clen) {\n'
cntdwnhtml+='    var j = i + alen;\n'
cntdwnhtml+='    if (document.cookie.substring(i, j) == arg)\n'
cntdwnhtml+='      return getCookieVal (j);\n'
cntdwnhtml+='	i = document.cookie.indexOf(" ", i) + 1;\n'
cntdwnhtml+='    if (i == 0) break; \n'
cntdwnhtml+='  }\n'
cntdwnhtml+='  return null;\n'
cntdwnhtml+='}\n'

cntdwnhtml+='var tmins='+svcdminutes+'\n'
cntdwnhtml+='var tsecs='+svcdseconds+'\n'
cntdwnhtml+='var t\n'

cntdwnhtml+='var tdiff2\n'

cntdwnhtml+='var stoptime\n'

cntdwnhtml+='function cntdwnst(){\n'
cntdwnhtml+='var timenow=new Date()\n'
cntdwnhtml+='timenow=timenow.getTime()\n'


cntdwnhtml+='// get stoptime cookie if it exists\n'
cntdwnhtml+='var stcook=GetCookie(\"'+svfunct+'\")\n'

cntdwnhtml+='if(stcook){\n'
cntdwnhtml+='stoptime=stcook\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='// set new stoptime and write new stoptime cookie if it doesn\'t exist\n'
cntdwnhtml+='stoptime=timenow+(tmins*60000)+(tsecs*1000)\n'

cntdwnhtml+='document.cookie="'+svfunct+'="+stoptime\n'

cntdwnhtml+='}\n'
cntdwnhtml+='tdiff2=stoptime-timenow\n'

cntdwnhtml+='cntdwn2()\n'

cntdwnhtml+='}\n'

cntdwnhtml+='function cntdwn2(){\n'

cntdwnhtml+='if(tdiff2<0){\n'
cntdwnhtml+='clearTimeout(t)\n'
cntdwnhtml+='self.close()\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='var ttdiff2=new Date(tdiff2)\n'
cntdwnhtml+='var newmin=ttdiff2.getMinutes()\n'
cntdwnhtml+='var newsec=ttdiff2.getSeconds()\n'


// Format 1

if(svcdformat==1){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='if(newmin<10){\n'
cntdwnhtml+='showmin="0"+newmin\n'
cntdwnhtml+='}\n'

cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='if(newsec<10){\n'
cntdwnhtml+='showsec="0"+newsec\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+":"+showsec\n'

}

// Format 2

if(svcdformat==2){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='showminname=" minutes "\n'
cntdwnhtml+='if(newmin==1){\n'
cntdwnhtml+='showminname=" minute "\n'
cntdwnhtml+='}\n'
cntdwnhtml+='if(newmin==0){\n'
cntdwnhtml+='showmin=""\n'
cntdwnhtml+='showminname=""\n'
cntdwnhtml+='}\n'


cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(newsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+showminname+showsec+showsecname\n'


}


// Format 3

if(svcdformat==3){

cntdwnhtml+='showsec=(newmin*60)+newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(showsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showsec+showsecname\n'

}





cntdwnhtml+='tdiff2-=1000\n'
cntdwnhtml+='t=setTimeout("cntdwn2()",1000)\n'

cntdwnhtml+='}\n'

cntdwnhtml+='}\n'

cntdwnhtml+='window.onload=cntdwnst\n'

cntdwnhtml+='\<\/script\>\n'

document.lccntform2.cntdwncode.value=cntdwnhtml

}
// end LinkClick Countdown getcode




function pecntgetcode(){

var svcdminutes=document.pecntform1.cdminutes.value
var svcdseconds=document.pecntform1.cdseconds.value

var svcdformat=document.pecntform1.cdformat.value

var cntdwnhtml="\<script\>\n"

cntdwnhtml+='function getCookieVal (offset) {\n'
cntdwnhtml+='  var endstr = document.cookie.indexOf (";", offset);\n'
cntdwnhtml+='  if (endstr == -1)\n'
cntdwnhtml+='    endstr = document.cookie.length;\n'
cntdwnhtml+='  return unescape(document.cookie.substring(offset, endstr));\n'
cntdwnhtml+='}\n'

cntdwnhtml+='function GetCookie (name) {\n'
cntdwnhtml+='  var arg = name + "=";\n'
cntdwnhtml+='  var alen = arg.length;\n'
cntdwnhtml+='  var clen = document.cookie.length;\n'
cntdwnhtml+='  var i = 0;\n'
cntdwnhtml+='  while (i < clen) {\n'
cntdwnhtml+='    var j = i + alen;\n'
cntdwnhtml+='    if (document.cookie.substring(i, j) == arg)\n'
cntdwnhtml+='      return getCookieVal (j);\n'
cntdwnhtml+='	i = document.cookie.indexOf(" ", i) + 1;\n'
cntdwnhtml+='    if (i == 0) break; \n'
cntdwnhtml+='  }\n'
cntdwnhtml+='  return null;\n'
cntdwnhtml+='}\n'

cntdwnhtml+='var tmins='+svcdminutes+'\n'
cntdwnhtml+='var tsecs='+svcdseconds+'\n'
cntdwnhtml+='var t\n'

cntdwnhtml+='var tdiff2\n'

cntdwnhtml+='var stoptime\n'

cntdwnhtml+='function cntdwnst(){\n'
cntdwnhtml+='var timenow=new Date()\n'
cntdwnhtml+='timenow=timenow.getTime()\n'


cntdwnhtml+='// get stoptime cookie if it exists\n'
cntdwnhtml+='var stcook=GetCookie(\"'+svfunct+'\")\n'

cntdwnhtml+='if(stcook){\n'
cntdwnhtml+='stoptime=stcook\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='// set new stoptime and write new stoptime cookie if it doesn\'t exist\n'
cntdwnhtml+='stoptime=timenow+(tmins*60000)+(tsecs*1000)\n'

cntdwnhtml+='document.cookie="'+svfunct+'="+stoptime\n'

cntdwnhtml+='}\n'
cntdwnhtml+='tdiff2=stoptime-timenow\n'

cntdwnhtml+='cntdwn2()\n'

cntdwnhtml+='}\n'

cntdwnhtml+='function cntdwn2(){\n'

cntdwnhtml+='if(tdiff2<0){\n'
cntdwnhtml+='clearTimeout(t)\n'
cntdwnhtml+='self.close()\n'
cntdwnhtml+='}\n'
cntdwnhtml+='else{\n'

cntdwnhtml+='var ttdiff2=new Date(tdiff2)\n'
cntdwnhtml+='var newmin=ttdiff2.getMinutes()\n'
cntdwnhtml+='var newsec=ttdiff2.getSeconds()\n'


// Format 1

if(svcdformat==1){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='if(newmin<10){\n'
cntdwnhtml+='showmin="0"+newmin\n'
cntdwnhtml+='}\n'

cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='if(newsec<10){\n'
cntdwnhtml+='showsec="0"+newsec\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+":"+showsec\n'

}

// Format 2

if(svcdformat==2){

cntdwnhtml+='showmin=newmin\n'
cntdwnhtml+='showminname=" minutes "\n'
cntdwnhtml+='if(newmin==1){\n'
cntdwnhtml+='showminname=" minute "\n'
cntdwnhtml+='}\n'
cntdwnhtml+='if(newmin==0){\n'
cntdwnhtml+='showmin=""\n'
cntdwnhtml+='showminname=""\n'
cntdwnhtml+='}\n'


cntdwnhtml+='showsec=newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(newsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showmin+showminname+showsec+showsecname\n'


}


// Format 3

if(svcdformat==3){

cntdwnhtml+='showsec=(newmin*60)+newsec\n'
cntdwnhtml+='showsecname=" seconds"\n'
cntdwnhtml+='if(showsec==1){\n'
cntdwnhtml+='showsecname=" second"\n'
cntdwnhtml+='}\n'


cntdwnhtml+='document.all.livecntdwn.innerHTML=showsec+showsecname\n'

}





cntdwnhtml+='tdiff2-=1000\n'
cntdwnhtml+='t=setTimeout("cntdwn2()",1000)\n'

cntdwnhtml+='}\n'

cntdwnhtml+='}\n'

cntdwnhtml+='window.onload=cntdwnst\n'

cntdwnhtml+='\<\/script\>\n'

document.pecntform2.cntdwncode.value=cntdwnhtml

}
// end PageExit Countdown getcode





var formpopupwidth, formpopupheight
var formpopuppageurl, formpopupstyle
var formpopupmenubar, formpopuptoolbar, formpopuplocationbar, formpopupdirectories
var formpopupstatusbar, formpopupscrollbars, formpopupresizable
var formpopupwindowposition, formpopupxpos, formpopupypos




function popuppreview(){

// check for incomplete fields

formpopupwidth=document.popupsettingsform.popupwidth.value
formpopupheight=document.popupsettingsform.popupheight.value
formpopuppageurl=document.popupsettingsform.popuppageurl.value
formpopupstyle=document.popupsettingsform.popupstyle.value
formpopupmenubar=document.popupsettingsform.popupmenubar.checked
formpopuptoolbar=document.popupsettingsform.popuptoolbar.checked
formpopuplocationbar=document.popupsettingsform.popuplocationbar.checked
formpopupdirectories=document.popupsettingsform.popupdirectories.checked
formpopupstatusbar=document.popupsettingsform.popupstatusbar.checked
formpopupscrollbars=document.popupsettingsform.popupscrollbars.checked
formpopupresizable=document.popupsettingsform.popupresizable.checked
formpopupwindowposition=document.popupsettingsform.popupwindowposition.value
formpopupxpos=document.popupsettingsform.popupxpos.value
formpopupypos=document.popupsettingsform.popupypos.value



var inctot=0

var inclist=""

if(!formpopupwidth){
inctot++
inclist+="- Width\n"
}

if(!formpopupheight){
inctot++
inclist+="- Height\n"
}

if(!formpopuppageurl){
inctot++
inclist+="- Page URL\n"
}

if(formpopupwindowposition=="10"){

if(!formpopupxpos){
inctot++
inclist+="- X-Position\n"
}

if(!formpopupypos){
inctot++
inclist+="- Y-Position\n"
}

}


if(inctot>0){
// Incomplete
alert("You must enter the following before you can preview the Popup window...\n\n"+inclist)
}
else{
// Show Preview

var popuptoppos, popupleftpos
var screenwidth=screen.availWidth
var screenheight=screen.availHeight

if(formpopupwindowposition=="1"){
popuptoppos=0
popupleftpos=0
}

if(formpopupwindowposition=="2"){
popuptoppos=0
popupleftpos=Math.round((screenwidth-formpopupwidth)/2)
}

if(formpopupwindowposition=="3"){
popuptoppos=0
popupleftpos=screenwidth-formpopupwidth
}

if(formpopupwindowposition=="4"){
popuptoppos=Math.round((screenheight-formpopupheight)/2)
popupleftpos=0
}

if(formpopupwindowposition=="5"){
popuptoppos=Math.round((screenheight-formpopupheight)/2)
popupleftpos=Math.round((screenwidth-formpopupwidth)/2)
}

if(formpopupwindowposition=="6"){
popuptoppos=Math.round((screenheight-formpopupheight)/2)
popupleftpos=screenwidth-formpopupwidth
}

if(formpopupwindowposition=="7"){
popuptoppos=screenheight-formpopupheight
popupleftpos=0
}

if(formpopupwindowposition=="8"){
popuptoppos=screenheight-formpopupheight
popupleftpos=Math.round((screenwidth-formpopupwidth)/2)
}

if(formpopupwindowposition=="9"){
popuptoppos=screenheight-formpopupheight
popupleftpos=screenwidth-formpopupwidth
}

if(formpopupwindowposition=="10"){
popuptoppos=formpopupypos
popupleftpos=formpopupxpos
}

var popupwinatt="width="+formpopupwidth+",height="+formpopupheight+",top="+popuptoppos+"px,left="+popupleftpos+"px,"

if(formpopupmenubar){
popupwinatt+="menubar=1,"
}
else{
popupwinatt+="menubar=0,"
}

if(formpopuptoolbar){
popupwinatt+="toolbar=1,"
}
else{
popupwinatt+="toolbar=0,"
}

if(formpopuplocationbar){
popupwinatt+="location=1,"
}
else{
popupwinatt+="location=0,"
}

if(formpopupdirectories){
popupwinatt+="directories=1,"
}
else{
popupwinatt+="directories=0,"
}

if(formpopupstatusbar){
popupwinatt+="status=1,"
}
else{
popupwinatt+="status=0,"
}

if(formpopupscrollbars){
popupwinatt+="scrollbars=1,"
}
else{
popupwinatt+="scrollbars=0,"
}

if(formpopupresizable){
popupwinatt+="resizable=1"
}
else{
popupwinatt+="resizable=0"
}


if(formpopupstyle=="1"){
// pop-up style preview

var popupwin=window.open(formpopuppageurl,"",popupwinatt)


}
else{
// pop-under style preview



var popupwin=window.open(formpopuppageurl,"",popupwinatt)
self.focus()
popupwin.blur()




}


}


}
// END popuppreview function





// End Popup Window

