var $j = jQuery.noConflict();
$j(document).ready(function(){ 

	var span = $j('.menu_active').width();	
	var line = 164 - (span + 5)  
	$j('.menu_active').after('<span class="navline" style="width:' + line + 'px;"></span>');
	
  var span = $j('.menu_active2').width();
  var line = 143 - span;
  $j('.menu_active2').after('<span class="subnavline" style="width:' + line + 'px;"></span>');
 	
	CityHover(); 			
		
});

function CityHover(){		
	if($j('.cityActive').length < 1 ) {					
		$j('.city').hover(
				function () {
			      $j(this).attr({
						alt: 'Vaughan',
						src: '/assets/templates/rr/images/TORONTO-over.png',
						width: 75, 
						height: 13
					});
			  }, 
				function () {
			      $j(this).attr({
						alt: 'Vaughan',
						src: '/assets/templates/rr/images/TORONTO-default.png',
						width: 75,
						height: 13
					});
			  }
			)
	}
	
	$j('.city').click(
	   	function () {
			      $j('.city').attr({
						alt: 'Vaughan',
						src: '/assets/templates/rr/images/TORONTO-active.png',
						width: 75, 
						height: 13
					});
			  }
	)
	
	if ($j('.cityActive').length > 0) {		
			$j('.cityActive img').attr({
			alt: 'City',
			src: '/assets/templates/rr/images/TORONTO-active.png',
			width: 75,
			height: 13
		});
	}
}
/*
var $j = jQuery.noConflict();
$j(document).ready(function(){ 
    function getPageContent(pageID) {
         if (pageID == '') {
            alert('no page');//pageID = [+lastItem+];
         }
         $j('.subnavline').remove();
         // Clear previous image
         $j('.head3 img').remove();
         // Add Image
         $j('.head3 img').attr({
              src: '[!GetField? &docid=`pageID ` &field=`article_img`!]',
              alt: ''
          });
	  $j('.head3').css({
                marginTop: 0 
           });
          
          // Replace page description
          $j('#serviceDescription').html('[!GetField? &docid=`pageID` &field=`image_desc`!]');
          $j('.head2').html('[!GetField? &docid=`pageID` &field=`pagetitle`!]');
          $j('.content').html('[!GetField? &docid=`pageID` &field=`article_text`!]');
    }
});
*/
