var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17) isCtrl=false;
if(e.which == 18) isAlt=false;
}
document.onkeydown=function(e)
{
if(e.which == 17) isCtrl=true;
if(e.which == 18) isAlt=true;
if(e.which == 69 && isCtrl == true && isAlt == true)
{
// if bar already exists, close it
if($ezJQuery('#ezoic-bar-overlay').length)
{
$ezJQuery('#ezoic-bar-overlay').slideDown('slow').remove();
}
else
{
init_ez_bar();
}
}
}
function ez_force_recache()
{
var url = document.URL;
//create a form object
var form = document.createElement("form");
form.setAttribute("id", "force_recache");
form.setAttribute("method", "POST");
form.setAttribute("action", url);
//create hidden field
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "ez_force_recache");
hiddenField.setAttribute("value", "force_recache");
form.appendChild(hiddenField);
//inject form and submit it
document.body.appendChild(form);
form.submit();
}
function init_ez_bar() {
// If overlay already exists, remove it
var ezOverlay = $ezJQuery('#ezoic-overlay');
if ($ezJQuery(ezOverlay.length)) {
$ezJQuery(ezOverlay).remove();
}
// Add Open Sans web font to document head
$ezJQuery('head').append(" ");
// Create the overlay element
var overlay = $ezJQuery('
');
// Append it to the body
$ezJQuery(overlay).appendTo('body');
// Style for ezoic overlay
overlay.css({
'fontFamily': 'Open Sans',
'position': 'fixed',
'bottom': '0px',
'left': '0px',
'height': '50px',
'width': '100%',
'z-index': '1000000',
'backgroundColor': 'rgba(255, 255, 255, 0.9)',
'border-top': '1px solid #eeeeee',
'box-shadow': '0px 2px 2px -2px rgba(0, 0, 0, 0.25)',
'text-shadow': '0 -1px 0 rgba(0, 0, 0, 0.25)'
});
$ezJQuery('#ezoic-bar-overlay a').css({
'color': '#444444',
'fontFamily': 'Open Sans',
'text-shadow': '0 -1px 0 rgba(0, 0, 0, 0.25)'
});
$ezJQuery('#ezoic-bar-container').css({
'max-width': 'none',
'width': '100%'
});
$ezJQuery('ul#ezoic-bar-actions').css({
'float': 'left',
'height': '50px',
'line-height': '50px',
'list-style': 'none',
'margin': '0px',
'max-width': 'none',
'padding': '0px'
});
$ezJQuery('#ezoic-bar-actions li').css({
'display': 'inline',
'font-size': '14px',
'padding-left': '0px'
});
$ezJQuery('#ezoic-bar-actions li a').css({
'color': '#444444',
'font-size': '14px',
'height': '50px',
'line-height': '50px',
'padding-left': '15px',
'padding-right': '15px',
'text-align': 'center',
'text-decoration': 'none'
})
.hover(
function() {
$ezJQuery(this).css('color', '#888888');
},
function() {
$ezJQuery(this).css('color', '#444444');
}
);
$ezJQuery('#ezoic-bar-logo').css({
'color': '#444444',
'float': 'left',
'font-weight': '700',
'padding-left': '20px',
'padding-right': '20px',
'padding-top': '12px'
});
$ezJQuery('#ezoic-bar-logo img').css({
'max-height': '26px'
});
// Close ezoic window on click
$ezJQuery('#ezoic-bar-close')
.on('click', function (e) {
e.preventDefault();
$ezJQuery('#ezoic-bar-overlay').remove();
})
.css({
'float': 'right',
'line-height': '50px',
'padding': '0 20px',
'color': '#444444'
});
// trigger recache
$ezJQuery('.js-ez-force-recache')
.on('click', function (e) {
e.preventDefault();
var self = $ezJQuery(this);
var text = self.text();
self.text('Clearing cache...');
ez_force_recache();
});
// trigger hide template
$ezJQuery('.js-ez-hide-template')
.on('click', function (e) {
e.preventDefault();
var self = $ezJQuery(this);
var text = self.text();
self.text('Saving preference...');
$ezJQuery.ajax({
url: '/ezoic_ajax/hide_template.php',
data: { ezdomain: ezdomain },
success: function(data) {
self.text(text);
ez_force_recache();
}
});
});
}
if(typeof execute_ez_queue == "function")
{
if(typeof $ezJQuery != 'undefined')
{
$ezJQuery(window).load(function(){execute_ez_queue()});
}
else
{
window.onload=execute_ez_queue;
}
}
if(typeof $ezJQuery != 'undefined')
{
var is_ez_awesome = false;
var ez_awesome_params = new Array();
var inf_load;
var old_inf_count=0;
var ez_inf_timer=0;
var ez_awesome_done=false;
$ezJQuery("div[data-role='page']").show();
$ezJQuery(document).bind("mobileinit",function(){set_mobile_vars();});
function load_il_track()
{
ez_inf_timer++;
var new_inf_count = $ezJQuery( "span[ class *= IL_AD ],.IL_BASE" ).length;
//console.log(new_inf_count+' -- '+old_inf_count);
if(new_inf_count > 5 && old_inf_count < 6)
{
//console.log("spans found: "+$ezJQuery( "span[ id *= IL_AD ]").length);
$ezJQuery( "span[ id *= IL_AD ]").mouseover(function()
{
//console.log("over span");
clearInterval(inf_load);
ez_inf_timer = 0;
inf_load = setInterval(load_il_track,500);
});
clearInterval(inf_load);
}
if(old_inf_count < 1)
{
old_inf_count = new_inf_count;
}
if(new_inf_count > (old_inf_count + 10) || ez_inf_timer > 20)
{
old_inf_count = new_inf_count;
//console.log("clear top");
clearInterval(inf_load);
}
//console.log("il_track");
$ezJQuery( "span[ class *= IL_AD ],.IL_BASE" )
.click(function(){set_ez_awesome_params('over',4, this);ez_awesome_click()});
}
function ez_awesome_click(type, sourceid)
{
//console.log("click before");
document.cookie = "ezoawesome="+ez_awesome_params[2]+"; path=/;";
if (is_ez_awesome && ez_awesome_done != true)
{
is_ez_awesome = false;
ez_awesome_done = true;
//console.log("click ajax");
//alert("click ajax");
$ezJQuery.ajax({
type: "post",
url: "/utilcave_com/awesome.php",
data: {
url: window.location.href,
width: ez_awesome_params[0],
height: ez_awesome_params[1],
did: did,
sourceid: ez_awesome_params[2],
uid: ezouid,
template: ezoTemplate
}
})
}
}
function set_ez_awesome_params(type, sourceid, item)
{
if(type == "over")
{
//console.log("mouseover : "+sourceid);
if(item.width != undefined)
{
ez_awesome_params[0] = item.width;
ez_awesome_params[1] = item.height;
}
ez_awesome_params[2] = sourceid;
is_ez_awesome = true;
}
else
{
//console.log("mouseout : "+sourceid);
ez_awesome_params = new Array();
is_ez_awesome = false;
}
}
$ezJQuery(window).load(function()
{
$ezJQuery( "iframe[ id *= ox_frame_ ]" )
.mouseover(function(){set_ez_awesome_params('over',33,this);})
.mouseout(function(){set_ez_awesome_params('out',33,this);});
$ezJQuery( "iframe[ id *= google ],iframe[ id *= aswift ],ins[id *= aswift]" )
.mouseover(function(){set_ez_awesome_params('over',5,this);})
.mouseout(function(){set_ez_awesome_params('out',5,this);});
$ezJQuery( "iframe[ id *= google ],iframe[ id *= aswift ]" ).contents().find("script[ src *= 'casalemedia.com']").parent().mouseover(function(){set_ez_awesome_params('over',9,this);})
.mouseout(function(){set_ez_awesome_params('out',9,this);});
$ezJQuery( "iframe[ id *= google ],iframe[ id *= aswift ]" ).contents().find("script[ src *= 'fastclick']").parent().mouseover(function(){set_ez_awesome_params('over',9,this);})
.mouseout(function(){set_ez_awesome_params('out',9,this);});
$ezJQuery( "iframe[ id *= google ],iframe[ id *= aswift ]" ).contents().find("script[ src *= 'ad.afy']").parent().mouseover(function(){set_ez_awesome_params('over',6,this);})
.mouseout(function(){set_ez_awesome_params('out',6,this);});
inf_load = setInterval(load_il_track,500);
$ezJQuery( window ).blur(function(){ez_awesome_click();}).focus();
});
var ezo_resize_interval;
var ezo_resize_interval_count =0;
var ezo_resize_interval_count_limit=10;
$ezJQuery(function(){
ezo_resize_start_timer();
});
function ezo_resize_start_timer()
{
ezo_resize_interval = setInterval(ezo_resize_checker,200);
}
//checks to see if we need to resize it.
function ezo_resize_checker(e)
{
ezo_resize_interval_count++;
for (index = 0; index < ezo_elements_to_check.length; ++index)
{
var $elm = $ezJQuery(ezo_elements_to_check[index]);
if(parseInt($elm.width()) > parseInt($elm.parent().width()))
{
ezo_resize(ezo_elements_to_check[index],$elm.parent().width()/$elm.width());
}
}
if(ezo_resize_interval_count > ezo_resize_interval_count_limit)
{
clearInterval(ezo_resize_interval);
}
}
//actually resizes the element and children
function ezo_resize($elm, percent)
{
if (typeof console == "object")
{
//console.log('resize by '+percent);
//console.log($elm);
}
var new_width = parseInt($ezJQuery($elm).css('width'))*percent;
$ezJQuery($elm).css('width',new_width+'px');
$ezJQuery($elm).children().each(function(i,j)
{
ezo_resize($ezJQuery(this),percent);
});
}
}