// JavaScript Document

jQuery(document).ready(function() {
								
	var host_url = self.location.protocol+'//'+self.location.host;
							
	//jQuery('.popup-cont a').lightBox();
	jQuery( "table.mod-comment-body a:not(.mod-item-body-a, .mod-category-body-a, .page_navigator)" ).each(
	function(){
		var img_link = jQuery(this).attr('href');
		img_link= img_link.replace(/\&amp;/g,'&');
		jQuery(this).attr('rel', 'prettyPhoto[img]');
		jQuery(this).attr('href', host_url+'/view_img.php?url='+img_link);
	});
	
	jQuery( "a.mod-item-body-a" ).each(
	function(){
		var img_link = jQuery(this).attr('href');
		img_link= img_link.replace(/\&amp;/g,'&');
		jQuery(this).attr('rel', 'prettyPhoto[img2]');
		jQuery(this).attr('href', host_url+'/view_img.php?url='+img_link);
	});
	
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
					opacity: 0.55, /* Value betwee 0 and 1 */
					allowresize: false,
					theme: 'light_rounded'
			});
	
	var query = self.location.href;
  	if( query.indexOf('car-sale.php') == -1 ){ }else{ jQuery("#side-menu").html('&nbsp;'); }
	
	if( query.indexOf('car-sale.php') == -1 ){ }else{ jQuery("#side-menu").html('&nbsp;'); }
	
	var hmenu1 = jQuery(".top-menu a:contains('Photo Gallery'), .bottom-menu a:contains('Photo Gallery')").parent("td");
	hmenu1.html('&nbsp');
	hmenu1.prev().html('&nbsp');
	
	jQuery('#header-img-holder').cycle({ 
    	fx:    'fade', 
    	pause:  3 
	});
	
	//jQuery('.popupimage a').lightBox();
	
	if (jQuery("#main-title:contains('Home')").size() > 0) { jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	var bb = jQuery("#main-title:contains('Home')").text().length;
	if ( bb == 4) { jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>');; }
	if (jQuery("#main-title:contains('Contact Us')").size() > 0) { jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	
	if( query.indexOf('self-catering-carrick.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); } 
	if( query.indexOf('about-carrick-on-shannon.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	if( query.indexOf('about-carrick-on-shannon.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	if( query.indexOf('guest-comments.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); } 
	if( query.indexOf('hackney-service.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); } 
	if( query.indexOf('how-to-find-us.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	if( query.indexOf('book-now.php') == -1){ }else{ jQuery('#main-subm-holder').html('<ul id="submenu-ul"></ul>'); }
	
	if ( bb == 4) { jQuery("#main-title").html('Anglers Rest Holiday Homes');}
	jQuery("#main-title:contains('Things To Do')").html('Things to Do in Leitrim');
	
	jQuery('#side-menu-holder').scrollFollow();

} );
