/* LPG 5.2 */
var LPG={is_extended:false,opened:false,is_in:false,CountActive:true,CountStepper:-1,LeadingZero:true,SetTimeOutPeriod:0,obj:new Object(),jdata:null,yes_to_payment_plan:0,external_javascript:true,validateEmailSchema:/^.+@.+\..{2,3}$/,loadingExtendedOptinFormMessage:'Going to step 2...<BR /><img src=\"images/bar.gif\">',submitOptinFormMessage:'Submitting data...<BR /><img src=\"images/bar.gif\">',skipValidation:new Array("bump1","bump2","subscription","checkbox","","middlename1","middlename2","street1address2","street2address2","TOS"),init:function(){if(e_active=='1'){document.onmousemove=LPG.mmove}LPG.get_vars()},validate:function(type,e){switch(type){case"char":notallowed="1234567890!@#$%^&*;:'\",.?/\\|~`_-(){}[]<>+= ";break;case"charnum":notallowed="!@#$%^&*;:'\",.?/\\|~`_-(){}[]<>+= ";break;case"simpletext":notallowed="1234567890!@#$%^&*;:'\",.?/\\|~`_-(){}[]<>+=";break;case"num":notallowed="abcdefghijklmnopqrstuvwxyz!@#$%^&*;:'\",.?/\\|~`_-(){}[]<>+= ";break;default:notallowed=""}var input=e.value.split("");for(i=0;i<input.length;i++){for(x=0;x<notallowed.length;x++){if(input[i]==notallowed.substr(x,1)){input.splice(i,1);i--;break}}}e.value=input.join("")},get_extended_optinform:function(){var post_data=$('optinform').serialize();new Ajax.Request('index.php',{parameters:'mode=extended_optinform&'+post_data,evalJSON:true,onLoading:function(){$('oform').innerHTML=LPG.loadingExtendedOptinFormMessage},method:'POST',onComplete:function(r){$('oform').innerHTML=r.responseText}});return false},submit_optinform:function(){if(LPG.is_extended){if(!LPG.checkform($("extended_optinform"))){return false}}else{if(!LPG.checkform($("optinform"))){return false}}if(extended_optinform=="1"&&!LPG.is_extended){LPG.get_extended_optinform();LPG.is_extended=true;return false}else{var oform=null;var post_data="";if(extended_optinform=="1"){oform=$('extended_optinform');post_data=$('extended_optinform').serialize()}else{oform=$('optinform');post_data=$('optinform').serialize()}new Ajax.Request('index.php',{parameters:'mode=optinform&combo_string='+combo_string+'&template_id='+template_id+"&"+post_data,evalJSON:true,method:'POST',onLoading:function(){$('ostatus').innerHTML=LPG.submitOptinFormMessage},onComplete:function(r){oform.submit()}});return false}},get_vars:function(){var q=window.location.search.substring(1);var q2=q.split('&');for(var i=0;i<q2.length;i++){var q3=q2[i].split('=');LPG.obj[q3[0]]=q3}},checkform:function(f){var error_message=new Object();for(z=0;z<f.length;z++){var name=f[z].name;var type=f[z].type;var ok=true;for(v=0;v<LPG.skipValidation.length;v++){if(LPG.skipValidation[v]==name){ok=false;break}}if(ok){if(type=='select-one'||type=='checkbox'||type=='radio'||type=='text'||type=='textarea'){error_message[name]=true}}}for(i=0;i<f.length;i++){var value=f[i].value;var type=f[i].type;var name=f[i].name;var ok=true;for(v=0;v<LPG.skipValidation.length;v++){if(LPG.skipValidation[v]==name){ok=false;break}}if(ok){if(type=='select-one'){if(f[i].options[f[i].selectedIndex].value!='-1'&&f[i].options[f[i].selectedIndex].value!=''){error_message[name]=false}}else if(type=='checkbox'||type=='radio'){if(f[i].checked==true){error_message[name]=false}}else if(type=='text'){if(name=="email1"||name=="email2"){var RegExPattern=LPG.validateEmailSchema;if(value.match(RegExPattern)){error_message[name]=false}}else{if(value!=''){error_message[name]=false}}}else if(type=='textarea'){if(value!=''){error_message[name]=false}}}}var error=false;var message='The following fields are required:\r\n';for(x in error_message){if(error_message[x]){displayname=LPG.fetchFieldFilter(x);message+=displayname+'\r\n';error=true}}if(error){alert(message);return false}return true},fetchFieldFilter:function(x){var displayname="";switch(x){case"title":displayname="Title";break;default:displayname=x}return displayname},mmove:function(e){if(LPG.opened)return true;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight}var posx=0;var posy=0;if(!e)var e=window.event;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY}else if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}if(posy<10+document.body.scrollTop){if(!is_in)nrp++;is_in=true;LPG.opened=true;return GB_show(e_texttitle,e_htmlfile,e_height,e_width);return true}else{is_in=false}return true},peel_away_code:function(){document.write('<style type="text/css">'+'#unlayout { top:-1000px; }');if(navigator.appVersion.indexOf('nd')!=-1||navigator.appName.indexOf('ro')!=-1){document.write('#cvlayout { top:'+top+'; right:'+right+'; } #unlayout { right:'+right+'; }')}else{document.write('#cvlayout { top:-1000px; right:'+right+'; } #unlayout { right:'+right+'; }')}document.write('</style>');document.write('<script language=\'javascript\'>function pguncover(command, args) {if (command == \'act_ppo\') {cvlayout.style.top = \'-1000px\';unlayout.style.top = top;}}function pgcover(command, args) {if (command == \'act_ppc\') {cvlayout.style.top = top;unlayout.style.top = \'-1000px\';}}function setpos(param1, param2, param3, param4, param5) {document.getElementById(param2).style.top = param3;document.getElementById(param4).style.top = param5;if (navigator.appName.indexOf(\'ro\') != -1) {window.resizeBy(-1, -1); window.resizeBy(1, 1);}}</script><div id="cvlayout" style="position:absolute; width:75px; height:75px; z-index:19001;">'+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="cover" width="75" height="75">'+'<param name="allowScriptAccess" value="always"><param name="movie" value="smalltopr.swf"><param name="wmode" value="transparent"><param name="FlashVars" value="smallimg='+smallimg+'&scrolltxtsmall='+scrolltxtsmall+'&txtsizesmall='+txtsizesmall+'&textcolor='+textcolorsmall+'">'+'<embed src="smalltopr.swf" id="cover" name="cover" wmode="transparent" flashvars="smallimg='+smallimg+'&scrolltxtsmall='+scrolltxtsmall+'&txtsizesmall='+txtsizesmall+'&textcolor='+textcolorsmall+'"width="75" height="75" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'+'</object>'+'</div>'+'<div id="unlayout" style="position:absolute; height:600px; width:800px; z-index:20000;">'+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="uncover" width="800" height="600">'+'<param name="allowScriptAccess" value="always"><param name="movie" value="bigtopr.swf"><param name="wmode" value="transparent"><param name="FlashVars" value="bigimg='+bigimg+'&urlval='+urlval+'&window='+owindow+'&scrolltxtbig='+scrolltxtbig+'&txtsizebig='+txtsizebig+'&textcolor='+textcolorbig+'&yaxis=0">'+'<embed src="bigtopr.swf" wmode="transparent" width="800" height="600" flashvars="bigimg='+bigimg+'&urlval='+urlval+'&window='+owindow+'&scrolltxtbig='+scrolltxtbig+'&txtsizebig='+txtsizebig+'&textcolor='+textcolorbig+'&yaxis=0" id="uncover" name="uncover" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'+'</object>'+'</div>');if(navigator.appName&&navigator.appName.indexOf('ro')!=-1&&navigator.userAgent.indexOf('nd')!=-1&&navigator.userAgent.indexOf('3.1')==-1){document.write('<script language="VBScript">\n'+'On Error Resume Next\n'+'Sub cover_FSCommand(ByVal command, ByVal args)\n'+'Call pguncover(command, args)\n'+'End Sub\n'+'Sub uncover_FSCommand(ByVal command, ByVal args)\n'+'Call pgcover(command, args)\n'+'End Sub\n'+'<\/script>')}},calcage:function(secs,num1,num2){s=((Math.floor(secs/num1))%num2).toString();if(LPG.LeadingZero&&s.length<2)s="0"+s;return"<b>"+s+"</b>"},CountBack:function(secs){if(secs<0){if(jdata.countdown_redirect_yes=="true"){if(jdata.countdown_delay!=0){document.getElementById("cntdwn").innerHTML=jdata.countdown_message;setTimeout("LPG.CountBack(0)",jdata.countdown_delay*1000);jdata.countdown_delay=0}else{if(jdata.countdown_gb_yes=="true"){GB_show('',jdata.countdown_redirect_url,jdata.countdown_gb_height,jdata.countdown_gb_width)}else{window.location=jdata.countdown_redirect_url}}}else{document.getElementById("cntdwn").innerHTML=jdata.countdown_message}return}DisplayFormat=jdata.countdown_format;DisplayStr=DisplayFormat.replace(/%%D%%/g,LPG.calcage(secs,86400,100000));DisplayStr=DisplayStr.replace(/%%H%%/g,LPG.calcage(secs,3600,24));DisplayStr=DisplayStr.replace(/%%M%%/g,LPG.calcage(secs,60,60));DisplayStr=DisplayStr.replace(/%%S%%/g,LPG.calcage(secs,1,60));document.getElementById("cntdwn").innerHTML=DisplayStr;if(LPG.CountActive)setTimeout("LPG.CountBack("+(secs+LPG.CountStepper)+")",LPG.SetTimeOutPeriod)},CountDownTimer:function(data){jdata=data.evalJSON();document.write("<span id=\'cntdwn\'></span>");if(jdata.countdown_redirect_url==""){jdata.countdown_redirect_url=jdata.countdown_template}LPG.CountStepper=Math.ceil(LPG.CountStepper);if(LPG.CountStepper==0)LPG.CountActive=false;LPG.SetTimeOutPeriod=(Math.abs(LPG.CountStepper)-1)*1000+990;var dthen=new Date(jdata.countdown_start);var dnow=new Date();if(LPG.CountStepper>0){ddiff=new Date(dnow-dthen)}else{ddiff=new Date(dthen-dnow)}gsecs=Math.floor(ddiff.valueOf()/1000);LPG.CountBack(gsecs)}};