$(document).ready(function(){
	$.fn.qtip.styles.mystyle = { // Last part is the name of the style
	   background: '#111',
	   color: '#FFF',
	   textAlign: 'center',
	   tip: 'bottomMiddle',
	   border: {
		  width: 1,
		  radius: 5,
		  color: '#444'
	   },
	   name: 'cream' // Inherit the rest of the attributes from the preset dark style
	}

	$('#social-media li').each(function()
   	{
		  // Grab video ID from the url
		  var text = $(this).attr('id');
		  $(this).qtip({
		   content: "Find Us on " + text,
		   show: 'mouseover',
		   hide: 'mouseout',
		   position: {
			corner: {
				target: 'bottomLeft',
				tooltip: 'topRight'
			}
		   },
		   effect: {
				type:'slide',
				length:1000
		   },
		   style: {
			   tip: 'rightTop',
			   name:'mystyle'
		   }
		});
   	});

	$('#bi-1').qtip({
	   content: 'We evaluate the interior and exterior condition,check the mileage of your vehicle. We drive your vehicle to make sure all major components are in good working order.',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	   	corner: {
	   		target: 'topMiddle',
			tooltip: 'bottomMiddle'
	   	}
	   },
	   effect: {
	   		type:'slide',
			length:1000
	   },
	   style: 'mystyle'
	});
	
	$('#bi-2').qtip({
	   content: 'You will get an honest and fair offer. We will always present you with our best possible offer to minimize uncomfortable negotiating. ',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	   	corner: {
	   		target: 'topMiddle',
			tooltip: 'bottomMiddle'
	   	}
	   },
	   effect: {
	   		type:'slide',
			length:1000
	   },
	   style: 'mystyle'
	});
	
	$('#bi-3').qtip({
	   content: 'You will get instant cash wether your car is financed or leased.',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	   	corner: {
	   		target: 'topMiddle',
			tooltip: 'bottomMiddle'
	   	}
	   },
	   effect: {
	   		type:'slide',
			length:1000
	   },
	   style: 'mystyle'
	});
	
	var videoID = "Xh-p-abWd4Y";
	$('#bi-4').qtip(
      {
         // Create content DIV with unique ID for swfObject replacement
         content: '<object id="VideoPlayer" width="430" height="240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" type="application/x-shockwave-flash" data="http://www.yellowbook.com/flash/yb_player2.swf"><param name="movie" value="http://www.yellowbook.com/flash/yb_player2.swf" /><param name="base" value="." /><param name="quality" value="high" /><param name="play" value="true" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="allowScriptAccess" value="samedomain" /><param name="scale" value="noscale" /><param name="bgcolor" value="#000000" /><param name="wmode" value="window" /><param name="flashvars" value="ybVideo=http%3a%2f%2fwww.yellowbook.com%2fvideo%2fcity-motor-group-inc-retail-division_1843947932.flv&amp;autoStart=false" /><embed name="VideoPlayer" width="430" height="240" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="http://www.yellowbook.com/flash/yb_player2.swf" base="." quality="high" play="true" loop="true" menu="false" allowscriptaccess="samedomain" scale="noscale" salign="tl" wmode="window" bgcolor="#000000" flashvars="ybVideo=http%3a%2f%2fwww.yellowbook.com%2fvideo%2fcity-motor-group-inc-retail-division_1843947932.flv&amp;autoStart=false"></embed></object>',
         position: {
            corner: {
               tooltip: 'bottomMiddle', // ...and position it center of the screen
               target: 'topMiddle' // ...and position it center of the screen
            }
         },
         show: {
            when: 'click', // Show it on click...
            solo: true // ...and hide all others when its shown
         },
         hide: 'unfocus', // Hide it when inactive...
         style: {
            width: 430,
            height: 240,
            padding: 0,
            tip: true,
            name: 'mystyle'
         },
         /*api: {
            onRender: function()
            {
               // Setup video paramters
               var params = { allowScriptAccess: 'always', allowfullScreen: 'false' };
               var attrs = { id: 'youtube-video-'+videoID };

               // Embed the youtube video using SWFObject script
               swfobject.embedSWF('http://www.youtube.com/v/'+videoID+'&enablejsapi=1&playerapiid=youtube-api-'+videoID,
                                 'youtube-embed-'+videoID, '425', '264', '8', null, null, params, attrs);
            },

            onHide: function(){
               // Pause the vide when hidden
               var playerAPI = this.elements.content.find('#youtube-video-'+videoID).get(0);
               if(playerAPI && playerAPI.pauseVideo) playerAPI.pauseVideo();
            }
         }*/
      }
      ).attr('href', '#');
	
	$('#map').qtip({
	   content: '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=186+Monsignor+Obrien+Highway,+Cambridge,+MA&amp;sll=42.347147,-71.103475&amp;sspn=0.011878,0.027874&amp;ie=UTF8&amp;hq=&amp;hnear=186+Monsignor+Obrien+Hwy,+Cambridge,+Middlesex,+Massachusetts+02141&amp;ll=42.377695,-71.076393&amp;spn=0.022192,0.036478&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=186+Monsignor+Obrien+Highway,+Cambridge,+MA&amp;sll=42.347147,-71.103475&amp;sspn=0.011878,0.027874&amp;ie=UTF8&amp;hq=&amp;hnear=186+Monsignor+Obrien+Hwy,+Cambridge,+Middlesex,+Massachusetts+02141&amp;ll=42.377695,-71.076393&amp;spn=0.022192,0.036478&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>',
		   show: {
		   when: 'click'
	   },
	   hide: 'unfocus',
	   position: {
	   	corner: {
	   		target: 'topMiddle',
			tooltip: 'bottomMiddle'
	   	}
	   },
	   effect: {
	   		type:'slide',
			length:1000
	   },
	   style:{
            width: 425,
            height: 350,
            padding: 0,
            tip: true,
            name: 'mystyle'
         }
	});

});