// Begin Dialog Window

window.onload=dialogwinpos

function dialogwinpos(){

if(document.dialogsettingsform.dialogwindowposition.value=="10"){
dialogspecifypos.disabled=false
document.dialogsettingsform.dialogxpos.disabled=false
document.dialogsettingsform.dialogypos.disabled=false
}
else{
dialogspecifypos.disabled=true
document.dialogsettingsform.dialogxpos.disabled=true
document.dialogsettingsform.dialogypos.disabled=true
}

}

function dialogltchange(){

dialogsvdelays.disabled=false
document.dialogsettingsform.dialoglaunchtimedelayminutes.disabled=false
document.dialogsettingsform.dialoglaunchtimedelayseconds.disabled=false

dialogspecifypos.disabled=false
document.dialogsettingsform.dialogxpos.disabled=false
document.dialogsettingsform.dialogypos.disabled=false

dialogdispfreq.disabled=false
document.dialogsettingsform.dialogfreq.disabled=false
document.dialogsettingsform.dialogfdays.disabled=false
document.dialogsettingsform.dialogfhours.disabled=false
document.dialogsettingsform.dialogfminutes.disabled=false
document.dialogsettingsform.dialogfseconds.disabled=false

document.dialogsettingsform.dialogstyle.disabled=false


if(document.dialogsettingsform.dialoglaunchtrigger.value=="pageexit"){
dialogsvdelays.disabled=true
document.dialogsettingsform.dialoglaunchtimedelayminutes.disabled=true
document.dialogsettingsform.dialoglaunchtimedelayseconds.disabled=true

document.dialogsettingsform.dialogstyle.options[0].selected=true
document.dialogsettingsform.dialogstyle.disabled=true

}
else{

if(document.dialogsettingsform.dialoglaunchtrigger.value=="linkclick"){

dialogsvdelays.disabled=true
document.dialogsettingsform.dialoglaunchtimedelayminutes.disabled=true
document.dialogsettingsform.dialoglaunchtimedelayseconds.disabled=true


dialogdispfreq.disabled=true
document.dialogsettingsform.dialogfreq.disabled=true
document.dialogsettingsform.dialogfdays.disabled=true
document.dialogsettingsform.dialogfhours.disabled=true
document.dialogsettingsform.dialogfminutes.disabled=true
document.dialogsettingsform.dialogfseconds.disabled=true

}


}

dialogwinpos()

}



var svfunct

var formdialoglaunchtrigger, dialogsvtlaunchdelaytime

function dialoggetcode(){

// check for incomplete fields

formdialoglaunchtrigger=document.dialogsettingsform.dialoglaunchtrigger.value

formdialogwidth=document.dialogsettingsform.dialogwidth.value
formdialogheight=document.dialogsettingsform.dialogheight.value
formdialogpageurl=document.dialogsettingsform.dialogpageurl.value
if(formdialoglaunchtrigger=="pageexit"){
formdialogstyle=1
}
else{
formdialogstyle=document.dialogsettingsform.dialogstyle.value
}
formdialogstatusbar=document.dialogsettingsform.dialogstatusbar.checked
formdialogscrollbars=document.dialogsettingsform.dialogscrollbars.checked
formdialogresizable=document.dialogsettingsform.dialogresizable.checked
formdialogwindowposition=document.dialogsettingsform.dialogwindowposition.value
formdialogxpos=document.dialogsettingsform.dialogxpos.value
formdialogypos=document.dialogsettingsform.dialogypos.value




var inctot=0

var inclist=""


if(!formdialogwidth){
inctot++
inclist+="- Width\n"
}

if(!formdialogheight){
inctot++
inclist+="- Height\n"
}

if(!formdialogpageurl){
inctot++
inclist+="- Page URL\n"
}

if(formdialogwindowposition=="10"){

if(!formdialogxpos){
inctot++
inclist+="- X-Position\n"
}


if(!formdialogypos){
inctot++
inclist+="- Y-Position\n"
}

}



if(inctot>0){
// Incomplete
alert("You must enter the following before you can get the Dialog window code...\n\n"+inclist)
}
else{
// Get Code





if(formdialoglaunchtrigger=="scrollview"){


dialogsvtlaunchdelaytime=(document.dialogsettingsform.dialoglaunchtimedelayminutes.value*60)+(document.dialogsettingsform.dialoglaunchtimedelayseconds.value*1)
dialogsvtlaunchdelaytime=dialogsvtlaunchdelaytime*1000


var tnow=new Date()
var randckname="dialog"+tnow.getTime()

var codetxt='<a href="javascript:'+randckname+'svtdialog2()" id="'+randckname+'lk" style="visibility:hidden;"></a>\n'

codetxt+='\<script\>\n'

var dialogwinatt="dialogWidth:"+formdialogwidth+"px;dialogHeight:"+formdialogheight+"px;help:no;"


if(formdialogstatusbar){
dialogwinatt+="status:1;"
}
else{
dialogwinatt+="status:0;"
}

if(formdialogscrollbars){
dialogwinatt+="scroll:1;"
}
else{
dialogwinatt+="scroll:0;"
}

if(formdialogresizable){
dialogwinatt+="resizable:1;"
}
else{
dialogwinatt+="resizable:0;"
}

codetxt+='var dialogwinatt="'+dialogwinatt+'"\n'
codetxt+='var dialogtoppos, dialogleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formdialogwindowposition=="1"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=0\n'

}

if(formdialogwindowposition=="2"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="3"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="4"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="5"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="6"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="7"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="8"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="9"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="10"){
codetxt+='dialogtoppos='+formdialogypos+'\n'
codetxt+='dialogleftpos='+formdialogxpos+'\n'
}

codetxt+='dialogwinatt+="dialogTop:"+dialogtoppos+"px;"\n'
codetxt+='dialogwinatt+="dialogLeft:"+dialogleftpos+"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(dialogsvtlaunchdelaytime==0){
codetxt+=randckname+'svtdialog()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtdialog()",'+dialogsvtlaunchdelaytime+')\n'
}

codetxt+='}\n'
codetxt+='}\n'
codetxt+='else{\n'

codetxt+=randckname+'svgodone=1\n'

if(dialogsvtlaunchdelaytime==0){
codetxt+=randckname+'svtdialog()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtdialog()",'+dialogsvtlaunchdelaytime+')\n'
}


codetxt+='}\n'

codetxt+='}\n'

codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'




codetxt+='function '+randckname+'svtdialog(){\n'
codetxt+=randckname+'lk.click()\n'
codetxt+='}\n'




codetxt+='function '+randckname+'svtdialog2(){\n'


if(formdialogstyle=="1"){
// Modal style preview

codetxt+='var dialogwin=window.showModalDialog("'+formdialogpageurl+'","",dialogwinatt);\n'


}
else{
// Modeless style preview


codetxt+='var dialogwin=window.showModelessDialog("'+formdialogpageurl+'","",dialogwinatt);\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.dialogsettingsform.dialogfreq.length;i++){
if(document.dialogsettingsform.dialogfreq[i].checked){
var dialogfreq=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(dialogfreq!=1){
codetxt+=cooklines
codetxt+='var '+randckname+'svfreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'svfreqcook){\n'



if(dialogfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(dialogfreq==3){
var expdays=(document.dialogsettingsform.dialogfdays.value)*86400
var exphours=(document.dialogsettingsform.dialogfhours.value)*3600
var expminutes=(document.dialogsettingsform.dialogfminutes.value)*60
var expseconds=(document.dialogsettingsform.dialogfseconds.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.dialogscrollviewform.code1.value=codetxt
document.dialogscrollviewform.code2.value='<a id="svtrigger'+randckname+'" style="position:relative;"></a>'
document.dialogscrollviewform.code2bot.value='<a id="svtrigger2'+randckname+'" style="position:relative;"></a>'

svfunct="cd"+randckname

svcntgetcode()


document.all.dialoggetcodetab.style.border="1px solid #000000"
document.all.dialogsettingstab.style.border="1px solid #808080"

document.all.dialoggetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.dialogsettingstab.style.borderBottom="1px solid #000000"

document.all.dialoggetcodetab.style.backgroundColor="#99CCFF"
document.all.dialogsettingstab.style.backgroundColor="#DCDCDC"

document.all.dialoggetcodetab.style.color="#000000"
document.all.dialogsettingstab.style.color="#808080"


document.all.dialogsettingstab.style.zIndex=0
document.all.dialoggetcodetab.style.zIndex=2

document.all.dialogsettingsbox.style.visibility="hidden"
document.all.dialoglinkclickgetcodebox.style.visibility="hidden"
document.all.dialogpageexitgetcodebox.style.visibility="hidden"
document.all.dialogscrollviewgetcodebox.style.visibility="visible"





}
// end scrollview launch trigger





if(formdialoglaunchtrigger=="pageexit"){



var tnow=new Date()
var randckname="dialog"+tnow.getTime()

var codetxt=""


codetxt='\<script\>\n'


var dialogwinatt="dialogWidth:"+formdialogwidth+"px;dialogHeight:"+formdialogheight+"px;help:no;"


if(formdialogstatusbar){
dialogwinatt+="status:1;"
}
else{
dialogwinatt+="status:0;"
}

if(formdialogscrollbars){
dialogwinatt+="scroll:1;"
}
else{
dialogwinatt+="scroll:0;"
}

if(formdialogresizable){
dialogwinatt+="resizable:1;"
}
else{
dialogwinatt+="resizable:0;"
}

codetxt+='var dialogwinatt="'+dialogwinatt+'"\n'
codetxt+='var dialogtoppos, dialogleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formdialogwindowposition=="1"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=0\n'

}

if(formdialogwindowposition=="2"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="3"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="4"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="5"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="6"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="7"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="8"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="9"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="10"){
codetxt+='dialogtoppos='+formdialogypos+'\n'
codetxt+='dialogleftpos='+formdialogxpos+'\n'
}

codetxt+='dialogwinatt+="dialogTop:"+dialogtoppos+"px;"\n'
codetxt+='dialogwinatt+="dialogLeft:"+dialogleftpos+"px;"\n'



codetxt+='var peoff=0\n'


codetxt+='function '+randckname+'pego(){\n'
codetxt+='if(peoff==0){\n'

if(formdialogstyle=="1"){
// Modal style preview

codetxt+='var dialogwin=window.showModalDialog("'+formdialogpageurl+'","","'+dialogwinatt+'");\n'


}
else{
// Modeless style preview


codetxt+='var dialogwin=window.showModelessDialog("'+formdialogpageurl+'","","'+dialogwinatt+'");\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.dialogsettingsform.dialogfreq.length;i++){
if(document.dialogsettingsform.dialogfreq[i].checked){
var dialogfreq=i+1
}
}


if(dialogfreq!=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(dialogfreq!=1){

codetxt+='var '+randckname+'pefreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'pefreqcook){\n'

codetxt+='document.body.onunload='+randckname+'pego\n'


if(dialogfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(dialogfreq==3){
var expdays=(document.dialogsettingsform.dialogfdays.value)*86400
var exphours=(document.dialogsettingsform.dialogfhours.value)*3600
var expminutes=(document.dialogsettingsform.dialogfminutes.value)*60
var expseconds=(document.dialogsettingsform.dialogfseconds.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.dialogpageexitform.code1.value=codetxt


svfunct="cd"+randckname

pecntgetcode()


document.all.dialoggetcodetab.style.border="1px solid #000000"
document.all.dialogsettingstab.style.border="1px solid #808080"

document.all.dialoggetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.dialogsettingstab.style.borderBottom="1px solid #000000"

document.all.dialoggetcodetab.style.backgroundColor="#99CCFF"
document.all.dialogsettingstab.style.backgroundColor="#DCDCDC"

document.all.dialoggetcodetab.style.color="#000000"
document.all.dialogsettingstab.style.color="#808080"

document.all.dialogsettingstab.style.zIndex=0
document.all.dialoggetcodetab.style.zIndex=2

document.all.dialogsettingsbox.style.visibility="hidden"
document.all.dialogscrollviewgetcodebox.style.visibility="hidden"
document.all.dialoglinkclickgetcodebox.style.visibility="hidden"
document.all.dialogpageexitgetcodebox.style.visibility="visible"


}
// end pageexit launch trigger




if(formdialoglaunchtrigger=="linkclick"){



var tnow=new Date()
var randckname="dialog"+tnow.getTime()


var codetxt=""

codetxt='\<script\>\n'

var dialogwinatt="dialogWidth:"+formdialogwidth+"px;dialogHeight:"+formdialogheight+"px;help:no;"


if(formdialogstatusbar){
dialogwinatt+="status:1;"
}
else{
dialogwinatt+="status:0;"
}

if(formdialogscrollbars){
dialogwinatt+="scroll:1;"
}
else{
dialogwinatt+="scroll:0;"
}

if(formdialogresizable){
dialogwinatt+="resizable:1;"
}
else{
dialogwinatt+="resizable:0;"
}

codetxt+='var dialogwinatt="'+dialogwinatt+'"\n'
codetxt+='var dialogtoppos, dialogleftpos\n'
codetxt+='var screenwidth=screen.availWidth\n'
codetxt+='var screenheight=screen.availHeight\n'

if(formdialogwindowposition=="1"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=0\n'

}

if(formdialogwindowposition=="2"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="3"){
codetxt+='dialogtoppos=0\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="4"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="5"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="6"){
codetxt+='dialogtoppos=Math.round((screenheight-'+formdialogheight+')/2)\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="7"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=0\n'
}

if(formdialogwindowposition=="8"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=Math.round((screenwidth-'+formdialogwidth+')/2)\n'
}

if(formdialogwindowposition=="9"){
codetxt+='dialogtoppos=screenheight-'+formdialogheight+'\n'
codetxt+='dialogleftpos=screenwidth-'+formdialogwidth+'\n'
}

if(formdialogwindowposition=="10"){
codetxt+='dialogtoppos='+formdialogypos+'\n'
codetxt+='dialogleftpos='+formdialogxpos+'\n'
}

codetxt+='dialogwinatt+="dialogTop:"+dialogtoppos+"px;"\n'
codetxt+='dialogwinatt+="dialogLeft:"+dialogleftpos+"px;"\n'



codetxt+='function '+randckname+'pego(){\n'

if(formdialogstyle=="1"){
// Modal style preview

codetxt+='var dialogwin=window.showModalDialog("'+formdialogpageurl+'","","'+dialogwinatt+'");\n'


}
else{
// Modeless style preview


codetxt+='var dialogwin=window.showModelessDialog("'+formdialogpageurl+'","","'+dialogwinatt+'");\n'


}

codetxt+='}\n'

codetxt+='\<\/script\>\n'


document.dialoglinkclickform.code1.value=codetxt
document.dialoglinkclickform.code2.value='<a href="javascript:'+randckname+'pego()">Your Link Text Goes Here</a>'
document.dialoglinkclickform.code2button.value='<button onClick="'+randckname+'pego()">Your Button Text Goes Here</button>'


svfunct="cd"+randckname

lccntgetcode()


document.all.dialoggetcodetab.style.border="1px solid #000000"
document.all.dialogsettingstab.style.border="1px solid #808080"

document.all.dialoggetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.dialogsettingstab.style.borderBottom="1px solid #000000"

document.all.dialoggetcodetab.style.backgroundColor="#99CCFF"
document.all.dialogsettingstab.style.backgroundColor="#DCDCDC"

document.all.dialoggetcodetab.style.color="#000000"
document.all.dialogsettingstab.style.color="#808080"

document.all.dialogsettingstab.style.zIndex=0
document.all.dialoggetcodetab.style.zIndex=2

document.all.dialogsettingsbox.style.visibility="hidden"
document.all.dialogscrollviewgetcodebox.style.visibility="hidden"
document.all.dialogpageexitgetcodebox.style.visibility="hidden"
document.all.dialoglinkclickgetcodebox.style.visibility="visible"





}
// end linkclick launch trigger





}

}
// END dialoggetcode 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 formdialogwidth, formdialogheight
var formdialogpageurl, formdialogstyle
var formdialogstatusbar, formdialogscrollbars, formdialogresizable
var formdialogwindowposition, formdialogxpos, formdialogypos




function dialogpreview(){

// check for incomplete fields

formdialoglaunchtrigger=document.dialogsettingsform.dialoglaunchtrigger.value

formdialogwidth=document.dialogsettingsform.dialogwidth.value
formdialogheight=document.dialogsettingsform.dialogheight.value
formdialogpageurl=document.dialogsettingsform.dialogpageurl.value
if(formdialoglaunchtrigger=="pageexit"){
formdialogstyle=1
}
else{
formdialogstyle=document.dialogsettingsform.dialogstyle.value
}
formdialogstatusbar=document.dialogsettingsform.dialogstatusbar.checked
formdialogscrollbars=document.dialogsettingsform.dialogscrollbars.checked
formdialogresizable=document.dialogsettingsform.dialogresizable.checked
formdialogwindowposition=document.dialogsettingsform.dialogwindowposition.value
formdialogxpos=document.dialogsettingsform.dialogxpos.value
formdialogypos=document.dialogsettingsform.dialogypos.value



var inctot=0

var inclist=""

if(!formdialogwidth){
inctot++
inclist+="- Width\n"
}

if(!formdialogheight){
inctot++
inclist+="- Height\n"
}

if(!formdialogpageurl){
inctot++
inclist+="- Page URL\n"
}

if(formdialogwindowposition=="10"){

if(!formdialogxpos){
inctot++
inclist+="- X-Position\n"
}

if(!formdialogypos){
inctot++
inclist+="- Y-Position\n"
}

}


if(inctot>0){
// Incomplete
alert("You must enter the following before you can preview the Dialog window...\n\n"+inclist)
}
else{
// Show Preview

var screenwidth=screen.availWidth
var screenheight=screen.availHeight

if(formdialogwindowposition=="1"){
dialogtoppos=0
dialogleftpos=0
}

if(formdialogwindowposition=="2"){
dialogtoppos=0
dialogleftpos=Math.round((screenwidth-formdialogwidth)/2)
}

if(formdialogwindowposition=="3"){
dialogtoppos=0
dialogleftpos=screenwidth-formdialogwidth
}

if(formdialogwindowposition=="4"){
dialogtoppos=Math.round((screenheight-formdialogheight)/2)
dialogleftpos=0
}

if(formdialogwindowposition=="5"){
dialogtoppos=Math.round((screenheight-formdialogheight)/2)
dialogleftpos=Math.round((screenwidth-formdialogwidth)/2)
}

if(formdialogwindowposition=="6"){
dialogtoppos=Math.round((screenheight-formdialogheight)/2)
dialogleftpos=screenwidth-formdialogwidth
}

if(formdialogwindowposition=="7"){
dialogtoppos=screenheight-formdialogheight
dialogleftpos=0
}

if(formdialogwindowposition=="8"){
dialogtoppos=screenheight-formdialogheight
dialogleftpos=Math.round((screenwidth-formdialogwidth)/2)
}

if(formdialogwindowposition=="9"){
dialogtoppos=screenheight-formdialogheight
dialogleftpos=screenwidth-formdialogwidth
}

if(formdialogwindowposition=="10"){
dialogtoppos=formdialogxpos
dialogleftpos=formdialogypos
}

var dialogwinatt="dialogWidth:"+formdialogwidth+"px;dialogHeight:"+formdialogheight+"px;dialogTop:"+dialogtoppos+"px;dialogLeft:"+dialogleftpos+"px;help:no;"


if(formdialogstatusbar){
dialogwinatt+="status:1;"
}
else{
dialogwinatt+="status:0;"
}

if(formdialogscrollbars){
dialogwinatt+="scroll:1;"
}
else{
dialogwinatt+="scroll:0;"
}

if(formdialogresizable){
dialogwinatt+="resizable:1;"
}
else{
dialogwinatt+="resizable:0;"
}




if(formdialogstyle=="1"){
// Modal style preview


var dialogwin=window.showModalDialog(formdialogpageurl,"",dialogwinatt);


}
else{
// Modeless style preview


var dialogwin=window.showModelessDialog(formdialogpageurl,"",dialogwinatt);





}


}


}
// END dialogpreview function





// End Dialog Window

