var nextstep='';
var kkk=""+document.location;

if (kkk.indexOf('?')>-1) {
kkk=kkk.substring(kkk.indexOf('?')+1);
}

if (kkk.indexOf('&&')>-1) {
var fff=new Array();
fff=kkk.split('&&');
kkk=fff[0]+'_'+fff[1];
}

var lastchance2="WAIT!!! --- I will make you a one time offer ; get any version at 35% off; today only.\n\nThis offer will NOT be available again. \n\nYou will save:\n$35 off Basic Version\n$65 off Silver Version\n$210 off Platinum Version.\n\nClick 'OK' to go to special order page OR 'CANCEL' to continue.";

var lastchance="WAIT!!! --- OK... final offer... Ssshhh... do not tell the boss ;)\n\nI will make you a one time offer ; get any version at 50% off; today only.\n\nThis offer will NOT be available again. \n\nYou will save:\n$50 off Basic Version\n$100 off Silver Version\n$300 off Platinum Version.\n\nClick 'OK' to go to special order page OR 'CANCEL' to continue.";

var ffff=document.cookie;
var killcookie=0;

function checkfaq() {

var fff=""+document.location;

//if (nextstep.indexOf('order')<0) {
//window.open("http://www.becanada.com/reward.htm?"+kkk,"_blank","scrollbars=yes");
//}

if (ffff.indexOf('PSUoffer1')<0 && ffff.indexOf('PSUoffer2')<0 && killcookie != 1) {

if (fff.indexOf('order50.htm')<0 && fff.indexOf('order35.htm')<0 && nextstep.indexOf('order')<0 ) {

if (confirm(lastchance2) == true ) {
document.location="order35.htm";
}
else {
document.cookie="offer=PSUoffer1; path=/";
document.cookie="offer2=PSUoffer2; path=/";
}


}

}


if (ffff.indexOf('PSUoffer2')<0 && killcookie != 1) {

if (fff.indexOf('order35.htm')>-1 && nextstep.indexOf('order')<0 ) {

if (confirm(lastchance) == true) {
document.location="order50.htm";
}
else {
document.cookie="offer2=PSUoffer2; path=/";
document.cookie="offer=PSUoffer1; path=/";
}

}

}

// alert(document.cookie);

}


function checksecure() {

var fff=""+document.location;

if (ffff.indexOf('PSUoffer1')>-1 && fff.indexOf('order35.htm')>-1 ) {
document.all.orderpagegone.style.display='inline';
setTimeout("document.location='order-all.htm'","5000");
}

if (ffff.indexOf('PSUoffer2')>-1 && fff.indexOf('order50.htm')>-1 ) {
document.all.orderpagegone.style.display='inline';
setTimeout("document.location='order-all.htm'","5000");
}

if (fff.indexOf('order35.htm')>-1 && ffff.indexOf('PSUoffer1')<0) {
document.cookie="offer=PSUoffer1; path=/";
document.all.orderpage.style.display='inline';
}

if (fff.indexOf('order50.htm')>-1 && ffff.indexOf('PSUoffer2')<0) {
document.cookie="offer2=PSUoffer2; path=/";
document.all.orderpage.style.display='inline';
}


}


function checkfriday() {

var f=new Date();
var m=f.getMonth();
var d=f.getDate();
var y=f.getYear();
var fff=""+document.location;

// alert(m+" "+d);

// var m=11;

if ( m==10 && (d==25 || d==26 || d==27 || d==28) ) {

if (fff.indexOf('order-bf.htm')<0 ) {
setTimeout("document.location='order-bf.htm'","100");
}
else {
document.all.orderpage.style.display='inline';
}

}

else {

if (fff.indexOf('order-bf.htm')>0 ) {
setTimeout("document.location='order-all.htm'","1000");
}
else {
checksecure();
onunload=checkfaq;
}

}


}

//onload=checksecure;
//onunload=checkfaq;

onload=checkfriday;

function checkcheckout() {

var mess="";
var em=document.forms[0].email.value;

document.forms[0].firstname.style.backgroundColor='white';
document.forms[0].lastname.style.backgroundColor='white';
document.forms[0].email.style.backgroundColor='white';

if (document.forms[0].firstname.value=="") { 
mess=mess+"STEP 3 - Error - First name field is blank\n\n"; 
document.forms[0].firstname.style.backgroundColor='yellow';
}

if (document.forms[0].lastname.value=="") { 
mess=mess+"STEP 3 - Error - Last name field is blank\n\n"; 
document.forms[0].lastname.style.backgroundColor='yellow';
}

if (em=="") { 
mess=mess+"STEP 3 - Error - Email Address field is blank\n\n"; 
document.forms[0].email.style.backgroundColor='yellow';
}

if (em.indexOf(".")<0 || em.indexOf("@")<0) { 
document.forms[0].email.style.backgroundColor='yellow';
mess=mess+"STEP 3 - Error - Email Address requires a '@' and '.' in address - format example 'myusername@myisp.com'.\n\n"; 
}


if (ffff.indexOf('PSUoffer1')<0) {
document.cookie="offer=PSUoffer1; path=/";
killcookie=1;
}

if (ffff.indexOf('PSUoffer2')<0) {
document.cookie="offer2=PSUoffer2; path=/";
killcookie=1;
}

if (mess!="") {
alert("Opps... There was a problem ; please correct:\n\nThere are the following errors - please correct the following field[s] in YELLOW , \nthen re-click an ordering button.\n\n"+mess+"\n\nClick OK to continue");
}
else {
nextstep='online-order';
return true;
}



}


