jQuery.noConflict();
jQuery(document).ready(function($){
var backgroundElements = '#branding';
$("#themeEditor #editPattern span").click(function(){
var backgroundPattern = $(this).attr("data-pattern");
var backgroundRepeat = $(this).attr("data-backgroundRepeat");
var backgroundPosition = $(this).attr("data-backgroundPosition");
var backgroundAttach = $(this).attr("data-backgroundAttach");
var noHeaderImage = $(this).attr("data-noHeaderImage");
var backgroundClasses = backgroundRepeat + " " + backgroundPosition + " " + backgroundAttach + " " + noHeaderImage;
$(backgroundElements).removeClass("repeat repeat-x repeat-y scroll fixed centerCenter topCenter noHeaderImage").addClass(" " + backgroundClasses).css("background-image", "url({style_images_url}/patterns/" + backgroundPattern + ")");
$.cookie('customPattern',backgroundPattern,{ expires: 365, path: '/'});
$.cookie('backgroundClasses',backgroundClasses,{ expires: 365, path: '/'});
});
if ( ($.cookie('customPattern') != null)){
$(backgroundElements).removeClass("repeat repeat-x repeat-y scroll fixed centerCenter topCenter noHeaderImage").addClass(" " + $.cookie('backgroundClasses')).css("background-image", "url({style_images_url}/patterns/" + $.cookie('customPattern') + ")");
}
else{
$(backgroundElements).addClass("no-repeat centerCenter fixed").css("background-image","url({style_images_url}/patterns/stardust.png)");
}
});