window.addEvent('domready',function() {
	
	
		//tools menu rollovers
		$(document.body).getElements('a.toolsLink').addEvent('mouseenter', function() {this.addClass('over'); });
		$(document.body).getElements('a.toolsLink').addEvent('mouseleave', function() {this.removeClass('over'); });
		
		//hours of operation info
		var showlink = $(document.body).getElements('a.showLink');
		var servlink = $(document.body).getElements('a.servLink');
		var partslink = $(document.body).getElements('a.partsLink');
		var showdiv = $(document.body).getElements('div#showroom');
		var servdiv = $(document.body).getElements('div#service');
		var partsdiv = $(document.body).getElements('div#parts');
		
		showlink.addEvent('click', function() {
			$$('a').removeClass('selected');
			showlink.addClass('selected');  					
			servdiv.setStyle('display','none');
			showdiv.setStyle('display','block');
			partsdiv.setStyle('display','none');
		});	
		
		servlink.addEvent('click', function() {
			$$('a').removeClass('selected');
			servlink.addClass('selected'); 
			servdiv.setStyle('display','block');
			showdiv.setStyle('display','none');
			partsdiv.setStyle('display','none');
		});		
		
		partslink.addEvent('click', function() {
			$$('a').removeClass('selected');
			partslink.addClass('selected');
			servdiv.setStyle('display','none');
			showdiv.setStyle('display','none');
			partsdiv.setStyle('display','block');
		});

				
}); // domready


//Sharing

		//Global Variables, URL, Dealer Name, and Share Thumb
		var url = "http://bigcityharleydavidson.com";// URL to dealer site
		var t =  'Big City Harley-Davidson&reg;';//Enter the Name of Dealer Here 
		var p = 'http://www.dealerwebsite.com/img/shareThumb.jpg';//needs to be a full absolute path to a thumbnail image hosted by the dealer.  Recommended size is 150px X 150px.
		var alt = 'psn template thumb';//alt text for the share thumbnail. please enter this for accessiblity purposes.
		
		//For each individual function variable you need to edit see the comments below
		
		//main share function popup
		function shareLink(pageUrl, windowName, winProperties) {
			
			var winNew = window.open(pageUrl, windowName, winProperties);
			
			if (! winNew) {
				getSwf(swfId).openWindowFromSwf(pageUrl);
			} else {
				winNew.focus();
			}
		}		


		//Share Facebook
		function shareFacebook() {
		var u = url;
		var finalURL = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t);
		var properties = 'toolbar=0,status=0,width=626,height=436';
		shareLink(finalURL, 'Facebook', properties);		
		}
		
		//Share MySpace
		function shareMyspace() {
		var bor = '0';
		var ref = url;
		var tar = '_blank';
		var s = '8';		
		var a = 'left';		
		var i = '<a href=' + ref + '  target=' + tar + '><img src=' + p + ' align=' + a + ' alt=' + alt + ' hspace=' + s + ' border=' + bor + '/></a>';		
		var c = i + "MySpace Share copy paragraph goes here.<br><a href=' + ref + '  target=' + tar + '>Check Us Out!</a>";//Copy paragraph goes here.  Do not enter copy past the <br> tag.
		var u = '';
		var finalURL = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(t) + '&c=' + encodeURIComponent(c) + '&u=' + encodeURIComponent(u);
		var properties = 'width=1024,height=768,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no';
		shareLink(finalURL, 'MySpace', properties);
		}	
		
		
		
		//Share Twitter
		function shareTwitter() {
		var ref = 'http://www.harley-davidson.com/en_US/Content/Pages/2010c/ss/start-something.html';  
		var tar = '_blank';
		var finalURL = 'http://twitter.com/home?status=Twitter tweet copy goes here. Please adhere to the 140 character limit and escape all apostrophes like this: \' or it will terminate early.';//enter tweet copy here. escape the apostrophes!
		var properties = 'width=1024,height=768,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no';
		shareLink(finalURL, 'Twitter', properties);
		}



	  //Share blog
	   function psnBlogShare() {
		  var bor ='0';
		  var ref = url;
		  var tar ='_blank';
		  var s = '8';
		  var a = 'left';	 
		  var description = 'This is where a dealer will write the descriptive copy for the Blogger post';//Edit Blog description here
	  
		  var i = '<div>';	
		  i += '  <div class="head">POST TO YOUR BLOG</div>';
		  i += '<div>Copy and paste the embed code below and post it to your blog:</div>';
		  i += '<h2 style="color:#ff6600;">Embed Code</h2>';
		  i += '<textarea name="copyText" id="copyText" rows="5" cols="70">';
		  i += '<a href="'+ref+'"  target="'+tar+'"><img src="'+p+'" align="'+a+'" alt="'+alt+'" hspace="'+s+'" border="'+bor+'"/></a>';
		  i += description + '<br/>Check it out at <a href="' + ref + '" target="' + tar + '">' + ref + '</a>';
		  i += '</textarea>';
		  i += '</div>';		
	  
		  var content = ( i );	
		  
	//writes and opens popup for embed code copy.	  
	   top.consoleRef=window.open('','myconsole',
		'width=650,height=250'
		 +',menubar=0'
		 +',toolbar=1'
		 +',status=0'
		 +',scrollbars=1'
		 +',resizable=1')
	   top.consoleRef.document.writeln(
		'<html><head><title>'+t+'</title></head>'
		 +'<body style="background:#212121;font-family:arial;color:#FFF;" onLoad="self.focus()">'
		 +content
		 +'</body></html>'
	   )
	   top.consoleRef.document.close()
	  
	  }

