function set_param(value) { document.location.href='db_skins_manager.php?id=' + value; } $j(document).ready(function() { /*EVENTS*/ $j(".ch_image").click(function(){ window.location = "#"; }); $j("#ppic").dblclick(function(){ $j("#image_picker").hide("slow"); }); $j("#getmenusettings").change(function (){ var v =$j("#getmenusettings option:selected").val(); switch (v) { case "1": $j("#vertical_menu_settings_id").show(); $j("#horizont_menu_settings_id").hide(); break; case "2": $j("#horizont_menu_settings_id").show(); $j("#vertical_menu_settings_id").hide(); break; } }); }); $j(document).ready(function() { $j('#image_picker').hide(); $j('.colorpicker').each(function() { document.getElementById('picbox_img').src=$j(this).farbtastic($j(this).siblings('input')).hide(); }); $j('.dd').click (function (){ $j(this).siblings('.colorpicker').toggle(); }); }); /*IMAGE PICKER*/ $j(document).ready(function (){ $j('span.ch_image').click (function (e) { if($j(this).siblings("input").eq(0).val() !="") { document.getElementById('picbox_img').src=$j('input[name=img_path]').val() +$j(this).siblings("input").eq(0).val(); FitImage($j('input[name=img_path]').val() +$j(this).siblings("input").eq(0).val()); } if($j('#image_picker').is(':hidden')==false) { $j(e.target).text('Choose'); $j('#picbox').hide(); } $j('#image_picker').toggle("slow"); $j('#ppic').data("source",e.target); }); $j('#ppic').click(function () { var dest_element = $j($j(this).data("source")).siblings("input").eq(0); var dest_element_label = $j($j(this).data("source")); $j('#ppic option:selected').each(function () { FitImage($j('input[name=img_path]').val() + $j(this).val()); dest_element.val($j(this).val()); dest_element_label.text('Set'); //document.getElementById('picbox_img').src =$j(this).val(); $j('#picbox').show(); }) }); }); function FitImage(img) { var newImg = new Image(); var _height = 0; var _width = 0; newImg.onload=function(_height, _width) { _height = newImg.height; _width = newImg.width; var str = "Width: " + _width + "px " + "Height: " + _height + "px"; $j('#imgrealsize').attr("innerHTML",str); if(_height >= 137) _height=137; if(_width >= 137) _width=137; $j('#picbox_img').width(_width); $j('#picbox_img').height(_height); } newImg.src = img; }