/* CLICK LISTENER */
window.addEvent = function(elem,type,callback) {
var evt = function(e) {
e = e || window.event;
return callback.call(elem,e);
}, cb = function(e) {return evt(e);};
if( elem.addEventListener) {
elem.addEventListener(type,cb,false);
}
else if( elem.attachEvent) {
elem.attachEvent("on"+type,cb);
}
return elem;
};
window.findParent = function(child,filter,root) {
do {
if( filter(child)) return child;
if( root && child == root) return false;
} while(child = child.parentNode);
return false;
};
window.hasClass = function(elem,cls) {
if( !('className' in elem)) return;
return !!elem.className.match(new RegExp("\\b"+cls+"\\b"));
};
window.addEvent(document.body,"click",function(e) {
var s = window.findParent(e.srcElement || e.target,function(elm) {
return window.hasClass(elm,"ccbcompactfeedrow");
},this);
if(s) {
var ccbcontent = s.getElementsByClassName('ccbproductcontentcontainer')[0];
var ccbinfo = s.getElementsByClassName('more_info')[0];
if (ccbcontent.style.display === 'block') {
document.querySelectorAll('.ccbproductcontentcontainer').forEach(function(el) {
el.style.display = 'none';
});
document.querySelectorAll('.more_info').forEach(function (el) {
el.textContent = 'More Details...';
el.style.color = '#1a73e8';
});
ccbinfo.textContent = 'More Details...';
ccbinfo.style.color = '#1a73e8';
if (typeof jQuery === 'undefined') {
ccbcontent.style.display = 'none';
}
else {
jQuery(ccbcontent).slideUp().css('display', 'none');
}
}
else {
document.querySelectorAll('.ccbproductcontentcontainer').forEach(function(el) {
el.style.display = 'none';
});
document.querySelectorAll('.more_info').forEach(function (el) {
el.textContent = 'More Details...';
el.style.color = '#1a73e8';
});
ccbinfo.textContent = 'Close Details...';
ccbinfo.style.color = 'red';
if (typeof jQuery === 'undefined') {
ccbcontent.style.display = 'block';
}
else {
jQuery(ccbcontent).slideDown().css('display', 'block');
}
}
}
});
/* END CLICK LISTENER */
var ccb_site_url = 'https://creditcardbroker.com/';
var ccb_site_url_u = 'https://creditcardbroker.com/';
var ccb_safe_site = location.hostname.match(/creditcardbroker/) != null;
var viwprt = document.querySelector("meta[name=viewport]");
if (!viwprt) {
var metaTag=document.createElement('meta');
metaTag.name = "viewport"
metaTag.content = "width=device-width, initial-scale=1.0"
document.getElementsByTagName('head')[0].appendChild(metaTag);
}
// Include JS/CSS file if desired
function loadjscssfile(filename, filetype){
var fileref;
if (filetype === "js"){ //if filename is an external JavaScript file
fileref=document.createElement('script');
fileref.type = "application/javascript";
fileref.src = filename;
}
else if (filetype === "css"){ //if filename is an external CSS file
var fileref=document.createElement("link");
fileref.rel = "stylesheet";
fileref.type = "text/css";
fileref.href = filename;
}
if (typeof fileref !== 'undefined') { document.getElementsByTagName("head")[0].appendChild(fileref); }
}
if(typeof jQuery === 'undefined' || (typeof $addjquery !== 'undefined' && $addjquery != 'no')) {
loadjscssfile(ccb_site_url_u+"includes/jquery/custom-blue2/js/jquery-1.7.2.min.js", "js");
//loadjscssfile(ccb_site_url_u+"includes/jquery/custom-blue2/js/jquery-ui-1.8.21.custom.min.js", "js");
//loadjscssfile(ccb_site_url_u+"includes/jquery/custom-blue2/css/custom-theme/jquery-ui-1.8.21.custom.css", "css");
}
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
viewportmeta.setAttribute("content", 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0');
}
else {
var myvpmeta = document.createElement('meta');
myvpmeta.name = 'viewport';
myvpmeta.content = 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0';
document.getElementsByTagName('head')[0].appendChild(myvpmeta);
}
function jqueryLoaded() {
//do stuff
if($show_dropdowns === "yes") {
jQuery(document).ready(function(){
showdropdownoffers();
} );
}
var creditratingsteps = new Array();
var therealvalue = new Array();
var i;
for (i=0; i<=10; i=i+.5) {
creditratingsteps[i]= "All Credit";
therealvalue[i] = "all";
}
for (i=10; i<=20; i=i+.5) {
creditratingsteps[i]= "Bad Credit";
therealvalue[i] = 6;
}
for (i=20; i<=30; i=i+.5) {
creditratingsteps[i]= "Fair Credit";
therealvalue[i] = 3;
}
for (i=30; i<=40; i=i+.5) {
creditratingsteps[i]= "Good Credit";
therealvalue[i] = 4;
}
for (i=40; i<=50; i=i+.5) {
creditratingsteps[i]= "Excellent Credit";
therealvalue[i] = 5;
}
} // End of do stuff
function checkJquery() {
if (window.jQuery && jQuery.ui) {
jqueryLoaded();
} else {
window.setTimeout(checkJquery, 100);
}
}
checkJquery();
if(!$count) { var $count = 0; }
var $DisplayCardOfferDetails = new Array();
var $feed_html = '';
var $category_dropdown_options = new Array();
var $bank_dropdown_options = new Array();
var $credit_ratings_dropdown_options = new Array();
var $category_dropdown_html = "";
var $bank_dropdown_html = "";
var $credit_rating_dropdown_html = "";
$count = $count + 1;
/* BEGIN PRODUCT SECION */
$feed_html += '" ;="" product="" content="" $displaycardofferdetails[$count]="no" +$count+'"="" style="font-size: 11px; color: rgb(0, 0, 0); font-weight: bold; text-align: center;">Intro APR
N/A
Regular APR
24.64% variable
';
$feed_html += '';
// end product content
$feed_html += '';
/* END PRODUCT SECION */
$count = $count + 1;
/* BEGIN PRODUCT SECION */
$feed_html += '" ;="" product="" content="" $displaycardofferdetails[$count]="no" +$count+'"="" style="font-size: 11px; color: rgb(0, 0, 0); font-weight: bold; text-align: center;">Intro APR
--
';
$feed_html += '';
// end product content
$feed_html += '';
/* END PRODUCT SECION */
$count = $count + 1;
/* BEGIN PRODUCT SECION */
$feed_html += '" ;="" product="" content="" $displaycardofferdetails[$count]="no" end="" *="" secion="" $count="$count" 1;="" begin="" +$count+'"="" style="font-size: 11px; color: rgb(0, 0, 0); font-weight: bold; text-align: center;">Intro APR
--
';
$feed_html += '';
// end product content
$feed_html += '';
/* END PRODUCT SECION */
$count = $count + 1;
/* BEGIN PRODUCT SECION */
$feed_html += '" ;="" product="" content="" $displaycardofferdetails[$count]="no" end="" *="" secion="" $count="$count" 1;="" begin="" $category_dropdown_html="" $bank_dropdown_html="" $credit_rating_dropdown_html="" var="" $product_image_numeric_width="225;" $product_image_width="32%" $product_image_numeric_width+'px';="" $product_image_column_width_num="210;" $product_image_column_width="$product_image_column_width_num+'px';" $product_heading_width;="" $product_table_padding;="" $most_popular_image_width;="" $transparent_background_is_true="(typeof" $transparent_background="" !="=" 'undefined'="" &&="" 'yes');="" $product_heading_width="100%" $most_popular_image_width="$product_heading_width;" $product_description_width="65%" $product_description_min_width="50%" $product_description_mobile_width="auto!important" $product_heading_mobile_width="100%!important" $product_mobile_width="100%!important" $product_box_background_color="#FFFFFF" $boxbgcolor;="" if(typeof="" $boxbgcolor="" 'undefined')="" {="" }="" $product_heading_background_color;="" $hbgcolor;="" $product_heading_background_color="#FFFFFF" $hbgcolor="" $product_heading_text_color="#000000" $htextcolor;="" $htextcolor="" $product_heading_font_size="16px" $hfontsize;="" $hfontsize="" $product_description_bg_color="transparent" $pdbgcolor;="" $pdbgcolor="" if="" ($transparent_background_is_true)="" $product_description_text_color="#000000" $pdtextcolor;="" if($pdtextcolor="" $product_description_font_size="13px" "1.333em";="" $pdfontsize;="" $pdfontsize="" $product_description_border_left="#FFFFFF" $pdborderleft;="" $pdborderleft="" $product_description_border_right="#FFFFFF" $pdborderright;="" if($pdborderright="" $footer_bg_color;="" $fbgcolor;="" $footer_bg_color="#FFFFFF" $fbgcolor="" $footer_text_color="#000000" $ftextcolor;="" if($ftextcolor="" $footer_font_size="11px" $ffontsize;="" $ffontsize="" $bulletstyle;="" $additional_css;="" $bulletstyle="" $additional_css=".ccbproductcontainer ul { list-style-type: " }';="" else="" $ccbheader_bg_color;="" $ccbheaderbgcolor;="" $ccbheader_bg_color="#FFFFFF" dark="" blue="" original="" matches="" the="" heading="" bg="" $ccbheaderbgcolor="" )="" $ccbbutton_bg_color="#318ccc" '#055fa8';="" $product_table_bgcolor="$transparent_background_is_true" ?="" 'transparent'="" :="" 'white';="" $product_table_border_color="#F3F3F3" $product_table_dropshadow="#EEEEEE" +$product_description_bg_color+';margin-right:="" 15px;margin-left:="" auto;}';="" +$ccbheader_bg_color+';color:'+$product_heading_text_color+';font-family:="" arial,="" helvetica,="" sans="" serif;margin-right:="" auto;margin-left:auto;border-radius:="" 0.5em;border-top:="" 1px="" solid="" #eeeeee;border-left:="" #eeeeee;border-right:="" #eeeeee;border-bottom:="" #eeeeee;vertical-align:="" top;box-sizing:="" border-box;filter:="" drop-shadow(1px="" #eeeeee);}';="" +$product_table_padding+';="" padding-right:="" 10px;padding-left:="" 10px;background-color:'+$ccbheader_bg_color+';="" font-family:arial,="" sans-serif;="" border-top-left-radius:="" 15px!important;border-top-right-radius:="" 15px!important;}';="" +$product_heading_text_color+';="" text-align:left;="" vertical-align:top;}';="" 10px;padding-top:="" 10px;text-align:left;="" background-color:'+$ccbheader_bg_color+'="" !important;="" border-bottom-left-radius:="" 15px="" !important;border-bottom-right-radius:="" +$product_heading_width+'!important;color:#ff0000;margin:0;="" +$product_heading_width+'!important;margin:0;margin-left:5px;="" margin-top:15px;padding:="" '+$product_table_padding+';text-align:center;font-family:arial,="" font-size:11px;="" border-bottom:="" #ddd;="" +$ccbheader_bg_color+';color:'+$product_heading_text_color+';font-weight:bold;border-top-left-radius:10px;border-top-right-radius:10px;border:="" #ddd;}';="" +$product_table_bgcolor+';width:="" 100%;z-index:="" 500;font-family:="" sans-serif;font-size:="" 12px;vertical-align:="" top;margin-left:="" auto;margin-right:="" auto;margin-top:="" -10px;}';="" +$product_table_bgcolor+';color:black;border-top:1px="" '+$product_table_border_color+';border-left:1px="" '+$product_table_border_color+';border-right:1px="" '+$product_table_border_color+';="" border-bottom:1px="" '+$product_table_border_color+';vertical-align:top;border-radius:="" 0.5em;box-sizing:="" border-box;filter:drop-shadow(1px="" '+$product_table_dropshadow+');}';="" +$product_description_bg_color+'="" color:="" '+$product_description_text_color+'="" font-size:="" '+$product_description_font_size+'="" !important;line-height:1.6em;margin:0;padding:6px;="" padding-left:="" 8px;padding-top:="" 10px;word-wrap:="" normal;text-align:left;vertical-align:top;}';="" +$ccbbutton_bg_color+';border:="" none;color:="" white;padding:="" 0.5em!important;text-align:="" center;text-decoration:="" none;display:="" inline-block;font-size:1.1em;font-weight:="" bold;margin:="" 0;cursor:="" pointer;vertical-align:="" middle;border-radius:0.5em;}';="" +$product_description_bg_color+';color:black;}';="" +$product_table_border_color+';="" border-style:="" dotted;="" border-width:="" thin;="" border-top-style:="" solid;vertical-align:="" top;min-height:="" 84px;}';="" +$product_table_bgcolor+';border-left:="" #ddd;border-right:="" #ddd;border-bottom:="" function="" showdropdownoffers="" (item)="" $category_to_show="." $bank_to_show="." $credit_rating_to_show="." jquery('div.ccbproductcontainer').css('display','block');="" jquery('.isaltcolor').addclass('ccbcompactfeedaltrowcolor');="" if($show_category_dropdowns="==" "yes"="" item="" item.id="==" 'getcategoryoffers')="" $a="document.getElementById('getcategoryoffers').selectedIndex;" $selected_category="document.getElementById("getcategoryoffers").options[$a].value;" jquery('#getbankoffers').val('all');="" jquery('#getcreditratingoffers').val('all');="" if($selected_category="" $selected_category;="" jquery('div.ccbproductcontainer').not($category_to_show).css('display','none');="" jquery('.ccbcompactfeedaltrowcolor').removeclass('ccbcompactfeedaltrowcolor');="" if($show_bank_dropdowns="==" 'getbankoffers')="" $b="document.getElementById('getbankoffers').selectedIndex;" $selected_bank="document.getElementById("getbankoffers").options[$b].value;" jquery('#getcategoryoffers').val('all');="" if($selected_bank="" $selected_bank;="" jquery('div.ccbproductcontainer').not($bank_to_show).css('display','none');="" if($show_credit_rating_dropdowns="==" 'getcreditratingoffers')="" $c="document.getElementById('getcreditratingoffers').selectedIndex;" $selected_creditrating="document.getElementById("getcreditratingoffers").options[$c].value;" if($selected_creditrating="" $selected_creditrating;="" jquery('div.ccbproductcontainer').not($credit_rating_to_show).css('display','none');="" checknumccbresults();="" of="" $error_html;="" checknumccbresults()="" hiddenels="jQuery('.ccbproductcontainer:hidden');" visibleels="jQuery('.ccbproductcontainer:visible');" numhiddenels="hiddenEls.length;" numvisibleels="visibleEls.length;" if(numvisibleels="" <="" 1)="" $error_html="The combinations of Category, Bank, and Credit Rating that you chose do not have results.
Please choose another combination to see results or choose �Display All� to see all results." jquery(".ccberrorresults").html($error_html);="" $show_dropdowns;="" $show_category_dropdowns;="" $show_bank_dropdowns;="" $show_credit_rating_dropdowns;="" $show_header;="" $header_image;="" $custom_header_image;="" $show_dropdown_image;="" $dropdown_image;="" $custom_dropdown_image;="" $show_footer;="" total_rows_products="10;" has_product_rows="total_rows_products"> 0;
var not_enough_rows = total_rows_products < 4;
var currentScriptt = document.currentScript;
console.log('Current Script:');
console.log(currentScriptt.src);
console.log('Total product rows: '+total_rows_products);
var $html_append = document.createElement('div');
$html_append.className = 'ccbcontainer';
$compact_feed = document.createElement('div');
$compact_feed.className = 'ccbcompactfeed';
var ccbcfheader = document.createElement('div');
ccbcfheader.className = 'ccbcompactfeedheader';
var ccbcfc1 = document.createElement('div');
ccbcfc1.className = 'ccbcompactfeedhcell ccbcompactfeedcardhcellwidth';
ccbcfc1.innerHTML = 'Offer';
ccbcfheader.appendChild(ccbcfc1);
//var ccbcfc2 = document.createElement('div');
//ccbcfc2.className = 'ccbcompactfeedhcell ccbcompactfeedcellwidth ccbhideme';
//ccbcfc2.innerHTML = 'Best For';
//ccbcfheader.appendChild(ccbcfc2);
var ccbcfc3 = document.createElement('div');
ccbcfc3.className = 'ccbcompactfeedhcell ccbcompactfeedcellwidth ccbhideme';
ccbcfc3.innerHTML = 'Credit Type';
ccbcfheader.appendChild(ccbcfc3);
var ccbcfc4 = document.createElement('div');
ccbcfc4.className = 'ccbcompactfeedhcell ccbcompactfeedcellwidth';
ccbcfc4.innerHTML = 'More Details';
ccbcfheader.appendChild(ccbcfc4);
var ccbcfc5 = document.createElement('div');
ccbcfc5.className = 'ccbcompactfeedhcell ccbcompactfeedbonuscellwidth ccbhideme';
ccbcfc5.innerHTML = 'Apply';
ccbcfheader.appendChild(ccbcfc5);
$compact_feed.appendChild(ccbcfheader);
$compact_feed.innerHTML = $compact_feed.innerHTML + $feed_html;
if(has_product_rows) {
var divccbfh = document.createElement('div');
divccbfh.className = 'ccbfeedheader';
divccbfh.innerHTML = '';
var divccbfh_t = document.createElement('div');
//divccbfh_t.className = 'ccbheadertext';
divccbfh_t.innerHTML = ''; //SELECT A PRODUCT
divccbfh_t.style.display = "none";
divccbfh.appendChild(divccbfh_t);
console.log('Show categories: ' + $show_category_dropdowns);
console.log('Show banks: ' + $show_bank_dropdowns);
console.log('Show ratings: ' + $show_credit_rating_dropdowns);
if(has_product_rows && $show_category_dropdowns === "yes") {
divccbfh.innerHTML = divccbfh.innerHTML + $category_dropdown_html;
}
if(has_product_rows && $show_bank_dropdowns === "yes") {
divccbfh.innerHTML = divccbfh.innerHTML + $bank_dropdown_html;
}
if(has_product_rows && $show_credit_rating_dropdowns === "yes") {
divccbfh.innerHTML = divccbfh.innerHTML + $credit_rating_dropdown_html;
}
if (!not_enough_rows) { $html_append.appendChild(divccbfh); }
$html_append.innerHTML = $html_append.innerHTML + $compact_feed.outerHTML;
$html_append.innerHTML = $html_append.innerHTML + '
';
var $show_footer = "yes";
if($show_footer != "no") {
$html_append.innerHTML = $html_append.innerHTML + '';
}
$html_append.innerHTML = $html_append.innerHTML + '
';
currentScriptt.parentNode.insertBefore($html_append, currentScriptt.nextSibling);
var $i;
for ($i = 1; $i <= $count; $i++) {
var $productcount = "product" + $i;
var $productheadingcount = "productheading" + $i;
var $creditcardimagecount = "creditcardimage" + $i;
var $productdescriptioncount = "productdescription" + $i;
var $productbottomcount = "productbottom" + $i;
var product = document.getElementById($productcount);
var productheading = document.getElementById($productheadingcount);
var creditcardimage = document.getElementById($creditcardimagecount);
var productdescription = document.getElementById($productdescriptioncount);
var productbottom = document.getElementById($productbottomcount);
if($productcount) {
if($DisplayCardOfferDetails[$i] === "yes") {
//productbottom.style.backgroundColor = $footer_bg_color ;
//productbottom.style.padding ="7px";
//productbottom.style.paddingBottom ="7px";
//productbottom.style.paddingLeft ="8px";
//productbottom.style.paddingRight ="8px";
var $productbottoma = "productbottoma" + $i;
var $productbottomb = "productbottomb" + $i;
var $productbottomc = "productbottomc" + $i;
var $productbottomd = "productbottomd" + $i;
var $productbottome = "productbottome" + $i;
var $productbottomf = "productbottomf" + $i;
var $productbottomg = "productbottomg" + $i;
var $productbottomh = "productbottomh" + $i;
var $productbottomi = "productbottomi" + $i;
var $productbottomj = "productbottomj" + $i;
var $productbottomk = "productbottomk" + $i;
var $productbottoml = "productbottoml" + $i;
var productbottoma = document.getElementById($productbottoma);
var productbottomb = document.getElementById($productbottomb);
var productbottomc = document.getElementById($productbottomc);
var productbottomd = document.getElementById($productbottomd);
var productbottome = document.getElementById($productbottome);
var productbottomf = document.getElementById($productbottomf);
var productbottomg = document.getElementById($productbottomg);
var productbottomh = document.getElementById($productbottomh);
var productbottomi = document.getElementById($productbottomi);
var productbottomj = document.getElementById($productbottomj);
var productbottomk = document.getElementById($productbottomk);
var productbottoml = document.getElementById($productbottoml);
if (productbottoma) {
productbottoma.style.fontSize = $footer_font_size ;
productbottoma.style.color = $footer_text_color ;
productbottoma.style.fontWeight ="bold";
productbottoma.style.textAlign ="center";
}
if (productbottomb) {
productbottomb.style.fontSize = $footer_font_size ;
productbottomb.style.color =$footer_text_color ;
productbottomb.style.fontWeight ="bold";
productbottomb.style.textAlign ="center";
}
if (productbottomc) {
productbottomc.style.fontSize = $footer_font_size ;
productbottomc.style.color =$footer_text_color ;
productbottomc.style.fontWeight ="bold";
productbottomc.style.textAlign ="center";
}
if (productbottomd) {
productbottomd.style.fontSize = $footer_font_size ;
productbottomd.style.color =$footer_text_color ;
productbottomd.style.fontWeight ="bold";
productbottomd.style.textAlign ="center";
}
if (productbottome) {
productbottome.style.fontSize = $footer_font_size ;
productbottome.style.color =$footer_text_color ;
productbottome.style.fontWeight ="bold";
productbottome.style.textAlign ="center";
}
if (productbottomf) {
productbottomf.style.fontSize = $footer_font_size ;
productbottomf.style.color =$footer_text_color ;
productbottomf.style.fontWeight ="bold";
productbottomf.style.textAlign ="center";
}
if (productbottomg) {
productbottomg.style.fontSize = $footer_font_size ;
productbottomg.style.color =$footer_text_color ;
productbottomg.style.fontWeight ="bold";
productbottomg.style.textAlign ="center";
}
if (productbottomh) {
productbottomh.style.fontSize = $footer_font_size ;
productbottomh.style.color =$footer_text_color ;
productbottomh.style.fontWeight ="bold";
productbottomh.style.textAlign ="center";
}
if (productbottomi) {
productbottomi.style.fontSize = $footer_font_size ;
productbottomi.style.color =$footer_text_color ;
productbottomi.style.fontWeight ="bold";
productbottomi.style.textAlign ="center";
}
if (productbottomj) {
productbottomj.style.fontSize = $footer_font_size ;
productbottomj.style.color =$footer_text_color ;
productbottomj.style.fontWeight ="bold";
productbottomj.style.textAlign ="center";
}
if (productbottomk) {
productbottomk.style.fontSize = $footer_font_size ;
productbottomk.style.color =$footer_text_color ;
productbottomk.style.fontWeight ="bold";
productbottomk.style.textAlign ="center";
}
if (productbottoml) {
productbottoml.style.fontSize = $footer_font_size ;
productbottoml.style.color =$footer_text_color ;
productbottoml.style.fontWeight ="bold";
productbottoml.style.textAlign ="center";
}
}
} // END if($productcount)
} // END OF for statement
}