function openPost(post_id){

    		 $.ajax({
        		url: "http://thevinylfactory.com/?page_id=1141",
         		type: "POST",
         		data: { id: post_id },
         		success: function (response) {
         			setTimeout(function(){getScrollbars()}, 1);
             		$('#post_content').html(response);
         		}
     });
}

function getPostID(post_id)
{
	$("#slideshow_post_ID").attr('onClick', 'openPost('+post_id+');');

}

function goToUrl(post_id)
{
	window.location="http://thevinylfactory.com/?page_id=1191&id="+post_id;
}

function getPostID_ipad(post_id)
{
	$("#slideshow_post_ID").attr('onClick', 'goToUrl('+post_id+');');

}

// VIDEO METHODS
function inArray(needle, haystack) {
    var length = haystack.length;
    for(var i = 0; i < length; i++) {
        if(haystack[i] == needle) return true;
    }
    return false;
}

var ids = new Array();

function openVideo(post_id, code){
	
	if(code === 1)
	{
			//ids.push(post_id);

			$('.image-wrapper').remove();
			$('#slideshow_video').html('<center><br /><img src="http://vf-images.s3.amazonaws.com/ajax-loader.gif" style="width:300px;height:300px;"></center>');	
			$('#slideshow_video').fadeIn('slow');
		
			$.ajax({
        		url: "http://thevinylfactory.com/video/",
         		type: "POST",
         		data: { id: post_id },
         		success: function (response) 
         		{
         			$('#slideshow_video').html(response);
         		}
    		});
		
	} else {
			$('#slideshow_video').fadeOut('slow');
	}
	
	
    
}


// GALLERY METHODS
function openPic(pic_id){

    		 $.ajax({
        		url: "http://thevinylfactory.com/gallery-pictures/",
         		type: "POST",
         		data: { id: pic_id },
         		success: function (response) {
             		$('#pic_content').html(response);
         		}
     });
}

function getPicID(pic_id)
{
	$("#slideshow_post_ID").attr('onClick', 'openPic('+post_id+');');

}

