jQuery.noConflict();function showDiv(divID)
{var div=document.getElementById(divID);div.style.display="";}
function hideDiv(divID)
{var div=document.getElementById(divID);div.style.display="none";}
function hideAllDivs(mnID)
{var selectMenu=document.getElementById(mnID);for(var i=0;i<=selectMenu.options.length-1;i++)
{hideDiv(selectMenu.options[i].value);}}
function toggle_shrtcode(showID,mnID)
{hideAllDivs(mnID);showDiv(showID);}
var wpGenerateShortcodeAdmin=function(){}
wpGenerateShortcodeAdmin.prototype={options:{},generateShortCode:function(){var codetype=jQuery("#dynshortcode_selector option:selected").val();var columntype=jQuery("#dynshortcode_columns option:selected").val();var border=jQuery("#dynshortcode_border option:selected").val();var twothirdpos=jQuery("#dynshortcode_23pos option:selected").val();var threefourthpos=jQuery("#dynshortcode_34pos option:selected").val();var postgallerytype=jQuery("#dynshortcode_postgallery option:selected").val();var postgallerycontent=jQuery("#dynshortcode_pg_slider_content option:selected").val();var postgalleryslideset=jQuery("#dynshortcode_slideset option:selected").val();var postgalleryimageeffect=jQuery("#dynshortcode_postgallery_imageeffect option:selected").val();var postgalleryimagealign=jQuery("#dynshortcode_pg_image_align option:selected").val();var postgalleryimage_animation=jQuery("#dynshortcode_pg_image_animation option:selected").val();var postgalleryimage_tween=jQuery("#dynshortcode_pg_image_tween option:selected").val();var postgalleryimagenav=jQuery("#dynshortcode_pg_imagenav option:selected").val();var postgalleryshadowsize=jQuery("#dynshortcode_postgallery_shadowsize option:selected").val();var postgallerysortby=jQuery("#dynshortcode_postgallery_sortby option:selected").val();var postgalleryorderby=jQuery("#dynshortcode_postgallery_orderby option:selected").val();var postgallerygridcontent=jQuery("#dynshortcode_pg_grid_content option:selected").val();var postgallerygridcolumns=jQuery("#dynshortcode_pg_grid_columns option:selected").val();var postgalleryaccordioncontent=jQuery("#dynshortcode_pg_accordion_content option:selected").val();var postgalleryaccordion_minititles=jQuery("#dynshortcode_pg_accordion_minititle option:selected").val();var postgalleryaccordion_autorotate=jQuery("#dynshortcode_pg_accordion_autorotate option:selected").val();var styledboxes=jQuery("#dynshortcode_styledboxes option:selected").val();var styledboxesalign=jQuery("#dynshortcode_box_align option:selected").val();var buttontype=jQuery("#dynshortcode_button_type option:selected").val();var buttontarget=jQuery("#dynshortcode_button_target option:selected").val();var buttoncolor=jQuery("#dynshortcode_button_color option:selected").val();var buttonwidth=jQuery("#dynshortcode_button_width option:selected").val();var hozbreak=jQuery("#dynshortcode_hozbreak option:selected").val();var blockquote=jQuery("#dynshortcode_blockquote option:selected").val();var blockquotealign=jQuery("#dynshortcode_blockquote_align option:selected").val();var highlight=jQuery("#dynshortcode_highlight option:selected").val();var imageeffect=jQuery("#dynshortcode_imageeffect option:selected").val();var imageeffectalign=jQuery("#dynshortcode_imageeffectalign option:selected").val();var imageeffectshadowsize=jQuery("#dynshortcode_imageeffect_shadowsize option:selected").val();var listcolor=jQuery("#dynshortcode_listcolor option:selected").val();var liststyle=jQuery("#dynshortcode_liststyle option:selected").val();var revealalign=jQuery("#dynshortcode_revealalign option:selected").val();if(revealalign){var revealalign='align="'+revealalign+'"';}
var dropcapstyle=jQuery("#dynshortcode_dropcapstyle option:selected").val();var dropcapcolor=jQuery("#dynshortcode_dropcapcolor option:selected").val();if(this['options']['pg_slider_height']){var postgalleryslider_height='height="'+this['options']['pg_slider_height']+'"';}else{var postgalleryslider_height='';}
if(this['options']['pg_slider_imgheight']){var postgalleryslider_imgheight='imgheight="'+this['options']['pg_slider_imgheight']+'"';}else{var postgalleryslider_imgheight='';}
if(this['options']['pg_slider_imgwidth']){var postgalleryslider_imgwidth='imgwidth="'+this['options']['pg_slider_imgwidth']+'"';}else{var postgalleryslider_imgwidth='';}
if(this['options']['pg_sliderlightbox']=="yes"){var postgalleryslider_lightbox='lightbox="'+this['options']['pg_sliderlightbox']+'"';}else{var postgalleryslider_lightbox='';}
if(this['options']['pg_grid_height']){var postgallerygrid_height='height="'+this['options']['pg_grid_height']+'"';}else{var postgallerygrid_height='';}
if(this['options']['pg_grid_imgheight']){var postgallerygrid_imgheight='imgheight="'+this['options']['pg_grid_imgheight']+'"';}else{var postgallerygrid_imgheight='';}
if(this['options']['pg_grid_imgwidth']){var postgallerygrid_imgwidth='imgwidth="'+this['options']['pg_grid_imgwidth']+'"';}else{var postgallerygrid_imgwidth='';}
if(this['options']['pg_gridlightbox']=="yes"){var postgallerygrid_lightbox='lightbox="'+this['options']['pg_gridlightbox']+'"';}else{var postgallerygrid_lightbox='';}
if(this['options']['pg_gridfilter']=="yes"){var postgallerygrid_filter='filtering="'+this['options']['pg_gridfilter']+'"';}else{var postgallerygrid_filter='';}
if(this['options']['pg_accordion_width']){var postgalleryaccordion_gallerywidth='width="'+this['options']['pg_accordion_width']+'"';}else{var postgalleryaccordion_gallerywidth='';}
if(this['options']['pg_accordion_imgheight']){var postgalleryaccordion_imgheight='height="'+this['options']['pg_accordion_imgheight']+'"';}else{var postgalleryaccordion_imgheight='';}
if(this['options']['pg_accordionlightbox']=="yes"){var postgalleryaccordion_lightbox='lightbox="'+this['options']['pg_accordionlightbox']+'"';}else{var postgalleryaccordion_lightbox='';}
if(this['options']['pg_accordiontimeout']){var postgalleryaccordion_accordiontimeout='timeout="'+this['options']['pg_accordiontimeout']+'"';}else{var postgalleryaccordion_accordiontimeout='';}
if(this['options']['pg_image_imgw']){var postgalleryimage_width='width="'+this['options']['pg_image_imgw']+'"';}else{var postgalleryimage_width='';}
if(this['options']['pg_image_imgh']){var postgalleryimage_height='height="'+this['options']['pg_image_imgh']+'"';}else{var postgalleryimage_height='';}
if(this['options']['pg_imagetimeout']){var postgalleryimage_timeout='timeout="'+this['options']['pg_imagetimeout']+'"';}else{var postgalleryimage_timeout='';}
if(this['options']['gallery_id']!=''){var postgallery_id='id="'+this['options']['gallery_id']+'"';}else{var postgallery_id='id="0"'}
if(this['options']['boxwidth']){var styledboxes_width='width="'+this['options']['boxwidth']+'"';}else{var styledboxes_width=''}
if(this['options']['revealwidth']){var reveal_width='width="'+this['options']['revealwidth']+'"';}else{var reveal_width=''}
if(this['options']['colheight']){var colheight='height="'+this['options']['colheight']+'"';}else{var colheight='';}
if(styledboxesalign){var styledboxesalign='align="'+styledboxesalign+'"';}
if(imageeffectalign){imageeffectalign='align="'+imageeffectalign+'"';}else{imageeffectalign='';}
if(this['options']['imageeffectwidth']){var imageeffectwidth='width="'+this['options']['imageeffectwidth']+'"';}else{var imageeffectwidth='width="250"';}
if(this['options']['imageeffectheight']){var imageeffectheight='height="'+this['options']['imageeffectheight']+'"';}else{var imageeffectheight='height="188"';}
if(this['options']['imageeffectvidurl']){var imageeffectvidurl='videourl="'+this['options']['imageeffectvidurl']+'"';}else{var imageeffectvidurl='';}
if(buttontarget){var buttontarget='target="'+buttontarget+'"';}
if(buttoncolor){var buttoncolor='color="'+buttoncolor+'"';}else{var buttoncolor='';}
if(buttonwidth){var buttonwidth='width="'+buttonwidth+'"';}else{var buttonwidth='';}
if(postgalleryimagealign){postgalleryimagealign='align="'+postgalleryimagealign+'"';}else{postgalleryimagealign='';}
if(postgalleryimage_animation){postgalleryimage_animation='animation="'+postgalleryimage_animation+'"';}else{postgalleryimage_animation='';}
if(postgalleryimage_tween){postgalleryimage_tween='tween="'+postgalleryimage_tween+'"';}else{postgalleryimage_tween='';}
if(postgalleryimagenav){postgalleryimagenav='navigation="'+postgalleryimagenav+'"';}
var postcats=[];jQuery("input[name^='dynshortcode_postcat']").each(function(){if(this.checked){postcats.push(this.value);}});var gallerydata='categories="'+postcats+'"';if(postgalleryslideset){gallerydata='slidesetid="'+postgalleryslideset+'"';}
if(postgalleryimageeffect){var isshadow=postgalleryimageeffect.substr(0,6);if(isshadow=="shadow"){var shadow='shadow="'+postgalleryshadowsize+'"';}else{var shadow='';}
postgalleryimageeffect='imageeffect="'+postgalleryimageeffect+'"'}
var postgallerynumposts=this['options']['postgallery_numposts'];var postgalleryexcerpt=this['options']['postgallery_excerpt'];if(postgallerynumposts){postgallerynumposts='limit="'+postgallerynumposts+'"';}else{postgallerynumposts='';}
if(postgalleryexcerpt){postgalleryexcerpt='excerpt="'+postgalleryexcerpt+'"';}else{postgalleryexcerpt='';}
var postgallerysortby=jQuery("#dynshortcode_postgallery_sortby option:selected").val();if(postgallerysortby){postgallerysortby='sortby="'+postgallerysortby+'"';}else{postgallerysortby='';}
var postgalleryorderby=jQuery("#dynshortcode_postgallery_orderby option:selected").val();if(postgalleryorderby){postgalleryorderby='orderby="'+postgalleryorderby+'"';}else{postgalleryorderby='';}
if(postgallerycontent!=''){postgallerycontent='content="'+postgallerycontent+'"';if(postgallerycontent=="text"){postgalleryimageeffect="";}}
if(postgallerygridcontent!=''){postgallerygridcontent='content="'+postgallerygridcontent+'"';if(postgallerygridcontent=="text"){postgallerygridcontent="";}}
if(postgallerygridcolumns){postgallerygridcolumns='columns="'+postgallerygridcolumns+'"';}else{postgallerygridcolumns="";}
if(postgalleryaccordioncontent!=''){postgalleryaccordioncontent='content="'+postgalleryaccordioncontent+'"';if(postgalleryaccordioncontent=="text"){postgalleryaccordioncontent="";}}
if(postgalleryaccordion_minititles!=''){postgalleryaccordion_minititles='minititles="'+postgalleryaccordion_minititles+'"';}else{postgalleryaccordion_minititles="";}
if(postgalleryaccordion_autorotate!=''){postgalleryaccordion_autorotate='autoplay="'+postgalleryaccordion_autorotate+'"';}else{postgalleryaccordion_autorotate="";}
if(border!=''){border='border="'+border+'"';}
var attrs='';jQuery.each(this['options'],function(name,value){if(value!=''){attrs+=' '+name+'="'+value+'" ';}});if(codetype=="columnlayout"){if(columntype=="twocolumns"){return'[two_columns '+colheight+' '+border+']'+this['options']['twocol_first']+'[/two_columns] [two_columns_last '+colheight+' '+border+']'+this['options']['twocol_second']+'[/two_columns_last] '}
if(columntype=="threecolumns"){return'[three_columns '+colheight+' '+border+']'+this['options']['threecol_first']+'[/three_columns]  [three_columns '+colheight+' '+border+']'+this['options']['threecol_second']+'[/three_columns] [three_columns_last '+colheight+' '+border+']'+this['options']['threecol_third']+'[/three_columns_last] '}
if(columntype=="twothreecolumns"){if(twothirdpos=="left"){return'[twothirds_columns '+colheight+' '+border+']'+this['options']['twothreecol_second']+'[/twothirds_columns] [onethird_columns_last '+colheight+' '+border+']'+this['options']['twothreecol_first']+'[/onethird_columns_last] '}else{return'[onethird_columns '+colheight+' '+border+']'+this['options']['twothreecol_first']+'[/onethird_columns] [twothirds_columns_last '+colheight+' '+border+']'+this['options']['twothreecol_second']+'[/twothirds_columns_last]'}}
if(columntype=="fourcolumns"){return'[four_columns '+colheight+' '+border+']'+this['options']['fourcol_first']+'[/four_columns] [four_columns '+colheight+' '+border+']'+this['options']['fourcol_second']+'[/four_columns] [four_columns '+colheight+' '+border+']'+this['options']['fourcol_third']+'[/four_columns] [four_columns_last '+colheight+' '+border+']'+this['options']['fourcol_fourth']+'[/four_columns_last]'}
if(columntype=="threefourcolumns"){if(threefourthpos=="left"){return'[threefourths_columns '+colheight+' '+border+']'+this['options']['threefourcol_second']+'[/threefourths_columns] [onefourth_columns_last '+colheight+' '+border+']'+this['options']['threefourcol_first']+'[/onefourth_columns_last]'}else{return'[onefourth_columns '+colheight+' '+border+']'+this['options']['threefourcol_first']+'[/onefourth_columns]  [threefourths_columns_last '+colheight+' '+border+']'+this['options']['threefourcol_second']+'[/threefourths_columns_last]'}}}else if(codetype=="postgallery"){if(gallerydata){if(postgallerytype=="postgallery_image"){return'['+postgallerytype+' '+postgalleryimage_width+' '+postgallery_id+' '+postgalleryimage_height+' '+shadow+' '+gallerydata+' '+postgalleryimageeffect+' '+postgalleryimagealign+' '+postgalleryimage_animation+' '+postgalleryimage_tween+' '+postgalleryimagenav+' '+postgalleryimage_timeout+' '+postgallerysortby+' '+postgalleryorderby+' '+postgallerynumposts+' '+postgalleryexcerpt+' /]'}else if(postgallerytype=="postgallery_slider"){return'['+postgallerytype+' '+postgallerycontent+' '+postgalleryslider_lightbox+' '+gallerydata+' '+shadow+' '+postgallery_id+' '+postgalleryimageeffect+' '+postgalleryslider_imgheight+' '+postgalleryslider_imgwidth+' '+postgalleryslider_height+' '+postgallerysortby+' '+postgalleryorderby+' '+postgallerynumposts+' '+postgalleryexcerpt+'/]'}else if(postgallerytype=="postgallery_grid"){return'['+postgallerytype+' '+postgallerygridcontent+' '+postgallerygridcolumns+' '+postgallerygrid_lightbox+' '+gallerydata+' '+shadow+' '+postgallery_id+' '+postgalleryimageeffect+' '+postgallerygrid_imgheight+' '+postgallerygrid_imgwidth+' '+postgallerygrid_height+' '+postgallerysortby+' '+postgalleryorderby+' '+postgallerynumposts+' '+postgalleryexcerpt+' '+postgallerygrid_filter+' /]'}else if(postgallerytype=="postgallery_accordion"){return'['+postgallerytype+' '+postgalleryaccordioncontent+' '+postgalleryaccordion_lightbox+' '+gallerydata+' '+shadow+' '+postgallery_id+' '+postgalleryimageeffect+' '+postgalleryaccordion_imgheight+' '+postgalleryaccordion_gallerywidth+' '+postgalleryaccordion_autorotate+' '+postgalleryaccordion_accordiontimeout+' '+postgalleryaccordion_minititles+' '+postgallerysortby+' '+postgalleryorderby+' '+postgallerynumposts+' '+postgalleryexcerpt+' /]'}}}else if(codetype=="styledboxes"){return'[styledbox type="'+styledboxes+'" '+styledboxes_width+' '+styledboxesalign+']'+this['options']['boxcontent']+'[/styledbox]'}else if(codetype=="button"){if(buttontype=="linkbutton"){return'[button url="'+this['options']['button_link']+'" '+buttontarget+' '+buttoncolor+' '+buttonwidth+' ]'+this['options']['button_text']+'[/button]'}else{return'[droppanelbutton '+buttoncolor+' '+buttonwidth+' ]'+this['options']['droppanelbutton_text']+'[/droppanelbutton]'}}else if(codetype=="hozbreak"){return'['+hozbreak+']'}else if(codetype=="blockquote"){return'[blockquote type="'+blockquote+'" align="'+blockquotealign+'"]'+this['options']['blockquote_text']+'[/blockquote]'}else if(codetype=="highlight"){return'[highlight type="'+highlight+'"]'+this['options']['highlight_text']+'[/highlight]'}else if(codetype=="imgeffect"){var isshadow=imageeffect.substr(0,6);if(isshadow=="shadow"){var shadow='shadow="'+imageeffectshadowsize+'"';}else{var shadow='';}
return'[imageeffect type="'+imageeffect+'" '+imageeffectalign+' '+imageeffectwidth+' '+imageeffectheight+' '+shadow+' alt="'+this['options']['imageeffectalt']+'" url="'+this['options']['imageeffecturl']+'" '+imageeffectvidurl+']'}else if(codetype=="tabs"){var tabsnum=this['options']['numtabs'];var tabtitles='';var i=1;for(i=1;i<=tabsnum;i++)
{if(i==tabsnum){tabtitles=tabtitles+'[tabhead_last id="'+i+'"]  title '+i+'  [/tabhead_last] ';}else{tabtitles=tabtitles+'[tabhead id="'+i+'"]  title '+i+'  [/tabhead] ';}}
var tabscontent='';var i=1;for(i=1;i<=tabsnum;i++)
{tabscontent=tabscontent+'[tab id="'+i+'"]  tabcontent '+i+'  [/tab] ';}
var tabs='[tabswrap] '+tabtitles+' '+tabscontent+'[/tabswrap]';return tabs;}else if(codetype=="accordion"){var panelsnum=this['options']['numaccordion'];var i=1;var panelcontent='';var i=1;for(i=1;i<=panelsnum;i++)
{panelcontent=panelcontent+'[panel title=" TITLE'+i+' "] content '+i+'  [/panel] ';}
var accordion='[accordion] '+panelcontent+' [/accordion]';return accordion;}else if(codetype=="list"){var listnum=this['options']['numlist'];var i=1;var createlist='';var i=1;for(i=1;i<=listnum;i++)
{createlist=createlist+'<li>content</li>\r';}
var list='[list style="'+liststyle+'" color="'+listcolor+'"]\r<ul>\r'+createlist+'</ul>\r[/list]';return list;}else if(codetype=="reveal"){return'[reveal '+reveal_width+' '+revealalign+' title="'+this['options']['revealtitle']+'" ]'+this['options']['revealcontent']+'[/reveal]'}else if(codetype=="dropcaps"){return'[dropcap style="'+dropcapstyle+'" color="'+dropcapcolor+'" text="'+this['options']['dropcap']+'" /]';}},sendToEditor:function(f){var collection=jQuery(f).find("input[id^=dynshortcode]:not(input:checkbox),input[id^=dynshortcode]:checkbox:checked");var $this=this;collection.each(function(){var name=this.name.substring(13,this.name.length-1);$this['options'][name]=this.value;});send_to_editor(this.generateShortCode());return false;}}
var shortcodegenerator=new wpGenerateShortcodeAdmin();function copy_gallery_slide(){var $multitable_wrap=jQuery('.selected_custom');var $add_next=jQuery('.selected_custom').find('.add_row');var $del_this=jQuery('.selected_custom').find('.del_row');var $id;$multitable_wrap.each(function(){$add_next.unbind('click').bind('click',function(){$id=jQuery(this).attr("id");var $count=jQuery('#table-'+$id+'.multitables').find('.slide_counter');var $current_table=jQuery('#table-'+$id+'.multitables');$count.val(parseInt($count.val())+1);$current_number=$count.val();$newclone=jQuery('#table-'+$id+'.multitables .clone_row').clone().insertBefore(jQuery('#table-'+$id+'.multitables .clone_row'));$newclone.removeClass('hidden').removeClass('clone_row');correct_slide_id($current_table);copy_gallery_slide();slide_drag($id);return false;});$del_this.unbind('click').bind('click',function(){$id=jQuery(this).attr("tabindex");var $count=jQuery('#table-'+$id+'.multitables').find('.slide_counter');var $current_table=jQuery('#table-'+$id+'.multitables');$count.val(parseInt($count.val())-1);jQuery(this).parents('.multitable').remove();correct_slide_id($current_table);return false;});});}
function correct_slide_id($current_table){var i=0;$current_table.find('.multitable').each(function(i){var $current_sub_table=jQuery(this);$current_sub_table.find('.changenumber').html(i+1);$current_sub_table.find('.correct_num').each(function(){var $multiply_me='';var $newname=jQuery(this).attr('name').replace(/\_\d+/,'_'+i);if(jQuery(this).hasClass('multiply_me'))$multiply_me='multiply_me';var $iscat=jQuery(this).hasClass('catselect');if($iscat){jQuery(this).attr({'name':$newname,'id':$newname,'class':$newname+" correct_num catselect"});}else{jQuery(this).attr({'name':$newname,'id':$newname,'class':$newname+" correct_num"});}});});}
function slide_drag($id){jQuery(".table_sort").tableDnD({onDragClass:"myDragClass",onDrop:function(table,row){if(!$id){$id=jQuery(table).attr("tabindex");}
var $multitable_wrap=jQuery('#table-'+$id+' .multitable');var i=0;$multitable_wrap.each(function(i){var $current_sub_table=jQuery(this);$current_sub_table.find('.correct_num').each(function(){var $newname=jQuery(this).attr('name').replace(/\_\d+/,'_'+i);var $iscat=jQuery(this).hasClass('catselect');if($iscat){jQuery(this).attr({'name':$newname,'id':$newname,'class':$newname+" correct_num catselect"});}else{jQuery(this).attr({'name':$newname,'id':$newname,'class':$newname+" correct_num"});}});});},onDragStart:function(table,row){}});}
function copy_gallery(){var $multitable_wrap=jQuery('.wrap');$multitable_wrap.each(function(){var $add_gal=jQuery(this).find('.add_gal');var $del_gal=jQuery(this).find('.del_gal');var $count=jQuery(this).find('.slideset_number');var $current_table=jQuery(this);$add_gal.unbind('click').bind('click',function(){$count.val(parseInt($count.val())+1);$current_number=$count.val();$newclone=jQuery('.clone_gal').clone().insertBefore(jQuery('.clone_gal'));$newclone.removeClass('hidden').removeClass('clone_gal');correct_gallery_id($current_table);copy_gallery();copy_gallery_slide();reveal_gallery();return false;});$del_gal.unbind('click').bind('click',function(){$count.val(parseInt($count.val())-1);jQuery(this).parents('.table_wrap').remove();correct_gallery_id($current_table);return false;});});}
function correct_gallery_id($current_table){$current_table.find('.table_wrap').each(function(i){var $current_sub_table=jQuery(this);$current_sub_table.find('.correct_gallery_num').each(function(){var $multiply_me='';var $newname=jQuery(this).attr('id').replace(/\d+/,i);if(jQuery(this).hasClass('multiply_me'))$multiply_me='multiply_me';jQuery(this).attr({'id':$newname});});$current_sub_table.find('.correct_num').each(function(){var $multiply_me='';var $newname=jQuery(this).attr('name').replace(/\d+\_/,i+'_');if(jQuery(this).hasClass('multiply_me'))$multiply_me='multiply_me';jQuery(this).attr({'name':$newname,'id':$newname});});});}
function reveal_gallery(){jQuery(".reveal-content").hide();jQuery("div.reveal").toggle(function(){jQuery(this).addClass("ui-state-active");},function(){jQuery(this).removeClass("ui-state-active ");});jQuery("div.reveal").click(function(){jQuery(this).next(".reveal-content").animate({"height":"toggle"});});}
function reveal_meta(){jQuery(".reveal-content").hide();jQuery("h4.revealmeta").toggle(function(){jQuery(this).addClass("ui-state-active");},function(){jQuery(this).removeClass("ui-state-active ");});jQuery("h4.revealmeta").click(function(){jQuery(this).next(".reveal-content").animate({"height":"toggle"},{duration:200});});}
function colorpic_fields(){jQuery('#gallery3dincolor,#gallery3dtextcolor,#font_color,#font_link,#font_hover,#side_link,#side_hover,#cufongradpri_1,#cufongradpri_2,#cufongradpri_3,#cufongradpri_4,#cufongradpri_5,#cufongradpri_6,#cufongradsec_1,#cufongradsec_2,#cufongradsec_3,#cufongradsec_4,#cufongradsec_5,#cufongradsec_6').ColorPicker({onSubmit:function(hsb,hex,rgb,el){jQuery(el).val(hex);jQuery(el).ColorPickerHide();},onBeforeShow:function(){jQuery(this).ColorPickerSetColor(this.value);}}).bind('keyup',function(){jQuery(this).ColorPickerSetColor(this.value);});}
function manage_data_category(){jQuery(".adddatacat").click(function(){var $newcat=jQuery('.newcategory').val();jQuery('.catselect').append('<option value="'+$newcat+'">'+$newcat+'</option>');jQuery('.filter_categories_select').append('<option value="'+$newcat+'">'+$newcat+'</option>');str='';jQuery(".filter_categories_select option").each(function(){str+=jQuery(this).text()+",";});str=str.substring(0,str.length-1);jQuery(".filter_categories").val(str);});jQuery(".deldatacat").click(function(){var $delcat=jQuery(".filter_categories_select option:selected").val();jQuery(".catselect option[value='"+$delcat+"']").remove();jQuery(".filter_categories_select option[value='"+$delcat+"']").remove();str='';jQuery(".filter_categories_select option").each(function(){str+=jQuery(this).text()+",";});str=str.substring(0,str.length-1);jQuery(".filter_categories").val(str);});};jQuery(window).load(function(){copy_gallery_slide();copy_gallery();slide_drag();reveal_gallery();reveal_meta();colorpic_fields();manage_data_category();});