/**
 *	pagebuilder.common.js
 *	Requires jQuery
 *
 *	PageBuilder Plus System Scripts
 *	Copyright (c) 2011 Virtual Design House (marketingease.com, pagebuilderplus.com)
 **/
$(document).ready(function(){
	
	/*
	Show link to mobile site if mobile is enabled and they are on their full site
	Either add the class "link_mobile_site" to the div you want to append it to
	or
	place the following code where you want it:
		- for plain white backgrounds (default) 	<span class="link_mobile_site"></span>
		- for color backgrounds 					<span class="link_mobile_site color"></span>
	*/
	if (document.cookie.match(/(^|;)\s*is_mobile=1/)) {
		$('.link_mobile_site').append('<a href="?mobile" class="mobile_site">Mobile Site</a>');
	}
	
	// pagebuilder footer maintained
	// <span id="pagebuilder_footer_maintained"></span>
	$('#pagebuilder_footer_maintained').append('Powered by <a href="http://www.pagebuilderplus.com" target="_blank">PageBuilderPlus.com</a> | Site maintained by <a href="http://www.marketingease.com" target="_blank">MarketingEase.com</a>');
	
	// pagebuilder footer designed
	// <span id="pagebuilder_footer_design"></span>
	$('#pagebuilder_footer_design').append('Powered by <a href="http://www.pagebuilderplus.com" target="_blank">PageBuilderPlus.com</a> | Site design by <a href="http://www.marketingease.com" target="_blank">MarketingEase.com</a>');
	
	// search input
	// must have id "search_input" on the search input
	 $('#search_input').val('Enter Search...').focus(function(){
		 if ($(this).val() == 'Enter Search...') {
			 $(this).val('');
		 }
	 }).blur(function(){
		 if ($(this).val() == '') {
			 $(this).val('Enter Search...');
		 }
	 });
	
});
