// Begin FULL Window

var svfunct

function fullltchange(){
if(document.fullsettingsform.fulllaunchtrigger.value=="pageexit"){
fullsvdelays.disabled=true
document.fullsettingsform.fulllaunchtimedelayminutes.disabled=true
document.fullsettingsform.fulllaunchtimedelayseconds.disabled=true
}
else{
fullsvdelays.disabled=false
document.fullsettingsform.fulllaunchtimedelayminutes.disabled=false
document.fullsettingsform.fulllaunchtimedelayseconds.disabled=false
}
}




var formfulllaunchtrigger, fullsvtlaunchdelaytime

function fullgetcode(){

var formfullpageurl, formfullstyle


// check for incomplete fields

formfulllaunchtrigger=document.fullsettingsform.fulllaunchtrigger.value
formfullpageurl=document.fullsettingsform.fullpageurl.value
formfullstyle=document.fullsettingsform.fullstyle.value

var inctot=0

var inclist=""



if(!formfullpageurl){
inctot++
inclist+="- Page URL\n"
}




if(inctot>0){
// Incomplete
alert("You must enter the following before you can get the Full window code...\n\n"+inclist)
}
else{
// Get Code

if(formfulllaunchtrigger=="scrollview"){

fullsvtlaunchdelaytime=(document.fullsettingsform.fulllaunchtimedelayminutes.value*60)+(document.fullsettingsform.fulllaunchtimedelayseconds.value*1)
fullsvtlaunchdelaytime=fullsvtlaunchdelaytime*1000


var tnow=new Date()
var randckname="full"+tnow.getTime()

var codetxt='<a href="javascript:'+randckname+'svtfull2()" id="'+randckname+'lk" style="visibility:hidden;"></a>\n'

codetxt+='\<script\>\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(fullsvtlaunchdelaytime==0){
codetxt+=randckname+'svtfull()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtfull()",'+fullsvtlaunchdelaytime+')\n'
}

codetxt+='}\n'
codetxt+='}\n'
codetxt+='else{\n'

codetxt+=randckname+'svgodone=1\n'

if(fullsvtlaunchdelaytime==0){
codetxt+=randckname+'svtfull()\n'
}
else{
codetxt+='setTimeout("'+randckname+'svtfull()",'+fullsvtlaunchdelaytime+')\n'
}


codetxt+='}\n'

codetxt+='}\n'

codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'
codetxt+='}\n'

codetxt+='function '+randckname+'svtfull(){\n'
codetxt+=randckname+'lk.click()\n'
codetxt+='}\n'


codetxt+='function '+randckname+'svtfull2(){\n'

if(formfullstyle=="1"){

codetxt+='var fullwin=window.open("'+formfullpageurl+'","")\n'

}
else{

codetxt+='var fullwin=window.open("'+formfullpageurl+'","")\n'
codetxt+='self.focus()\n'
codetxt+='fullwin.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.fullsettingsform.fullfreq.length;i++){
if(document.fullsettingsform.fullfreq[i].checked){
var fullfreq=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(fullfreq!=1){
codetxt+=cooklines
codetxt+='var '+randckname+'svfreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'svfreqcook){\n'



if(fullfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(fullfreq==3){
var expdays=(document.fullsettingsform.fullfdays.value)*86400
var exphours=(document.fullsettingsform.fullfhours.value)*3600
var expminutes=(document.fullsettingsform.fullfminutes.value)*60
var expseconds=(document.fullsettingsform.fullfseconds.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.fullgetcodetab.style.border="1px solid #000000"
document.all.fullsettingstab.style.border="1px solid #808080"

document.all.fullgetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.fullsettingstab.style.borderBottom="1px solid #000000"

document.all.fullgetcodetab.style.backgroundColor="#99CCFF"
document.all.fullsettingstab.style.backgroundColor="#DCDCDC"

document.all.fullgetcodetab.style.color="#000000"
document.all.fullsettingstab.style.color="#808080"

document.all.fullsettingstab.style.zIndex=0
document.all.fullgetcodetab.style.zIndex=2

document.all.fullsettingsbox.style.visibility="hidden"
document.all.pageexitgetcodebox.style.visibility="hidden"
document.all.scrollviewgetcodebox.style.visibility="visible"



}
// end scrollview launch trigger





if(formfulllaunchtrigger=="pageexit"){



var tnow=new Date()
var randckname="full"+tnow.getTime()

var codetxt='\<script\>\n'

codetxt+='var peoff=0\n'

codetxt+='function '+randckname+'pego(){\n'
codetxt+='if(peoff==0){\n'

if(formfullstyle=="1"){

codetxt+='var fullwin=window.open("'+formfullpageurl+'","")\n'

}
else{

codetxt+='var fullwin=window.open("'+formfullpageurl+'","")\n'
codetxt+='self.focus()\n'
codetxt+='fullwin.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.fullsettingsform.fullfreq.length;i++){
if(document.fullsettingsform.fullfreq[i].checked){
var fullfreq=i+1
}
}


if(fullfreq!=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(fullfreq!=1){

codetxt+='var '+randckname+'pefreqcook='+randckname+'GetCookie("'+randckname+'")\n'

codetxt+='if(!'+randckname+'pefreqcook){\n'

codetxt+='document.body.onunload='+randckname+'pego\n'


if(fullfreq==2){
codetxt+='document.cookie="'+randckname+'=Y"\n'
}

if(fullfreq==3){
var expdays=(document.fullsettingsform.fullfdays.value)*86400
var exphours=(document.fullsettingsform.fullfhours.value)*3600
var expminutes=(document.fullsettingsform.fullfminutes.value)*60
var expseconds=(document.fullsettingsform.fullfseconds.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.fullgetcodetab.style.border="1px solid #000000"
document.all.fullsettingstab.style.border="1px solid #808080"

document.all.fullgetcodetab.style.borderBottom="2px solid #99CCFF"
document.all.fullsettingstab.style.borderBottom="1px solid #000000"

document.all.fullgetcodetab.style.backgroundColor="#99CCFF"
document.all.fullsettingstab.style.backgroundColor="#DCDCDC"

document.all.fullgetcodetab.style.color="#000000"
document.all.fullsettingstab.style.color="#808080"

document.all.fullsettingstab.style.zIndex=0
document.all.fullgetcodetab.style.zIndex=2

document.all.fullsettingsbox.style.visibility="hidden"
document.all.scrollviewgetcodebox.style.visibility="hidden"
document.all.pageexitgetcodebox.style.visibility="visible"



}
// end pageexit launch trigger





}

}
// END fullgetcode 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 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 formfullpageurl, formfullstyle


function fullpreview(){

// check for incomplete fields

formfullpageurl=document.fullsettingsform.fullpageurl.value
formfullstyle=document.fullsettingsform.fullstyle.value

var inctot=0

var inclist=""

if(!formfullpageurl){
inctot++
inclist+="- Page URL\n"
}


if(inctot>0){
// Incomplete
alert("You must enter the following before you can preview the Full window...\n\n"+inclist)
}
else{
// Show Preview

if(formfullstyle=="1"){
// pop-up style preview


var fullwin=window.open(formfullpageurl,"")

}
else{
// pop-under style preview



var fullwin=window.open(formfullpageurl,"")
self.focus()
fullwin.blur()




}


}


}
// END fullpreview function





// End FULL Window


