$(document).ready(function(){
function cloneUploadFileForm()
{
$('.upload input').unbind('change');
$('.upload input').change(function(){
$('
').insertAfter('.upload:last');
cloneUploadFileForm();
totalFiles = totalFiles+1;
});
}
var totalFiles=1;
cloneUploadFileForm();
/* Start of library to equalize Colums */
$('.videodrom-block').equalizeCols();
(function($) {
/**
* equalizes the heights of all elements in a jQuery collection
* thanks to John Resig for optimizing this!
* usage: $("#col1, #col2, #col3").equalizeCols();
*/
$.fn.equalizeCols = function(){
var height = 0,
reset = $.browser.msie ? "1%" : "auto";
return this
.css("height", reset)
.each(function() {
height = Math.max(height, this.offsetHeight);
})
.css("height", height)
.each(function() {
var h = this.offsetHeight;
if (h > height) {
$(this).css("height", height - (h - height));
};
});
};
})(jQuery);
/* End of library to equalize Colums */
function photoslider_itemLoadCallback(carousel, state)
{
// Check if the requested items already exist
if (carousel.has(carousel.first, carousel.last)) {
return;
}
jQuery.get(
'/videodrom/slider.xml',
{
first: carousel.first,
last: carousel.last
},
function(xml) {
photoslider_itemAddCallback(carousel, carousel.first, carousel.last, xml);
},
'xml'
);
};
function photoslider_itemAddCallback(carousel, first, last, xml)
{
// Set the size of the carousel
carousel.size(parseInt(jQuery('total', xml).text()));
jQuery('image', xml).each(function(i) {
carousel.add(first + i, photoslider_getItemHTML($(this).text(),$('id', xml).text(),$('title', xml).text()));
});
};
/**
* Item html creation helper.
*/
function photoslider_getItemHTML(url,id,title)
{
return '
' + title + '
';
};
$('#otherphoto').jcarousel({
itemLoadCallback: photoslider_itemLoadCallback,
scroll: 1
});
});