jQuery.noConflict();jQuery(document).ready(function($){

	//Remove border
	$('#superheader ul li:first a').css('border-left',"0");

	//Remove border on last li
	$('#headernav ul li:last').css('border-right',"0");
	
	//Add image to every page that doesn't already have one, unless it's the contact us page
	if ($('form.cform').length < 1 ) { //No contact form?  Proceed...
	
		if ($('div.entry-content img').length < 1 ) {
			var randomnumber=Math.floor(Math.random()*1000); //Generate random number to prevent caching.
			var pcount = $('.entry-content p').length; //Returns the number of paragraphs
			
			if (pcount < 1) { var selector = $('div.entry-content h2').next(); //If no paragraphs, prepend to the entry-content div
			}else{ var selector = $('div.entry-content p:first');
			}
			
			selector.prepend('<img src="http://bizzpay.com/images/rotator.php?f=' + randomnumber + '" class="alignright" id="content-image" />');
		}
	}
	
	// Show confirmation on contact page when necessary
	// Read a page's GET URL variables and return them as an associative array.
	function getUrlVars()
	{
	    var vars = [], hash;
	    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	    for(var i = 0; i < hashes.length; i++)
	    {
		   hash = hashes[i].split('=');
		   vars.push(hash[0]);
		   vars[hash[0]] = hash[1];
	    }
	    return vars;
	}
	
	var cfconfirm = getUrlVars() ["cfconfirm"];
	if (cfconfirm == 1) {
		$('div#contact-us').html("<h2>Message Confirmation</h2><p>Thank you for your message.  We will reply as quickly as possible.</p><p>Sincerly,<br />The BizzPay Team</p>");
	}
	
window.onload = function(){

	//Increase height of .entry-content if too small for both images
	if($('div.entry-content').height() < ($('div.entry-content img').height() + 230) ){
		$('div.entry-content').height($('div.entry-content img').height() + 230);
	}

};


/*

	//Add image to every page
	var randomnumber=Math.floor(Math.random()*1000); //Generate random number to prevent caching.
	var pcount = $('.entry-content p').length; //Returns the number of paragraphs
	var randp = Math.floor(Math.random()*pcount );
	
	if (pcount < 1) { var selector = $('div.entry-content h2').next(); //If no paragraphs, prepend to the entry-content div
	}else{ var selector = $('div.entry-content p').eq(randp);
	}
	
	selector.prepend('<img src="http://bizzpay.com/images/rotator.php?f=' + randomnumber + '" class="alignright" />');
*/
}); // end doc ready
