var ElementMaxHeight = function() {
this.initialize.apply(this, arguments);
}
ElementMaxHeight.prototype = {
initialize: function(className) {
this.elements = document.getElementsByClassName(className || 'maxheight');
this.textElement = document.createElement('span');
this.textElement.appendChild(document.createTextNode('A'));
this.textElement.style.display = 'block';
this.textElement.style.position = 'absolute';
this.textElement.style.fontSize = '1em';
this.textElement.style.top = '-1000px';
this.textElement.style.left = '-1000px';
document.body.appendChild(this.textElement);
this.textElementHeight = document.getDimensions(this.textElement).height;
var __object = this;
var __checkFontSize = this.checkFontSize;
this.checkFontSizeInterval = window.setInterval(function() {return __checkFontSize.apply(__object)}, 500);
this.expand();
// Refresh elements height onResize event
var __expand = this.expand;
if (window.addEventListener) {
window.addEventListener('resize', function(event) {return __expand.apply(__object, [( event || window.event)])}, false);
} else if (window.attachEvent) {
window.attachEvent('onresize', function(event) {return __expand.apply(__object, [( event || window.event)])});
}
},
expand: function() {
this.reset();
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height = document.getDimensions(this.elements[i].parentNode).height + 'px';
}
},
reset: function() {
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height = 'auto';
}
},
checkFontSize: function() {
var height = document.getDimensions(this.textElement).height;
if(this.textElementHeight != height) {
this.textElementHeight = height;
this.expand();
}
}
}
if (!!document.evaluate) {
document._getElementsByXPath = function(expression, parentElement) {
var results = [];
var query = document.evaluate(expression, parentElement || document,
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0, length = query.snapshotLength; i < length; i++)
results.push(query.snapshotItem(i));
return results;
}
}
document.getElementsByClassName = function(className, parentElement) {
if (!!document.evaluate) {
var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
return document._getElementsByXPath(q, parentElement);
} else {
var children = (parentElement || document.body).getElementsByTagName('*');
var elements = [], child;
for (var i = 0, length = children.length; i < length; i++) {
child = children[i];
if (child.className.length != 0 &&
(child.className == className ||
child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))) {
elements.push(child);
}
}
return elements;
}
}
document.getDimensions = function (element) {
var display = element.style.display;
if (display != 'none' && display != null) { // Safari bug
return {width: element.offsetWidth, height: element.offsetHeight};
}
return {width: originalWidth, height: originalHeight};
}
function calculate(){
if ( document.getElementById('q2').value != 0 )
{
var weekly = document.getElementById('q1').value*
document.getElementById('q2').value*
document.getElementById('q3').value;
var monthly = weekly*52/12;
var yearly = monthly*12;
document.getElementById('weekly').innerHTML = parseInt(weekly);
document.getElementById('monthly').innerHTML = parseInt(monthly);
document.getElementById('yearly').innerHTML = parseInt(yearly);
}
}
function redeem()
{
var codeText = document.couponCode.code.value.toUpperCase();
if (codeText == "SURVEY20")
{
document.getElementById('buttonDiv').innerHTML = '
';
document.getElementById('bDiv').style.visibility = 'hidden';
document.getElementById('paypal').innerHTML = 'Click to Pay $'+'68.00'+' via PayPal
Click to Pay $'+'48.00'+' via Paypal';
document.getElementById('visa').innerHTML = 'Click to Pay $'+'68.00'+' via Credit Card
Click to Pay $'+'48.00'+' via Credit Card';
}
else
{
document.getElementById('bDiv').style.visibility = 'visible';
}
}
function Discount()
{
if (bDiscount)
{
location.href = "http://www.paid-surveys-at-home.com/discount.php";
return '************************************************************\nToday we have a Special "HALF PRICE" Discount\n************************************************************\n\nWAIT! Before You Leave:\n\nI am going to personally offer you a special discount I normally only offer my friends and family.\n\nYou can get "Paid Surveys at Home" for HALF PRICE by clicking the CANCEL button below.\n\nYou will get my entire system for only $48. That is HALF PRICE of the usual price of $68.\n\nClick on the CANCEL button below.\n\n************************************************************\nTodays Special HALF OFF Discount\n************************************************************\n';
}
}
function Discount2()
{
if (bDiscount)
{
location.href = "http://9.surveys24.pay.clickbank.net/?&detail=Paid+Surveys+at+Home&price=9.00&cbskin=167&tid=167";
return '************************************************************\nSTOP\n\n\nThis Offer is Your Last Chance!!!\n\nGet Instant Access to Paid Surveys at Home for a One-Time Membership Fee of Only $9.00\n\nClick CANCEL Below to Get Instant Access For Just $9.00\n\n\n************************************************************';
}
}