function slider(){
		
	
 
	var winwidth = jQuery(window).width();
	
	 
	if ( winwidth <= 1024 ) {
	var imgsize = "sm";
	} else if (winwidth <= 1280 ) {
	var imgsize = "md";
	}  else if (winwidth <= 1360 ) {
	var imgsize = "lg";
	} else if  (winwidth <= 1440 ) {
	var imgsize = "xl";
	} else {
	var imgsize = "xxl";
	}
	
//	 var textToInsert  = '<img src="/assets/templates/e3escapes/images/slide3-' + imgsize + '.jpg" id="bg3" class="slide" alt="An Incomparable Place to Call Home"';
	
	var container = $('hdrWrapper');
 
	var first = document.createElement("img");
	first.src = '/assets/templates/e3escapes/images/slide0-' + imgsize + '.jpg';
	first.id = 'bg1';
	first.alt = 'An Incomparable Place to Call Home';
	first.className = 'slide';
	
	var second = document.createElement("img");
	second.src = '/assets/templates/e3escapes/images/slide1-' + imgsize + '.jpg';
	second.id = 'bg';
	second.alt = 'An Incomparable Place to Call Home';
	second.className = 'slide';
	
	var third = document.createElement("img");
	third.src = '/assets/templates/e3escapes/images/slide2-' + imgsize + '.jpg';
	third.id = 'bg2';
	third.alt = 'An Incomparable Place to Call Home';
	third.className = 'slide';
	
	var fourth = document.createElement("img");
	fourth.src = '/assets/templates/e3escapes/images/slide3-' + imgsize + '.jpg';
	fourth.id = 'bg3';
	fourth.alt = 'An Incomparable Place to Call Home';
	fourth.className = 'slide';
	
	container.appendChild(first);
	container.appendChild(second);
	container.appendChild(third);
	container.appendChild(fourth);
	/*
	  jQuery('<img />').attr({ 
          src: "/assets/templates/e3escapes/images/slide3-" + imgsize + ".jpg",
          id: "bg3",
		  alt: "An Incomparable Place to Call Home"
		  
        }).load(function(){
        jQuery('#hdrWrapper').append( jQuery(this) );
		jQuery(this).addClass('slide');
        // Your other custom code
    });	
	
	jQuery('<img />').attr({ 
          src: "/assets/templates/e3escapes/images/slide1-" + imgsize + ".jpg",
          id: "bg",
		  alt: "An Incomparable Place to Call Home"
        }).load(function(){
			jQuery("#load").fadeOut();
			jQuery('#hdrWrapper').append( jQuery(this).fadeIn() );
			jQuery(this).addClass('slide');
    });	
	
	jQuery('<img />').attr({ 
          src: "/assets/templates/e3escapes/images/slide0-" + imgsize + ".jpg",
          id: "bg1",
		  alt: "An Incomparable Place to Call Home"
        }).load(function(){
        jQuery('#hdrWrapper').append( jQuery(this) );
		jQuery(this).addClass('slide');
        // Your other custom code
    });	
	jQuery('<img />').attr({ 
          src: "/assets/templates/e3escapes/images/slide2-" + imgsize + ".jpg",
          id: "bg2",
		  alt: "An Incomparable Place to Call Home"
        }).load(function(){
        jQuery('#hdrWrapper').append( jQuery(this) );
		jQuery(this).addClass('slide');
        // Your other custom code
    });	
*/
	jQuery("#load").fadeOut();
	}
	
	
	jQuery(window).resize(function () {
		
		//alert("Resized");
		
		jQuery(".slide").hide();
		jQuery('.tag-title').hide();
		
		slider();
	}); 
 
jQuery(document).ready(function () {					 
	slider();
});
