/*
 * jQuery select element skinning
 * version: 1.0.6 (26/06/2010)
 * @requires: jQuery v1.2 or later
 * adapted from Derek Harvey code
 *   http://www.lotsofcode.com/javascript-and-ajax/jquery-select-box-skin.htm
 * Licensed under the GPL license:
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Copyright 2010 Colin Verot
 * 
 * fix #20111221 Grzegorz Dziamski
 */
(function(A){A.fn.select_skin=function(B){return A(this).each(function(D){s=A(this);if(!s.attr("multiple")){s.wrap('<div class="cmf-skinned-select"></div>');c=s.parent();c.children().before('<div class="cmf-skinned-text">&nbsp;</div>').each(function(){if(this.selectedIndex>=0){A(this).prev().text(this.options[this.selectedIndex].innerHTML)}});c.width(s.outerWidth()-2);c.css("color",s.css("color"));c.css("font-size",s.css("font-size"));c.css("font-family",s.css("font-family"));c.css("font-style",s.css("font-style"));c.css("position","relative");s.css({opacity:0,position:"relative","z-index":100});var C=c.children().prev();C.width(s.outerWidth()-2-C.css("padding-right").replace(/px,*\)*/g,"")-C.css("padding-left").replace(/px,*\)*/g,""));C.css("padding-right","0px");C.css({opacity:100,overflow:"hidden",position:"absolute","text-indent":"0px","z-index":1,top:0,left:0});s.css("margin-left","0px");s.css("height",c.height());s.css("position","absolute");if((A.browser.msie&&parseInt(A.browser.version,10)==7)||A.browser.safari){s.css("bottom","0px");s.css("height","auto")}c.children().click(function(){C.text((this.options.length>0&&this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:""))});c.children().change(function(){C.text((this.options.length>0&&this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:""))})}})};A.fn.select_unskin=function(B){return A(this).each(function(C){s=A(this);if(!s.attr("multiple")&&s.parent().hasClass("cmf-skinned-select")){s.siblings(".cmf-skinned-text").remove();s.css({opacity:100,"z-index":0}).unwrap()}})}}(jQuery));
