jQuery.rubicon = {};

jQuery(function(){ jQuery.panther.debug=true; });

// CONTACT
jQuery.rubicon.prepContact = function() {
	jQuery(function() {
		var settings={
			jcallOpts:jQuery(jQuery.panther.apLoader('.x_submit',{offset:{offsetX:10,offsetY:8}})).cloneObj({scall:false}),
			errLoc:'before',
			autoLabels:false,
			callbacks : "contactForm"
		}
		jQuery("#contact").formulate(settings);
		jQuery("#contact").find('[name^="phone"]')
			.keyup(function(event){getFormat(this,event,'ph')})
			.bind('blur change',function(){FormatPhone(this);});
	});
};

// PUBLISHER
jQuery.rubicon.pubGetStarted = function() {
	jQuery(function() {
		var settings={
			jcallOpts:jQuery(jQuery.panther.apLoader('.x_submit',{offset:{offsetX:10,offsetY:8}})).cloneObj({scall:false}),
			errLoc:'before',
			autoLabels:false,
			callbacks : "pubGetStarted"
		}
		jQuery("#contact").formulate(settings);
		jQuery("#contact").find('[name^="phone"]')
			.keyup(function(event){getFormat(this,event,'ph')})
			.bind('blur change',function(){FormatPhone(this);});
	});
};

// NETWORKS 
jQuery.rubicon.netGetStarted = function() {
	jQuery(function() {
		var settings={
			jcallOpts:jQuery(jQuery.panther.apLoader('.x_submit',{offset:{offsetX:10,offsetY:8}})).cloneObj({scall:false}),
			errLoc:'before',
			autoLabels:false,
			callbacks : "netGetStarted"
		}
		jQuery("#contact").formulate(settings);
	});
};

// MARKET-REPORT 
jQuery.rubicon.marketReport = function() {
	jQuery(function() {
		var settings={
			jcallOpts:jQuery(jQuery.panther.apLoader('.x_submit',{offset:{offsetX:10,offsetY:8}})).cloneObj({scall:false}),
			errLoc:'before',
			autoLabels:false,
			callbacks : "marketReport"
		}
		jQuery("#contact").formulate(settings);
		jQuery("#contact").find('[name^="phone"]')
			.keyup(function(event){getFormat(this,event,'ph')})
			.bind('blur change',function(){FormatPhone(this);});
	});
};

// ADVERTISERS 
jQuery.rubicon.adDemandMore = function() {
	jQuery(function() {
		var settings={
			jcallOpts:jQuery(jQuery.panther.apLoader('.x_submit',{offset:{offsetX:10,offsetY:8}})).cloneObj({scall:false}),
			errLoc:'before',
			autoLabels:false,
			callbacks : "adDemandMore"
		}
		jQuery("#contact").formulate(settings);
	});
};

// ARROW PAGES
jQuery.rubicon.setupArrows = function() {
	var link_l = jQuery('a.link_l');
	if (link_l.attr('href')) {
		link_l.hide();
		jQuery('.c_arrows').append('<a href="'+link_l.attr('href')+'" class="arrow_b_l">Previous</a><div class="arrow_txt_l">'+link_l.text()+'</div>');
		jQuery('.arrow_b_l').hover(function(){
			jQuery('.arrow_txt_l').show('fast');
		}, function() {
			jQuery('.arrow_txt_l').hide('fast');
		});
	}
	
	var link_r = jQuery('a.link_r');
	if (link_r.attr('href')) {
		link_r.hide();
		jQuery('.c_arrows').append('<a href="'+link_r.attr('href')+'" class="arrow_b_r">Previous</a><div class="arrow_txt_r">'+link_r.text()+'</div>');
		jQuery('.arrow_b_r').hover(function(){
			jQuery('.arrow_txt_r').show('fast');
		}, function() {
			jQuery('.arrow_txt_r').hide('fast');
		});
	}
};

// SHARE
jQuery(function(){
  $(".sharePage .print").click( function(){ window.print();return false;} );
  $(".sharePage .sharethis").click(function(){return false;});
});