function getParameter(name, defaultValue) {
    if (defaultValue == null) {
        defaultValue = "";
    }

    var url = document.location.href;
    var i = url.indexOf(name + "=");
    if (i != -1) {
        var valuestart = i+name.length+1;
        var valueend = url.length;

        i = url.indexOf("&", valuestart)
        if (i != -1) {
            valueend = i;
        }

        return unescape(url.substring(valuestart, valueend));
    }
    return defaultValue;
}

if (getParameter('testads') != '')
{
  yld_mgr.site_name="test.ajc";
}

jQuery(document).ready(function() {
	
	// Lightbox
	// $('a img[@src$=jpg], a img[@src$=jpeg], a img[@src$=gif], a img[@src$=png]').parent().lightBox({start:true,events:false});

	// Enable print link
	jQuery('li.print a').bind('click',function() {
		window.print();
		return false;
	});

	swapValues = [];
		jQuery(".swap_value").each(function(i){
		    swapValues[i] = jQuery(this).val();
		    jQuery(this).focus(function(){
		        if (jQuery(this).val() == swapValues[i]) {
		            jQuery(this).val("");
		        }
		    }).blur(function(){
		        if (jQuery.trim(jQuery(this).val()) == "") {
		            $(this).val(swapValues[i]);
		        }
		    });
		});
});

// Ad positions

yld_mgr.site_section_name_list=['blogs']; // Hard-code the section name for all blogs
yld_mgr.slots = {};

yld_mgr.slots.top_slot = {};
yld_mgr.slots.top_slot.ad_size_list=["728x90"]; 
yld_mgr.slots.top_slot.ad_delivery_mode="ipatf";
yld_mgr.slots.top_slot.ad_format_list=["standard graphical","rich media"];
yld_mgr.slots.top_slot.cstm_content_cat_list = yld_mgr.cstm_content_cat_list;

yld_mgr.slots.right_slot = {};
yld_mgr.slots.right_slot.ad_size_list=["300x250"]; 
yld_mgr.slots.right_slot.ad_delivery_mode="ipatf";
yld_mgr.slots.right_slot.ad_format_list=["standard graphical","rich media"];
yld_mgr.slots.right_slot.cstm_content_cat_list = yld_mgr.cstm_content_cat_list;

yld_mgr.slots.right_slot_bottom = {};
yld_mgr.slots.right_slot_bottom.ad_size_list=["160x600"]; 
yld_mgr.slots.right_slot_bottom.ad_delivery_mode="ipbtf";
yld_mgr.slots.right_slot_bottom.ad_format_list=["standard graphical","rich media"];
yld_mgr.slots.right_slot_bottom.cstm_content_cat_list = yld_mgr.cstm_content_cat_list;

// End ad positions

// Handle ZAG info: assuming zag_cookie_parse.js has already run
if (window.zag) {
   if (window.zag.zipcode) yld_mgr.user_zip = window.zag.zipcode;
   if (window.zag.age) yld_mgr.user_age = window.zag.age;
   if (window.zag.gender) yld_mgr.user_gender = window.zag.gender;
}