jQuery(document).ready(function(){
	jQuery("#slide_down_product").click(function(){
		jQuery("#textarea-products").slideToggle()
	})
	jQuery("ol.progtrckr").each(function(){
        jQuery(this).attr("data-progtrckr-steps", 
                     jQuery(this).children("li").length);
    });
	
	jQuery('.picker').colpick({
	layout:'hex',
	submit:0,
	colorScheme:'dark',
	onChange:function(hsb,hex,rgb,el,bySetColor) {
		jQuery(el).css('border-color','#'+hex);
		jQuery(el).css('color','#' +hex)
		jQuery("#div_color_change").css('background-color','#' + hex)
		// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
		if(!bySetColor) jQuery(el).val(hex);
	}
}).keyup(function(){
	jQuery(this).colpickSetColor(this.value);
});
});
function open_file(file){
	jQuery('#' + file).click();
}
function change(txt){
	jQuery('#txt-' + txt).val(jQuery('#' + txt).val());
}
function plus_nav(id,id1)
{
	jQuery("#li_" + id).removeClass('progtrckr-todo');
	jQuery("#li_" + id).addClass('progtrckr-done');
	jQuery("#li_" + id).removeClass('bold');
	jQuery("#li_" + id1).addClass('bold');
}
function Decrease_nav(id,id1)
{
	jQuery("#li_" + id).removeClass('progtrckr-done');
	jQuery("#li_" + id).addClass('progtrckr-todo');	
	jQuery("#li_" + id1).removeClass('bold');
	jQuery("#li_" + id).addClass('bold');
}
function add_el(el)
{
	jQuery(".contact-parent").append(jQuery('#contact_' + el ).html());
	/*jQuery(".contact-parent").append(
	   	'<p class="contact_site" ><div><span class="icon-link"></span>'+
	   	'<input type="text" placeholder=" سایت " required>'+
        '<div id="message-info">Example: http://www.yourdomain.com/</div></div></p>   ');*/
}
function add_category(){
	alert('add');
}
function edit_cat(txt)
{
	alert(txt)
}
function show_action(id)
{
	//alert(id)
	jQuery(".div-cat .div-action").fadeOut();
	jQuery('#div-action_' + id).fadeIn();
}
function delete_cat(txt)
{
	alert(txt)
}
function product(txt)
{
	jQuery("#parent-category").fadeOut('fast');
	jQuery("#parent-product").fadeIn('slow');
}
function back_category()
{
	//alert(0)
	jQuery("#parent-product").fadeOut('fast');
	jQuery("#parent-category").fadeIn('slow');
}
function show_product_action(id){
	//alert(id)
	jQuery(".div-cat .div-action").fadeOut();
	jQuery('#div-product-action_' + id).fadeIn();
}
function edit_product(id)
{
	alert(id)
}
function delete_product(id)
{
	alert(id)
}
function get_picker_color(t){
	col = t;
	c = ('#picker'+col)
	co =jQuery(c).html();
	jQuery(c).colpick({
	
	//layout:'hex',
	color : '#'+jQuery(c).html() ,
	submit:0,
	
	//colorScheme:'',
	onChange:function(hsb,hex,rgb,el,bySetColor) {
	
		//jQuery(el).css('border-color','#'+hex);
		jQuery(el).css('color','#' +hex)
		
		jQuery(el).css('background-color','#' +hex)
		jQuery("#div_color_change").css('background-color','#' + hex)
		if(col==1){
		jQuery("#theme_1").css({"background-color":'#'+hex});
		}else if(col==2){
			jQuery("#actionbar_theme1").css({"background-color":'#' + hex});
		}else if(col==3){
			jQuery("#actionbar_theme1").css({"color":'#' + hex});
		}else if(col==4){
			jQuery(".title_list_theme1").css({"background-color":'#' + hex});
		}else if(col==5){
			jQuery(".title_list_theme1").css({"color":'#' + hex});
			jQuery(".title_list_theme4").css({"color":'#' + hex});
			jQuery(".title_list_theme5").css({"color":'#' + hex});
			jQuery(".title_list_theme6").css({"color":'#' + hex});
		}else if(col==6){
			jQuery(".list_theme1").css({"background-color":'#' + hex});
			jQuery(".list_theme2").css({"background-color":'#' + hex});
			jQuery(".list_theme3").css({"background-color":'#' + hex});
			jQuery(".list_theme5").css({"background-color":'#' + hex});
			jQuery(".list_theme6").css({"background-color":'#' + hex});
		}else if(col==7){
			jQuery(".list_footer_theme1").css({"background-color":'#' + hex});
			jQuery(".list_footer_theme7").css({"background-color":'#' + hex});
		}else if(col==8){
			jQuery(".list_footer_theme1").css({"color":'#' + hex});
			jQuery(".list_footer_theme2").css({"color":'#' + hex});
			jQuery(".list_footer_theme3").css({"color":'#' + hex});
			jQuery(".list_footer_theme5").css({"color":'#' + hex});
			jQuery(".list_footer_theme6").css({"color":'#' + hex});
			jQuery(".list_footer_theme7").css({"color":'#' + hex});
		}else if(col==9){
			jQuery(".text_list_theme1").css({"color":'#' + hex});
			jQuery(".text_list_theme2").css({"color":'#' + hex});
			jQuery(".text_list_theme3").css({"color":'#' + hex});
			jQuery(".text_list_theme4").css({"color":'#' + hex});
			jQuery(".text_list_theme5").css({"color":'#' + hex});
			jQuery(".text_list_theme6").css({"color":'#' + hex});
		}else if(col==10){
			jQuery(".search_icon").css({"color":'#' + hex});
		}
		// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
		if(!bySetColor) jQuery(el).html(hex);
	}
	}).keyup(function(){
		
		jQuery(this).colpickSetColor(this.value);
	});
}
