    var Divid;
    
    $(document).ready(function(){
        
        var textboxBefore = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td  valign=\"bottom\"><img src=\""+mapToTheParentDirectory+"images/ui/content/text_box_left.png\" align=\"absmiddle\" /></td><td>";
        
        var textboxAfter = "</td><td  valign=\"bottom\"><img src=\""+mapToTheParentDirectory+"images/ui/content/text_box_right.png\" align=\"absmiddle\" /></td></tr></table>";
        // apply a wrap around the element
       $('[isTextbox]').each(function(){
            $(this).wrap("<div isWrapper=\"true\" style=\"padding: 0px;\"></div>");
       });
       $('[isDropdown]').each(function(){
           
            $(this).wrap("<div isWrapperDD=\"true\" style=\"padding: 0px;\"></div>");
            //alert($(this).val());
       });
        
        // edit the inners of the wrapper you just added
       $('[isWrapper]').each(function(){
            var HTML = $(this).html();
            if(HTML.indexOf("Password") != -1)
                {
                    HTML = HTML.split("<INPUT").join("<INPUT type=\"Password\"");
                    HTML = HTML.split("<input").join("<input type=\"Password\"");
                }
            $(this).html(textboxBefore +  HTML + textboxAfter);
      });
      
      

       $('[isWrapperDD]').each(function(){
            Divid = ($(this).find("[dropDown]").attr("dropDown"));
        var DropdownBefore = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><td  valign=\"bottom\"><img src=\""+mapToTheParentDirectory+"images/ui/content/text_box_left.png\" align=\"absmiddle\"  height=\"23\" width=\"18\" /></td><td>";
        var DropdownAfter = "</td><td  valign=\"bottom\"><a onclick=\"ShowHide('"+Divid+"')\"><img src=\""+mapToTheParentDirectory+"images/ui/drop-down.jpg\" align=\"absmiddle\" hasRollover=\"true\" /></a></td></tr></table>"; 
            $(this).html(DropdownBefore +  $(this).html() + DropdownAfter);
      });
	   
    $(".ddOff").hover(function () {
     $(this).removeClass("ddOff");
     $(this).addClass("ddOn");
    });
    $(".ddOff").mouseout(function () {
		//alert("hello world");
     $(this).removeClass("ddOn");
     $(this).addClass("ddOff");
//	 $("#exButt").click();
    });
   $(".ddOff").click(function () {
	var obj = $(this).parent().parent().parent().parent().find('[toSet]').attr('toSet');
	
	//alert($(this).html());
	$('[dropDown*=' + obj + ']').val($(this).html());
	//alert("Monkey"+$(obj).html());
	ShowHide(obj);
							   
//		$().parent().parent().parent().parent().parent().parent().parent().prev().find("input").val($(this).html());
    // $(this).removeClass("ddOn");
     //$(this).addClass("ddOff");
    });
	
	
	});
function fnDropdownStateOn(Arg)
	{
	//alert("hello world"+Arg.id);
		//$("#"+Arg.id).css({'background-color':'#F6CB00', 'color':'rgb(0,0,0)', 'font-weight':'bold'});

}



/*	{
       $('[DDStyle]').each(function(){
           
            $(this).style("<div isWrapperDD=\"true\"></div>");
       });
										 
										 
		document.getElementById(Arg.id).style.backgroundColor = '#F6CB00';	
	}*/
