jQuery(document).ready(function(f){f("input:checkbox,input:radio,select,input:submit").each(function(){if(this.id.indexOf(".")==-1){f(this).hide();}});var b=f("#BSFEAppRoot").text();var d;var l;var a;var g=b+"DesktopModules/BlueStack_FormEnhancer/Skins/";e();function h(){f("input:text,input:password").each(function(){if(this.id.indexOf(".")==-1&&this.id.indexOf("dnn_dnnSEARCH")==-1){var n=f(this).width();f(this).css("height","16px").css("border","0").width(n);f(this).wrap("<div style='width:"+(n+8)+"px;overflow:visible;'></div>");f(this).before("<div id='"+this.id+"maskedleft' style='width:4px;height:20px;background-image:url("+g+l+"/TextBox_Left.png);float:left;'></div>");f(this).wrap("<div id='"+this.id+"maskedmain' style='width:"+(n)+"px;padding-top:1px;background-image:url("+g+l+"/TextBox_Main.png);background-repeat:repeat-x;height:20px;float:left;'></div>");f("#"+this.id+"maskedmain").after("<div id='"+this.id+"maskedleft' style='width:4px;height:20px;background-image:url("+g+l+"/TextBox_Right.png);float:left;'></div>");}});f("select").each(function(){if(this.id.indexOf(".")==-1){f(this).after("<div style='width:"+(f(this).width()+28)+"px;overflow:visible;'><div id='"+this.id+"maskedleft' style='width:4px;height:20px;background-image:url("+g+l+"/DropDown_Left.png);float:left;'>&nbsp</div><div id='"+this.id+"masked' style='line-height:20px;height:20px;width:"+(f(this).width()-8)+"px;padding-top:1px;background-image:url("+g+l+"/DropDown_Main.png);background-repeat:repeat-x;height:20px;float:left;'>"+f(this).val()+"</div><div id='"+this.id+"maskedright' style='width:4px;height:20px;background-image:url("+g+l+"/DropDown_Right.png);float:left;'></div><div id='"+this.id+"maskedbuttonleft' style='width:4px;height:20px;background-image:url("+g+l+"/DropDown_Left.png);float:left;'>&nbsp</div><div id='"+this.id+"maskedbutton' style='float:left;height:20px;width:20px;background-repeat:repeat-x;background-image:url("+g+l+"/DropDown_Main.png)'><img id='"+this.id+"imgxddl' src='"+g+l+"/DropDown_Button.png' border='0'></div><div id='"+this.id+"maskedbuttonright' style='width:4px;height:20px;background-image:url("+g+l+"/DropDown_Right.png);float:left;'>&nbsp</div></div><div style='clear:both'></div><div id='"+this.id+"optionsxddl' class='ddl' style='height:150px;width:"+(f(this).width()+20)+"px;position:absolute;z-index:999;background:white;overflow:visible;'><div style='height:4px;width:4px;float:left;background-image:url("+g+l+"/TextBox_Left.png)'>&nbsp</div><div style='float:left;background-repeat:repeat-x;background-position:top left;height:4px;width:"+(f(this).width()+12)+"px;background-image:url("+g+l+"/TextBox_Main.png)'>&nbsp</div><div style='height:4px;width:4px;float:left;background-image:url("+g+l+"/TextBox_Right.png)'>&nbsp</div><div style='clear:both;'></div><div style='height:142px;width:1px;float:left;background-repeat:repeat y;background-image:url("+g+l+"/TextBox_Point.png)'>&nbsp</div><div id='"+this.id+"optionscontainer' style='overflow:auto;float:left;height:142px;width:"+(f(this).width()+18)+"px'>&nbsp</div><div style='height:142px;width:1px;float:left;background-repeat:y;background-image:url("+g+l+"/TextBox_Point.png)'>&nbsp</div><div style=clear:both;></div><div style='height:4px;width:4px;float:left;background-position:bottom left;background-image:url("+g+l+"/TextBox_Left.png)'>&nbsp</div><div style='float:left;background-repeat:repeat x;background-position:bottom left;height:4px;width:"+(f(this).width()+12)+"px;background-image:url("+g+l+"/TextBox_Main.png)'>&nbsp</div><div style='height:4px;width:4px;float:left;background-position:bottom left;background-image:url("+g+l+"/TextBox_Right.png)'>&nbsp</div><div style='clear:both;'></div></div>");f("#"+this.id+"optionsxddl").hide();f("#"+this.id+"imgxddl").bind("click",{name:this.id+"optionsxddl"},k).hover(function(){f(this).css("cursor","pointer");},function(){f(this).css("cursor","default");});var n=this.id;$options=f("#"+this.id).children("option");$options.each(function(o){f("#"+n+"optionscontainer").append("<div id='"+n+"opt_"+o+"' style='height:23px;line-height:23px;'>"+f(this).val()+"</div>");f("#"+n+"opt_"+o).bind("click",{name:n,text:f("#"+n+"opt_"+o).html(),selId:o},i).hover(function(){f(this).css("background","#EDEDED");f(this).css("cursor","pointer");},function(){f(this).css("background","white");f(this).css("cursor","default");});});}});f("input:submit").each(function(){if(this.id.indexOf(".")==-1){f(this).after("<div id='"+this.id+"masked' style='width:"+f(this).width()*1.3+"px;height:20px'><div id='"+this.id+"left' style='width:10px;height:20px;float:left;'><img src='"+g+l+"/Button_Left.png'></div><div id='"+this.id+"main' style='height:20px;width:"+(f(this).width()*1.3-20)+"px;text-align:center;line-height:20px;margin-left:auto;margin-right:auto;float:left;background-repeat:x;background-image:url("+g+l+"/Button_Main.png);"+a+"'>"+f(this).val()+"</div><div id='"+this.id+"right' style='width:10px;height:20px;float:right'><img src='"+g+l+"/Button_Right.png'></div><div style='clear:both'></div></div>");f("#"+this.id+"masked").bind("click",{name:this.id},m).hover(function(){f(this).css("cursor","pointer");},function(){f(this).css("cursor","default");});}});f("input:checkbox").each(function(){if(this.id.indexOf(".")==-1){if(this.checked==false){f(this).after("<a href='' id='"+this.id+"masked' style='margin-right:3px;position:relative;top:3px;'><img src='"+g+l+"/Check_Unchecked.png' border='0'></a>");}else{f(this).after("<a href='' id='"+this.id+"masked' style='margin-right:3px;position:relative;top:3px;'><img src='"+g+l+"/Check_Checked.png' border='0'></a>");}f("#"+this.id+"masked").bind("click",{name:this.id},j);}});f("input:radio").each(function(){if(this.id.indexOf(".")==-1){if(this.checked==false){f(this).after("<a href='' id='"+this.id+"masked' style='margin-right:3px;position:relative;top:2px;'><img src='"+g+l+"/Radio_Unchecked.png' border='0'></a>");}else{f(this).after("<a href='' id='"+this.id+"masked' style='margin-right:3px;position:relative;top:2px;'><img src='"+g+l+"/Radio_Checked.png' border='0'></a>");}f("#"+this.id+"masked").bind("click",{name:this.id},c);}});f(document).bind("click",function(n){if(n.target.id.indexOf("imgxddl")==-1){f("div[id$='optionsxddl']").hide();}});}function m(n){f("#"+n.data.name).click();}function k(n){f("#"+n.data.name).toggle();}function i(n){dropdown=document.getElementById(n.data.name);dropdown.selectedIndex=n.data.selId;f("#"+dropdown.id).change();f("#"+n.data.name+"optionsxddl").hide();f("#"+n.data.name+"masked").html(f("#"+n.data.name).val());}function j(n){n.preventDefault();if(f("#"+n.data.name).attr("checked")==false){f("#"+n.data.name+"masked").html("<img src='"+g+l+"/Check_Checked.png' border='0'>");}else{f("#"+n.data.name+"masked").html("<img src='"+g+l+"/Check_Unchecked.png' border='0'>");}f("#"+n.data.name).click();}function c(o){o.preventDefault();if(f("#"+o.data.name).attr("checked")==false){var n=f("#"+o.data.name).attr("name");f("input:[name='"+n+"']").each(function(){this.checked=false;f("#"+this.id+"masked").html("<img src='"+g+l+"/Radio_Unchecked.png' border='0'>");});f("#"+o.data.name).click();f("#"+o.data.name+"masked").html("<img src='"+g+l+"/Radio_Checked.png' border='0'>");}}function e(){f.ajax({type:"GET",url:b+"DesktopModules/BlueStack_FormEnhancer/FormEnhancerSettings.xml",dataType:"xml",success:function(n){f("Settings",n).each(function(){l=f(this).find("Skin").text();a=f(this).find("ButtonTextStyle").text();d="#"+f(this).find("DropDownBorder").text();h();});}});}});(jQuery);
