text: /*
   * Show Work group
   *
   * This file is part of ShowWGroup
   * 
   *
   * Development Started:
   * June 12, 2013
   * Last Update:
   * June 12, 2013
   *
   */
  
  (function($) {
  	$(document).ready(function(e) {
  
  		$(".da-ex-buttons").button();
  		
  		$("#da-ex-buttons-radio, #da-ex-buttons-checkbox").buttonset();
  		
  		$( "#da-ex-buttons-icon button:first" ).button({
  			icons: {
  				primary: "ui-icon-locked"
  			},
  			text: false
  		}).next().button({
  			icons: {
  				primary: "ui-icon-locked"
  			}
  		}).next().button({
  			icons: {
  				primary: "ui-icon-gear",
  				secondary: "ui-icon-triangle-1-s"
  			}
  		}).next().button({
  			icons: {
  				primary: "ui-icon-gear",
  				secondary: "ui-icon-triangle-1-s"
  			},
  			text: false
  		});
  		
  		$("#da-ex-dialog-div").dialog({
  			autoOpen: false, 
  			title: "Default UI Dialog", 
  			modal: true, 
  			width: "640", 
  			buttons: [{
  					text: "Close Dialog", 
  					click: function() {
  						$( this ).dialog( "close" );
  					}}]
  		});
  		
  		
  		$("#da-ex-dialog-form-div").dialog({
  			autoOpen: false, 
  			title: "UI Dialog Modal Form", 
  			modal: true, 
  			width: "640", 
  			buttons: [{
  					text: "Submit", 
  					click: function() {
  						$( this ).find('form#da-ex-dialog-form-val').submit();
  					}}]
  		}).find('form').validate({
  			rules: {
  				reqField: {
  					required: true
  				}, 
  				picture: {
  					required: true, 
  					accept: ['jpeg', 'jpg', 'png', 'gif']
  				}, 
  				dateField: {
  					required: true, 
  					date: true
  				}, 
  				gender: {
  					required: true
  				}
  			}, 
  			invalidHandler: function(form, validator) {
  				var errors = validator.numberOfInvalids();
  				if (errors) {
  					var message = errors == 1
  					? 'You missed 1 field. It has been highlighted'
  					: 'You missed ' + errors + ' fields. They have been highlighted';
  					$("#da-validate-error").html(message).show();
  				} else {
  					$("#da-validate-error").hide();
  				}
  			}
  		});
  		
  		$("#da-ex-dialog").bind("click", function(event) {
  			$("#da-ex-dialog-div").dialog("option", {modal: false}).dialog("open");
  			event.preventDefault();
  		});
  		$("#da-ex-dialog-modal").bind("click", function(event) {
  			$("#da-ex-dialog-div").dialog("option", {modal: true}).dialog("open");
  			event.preventDefault();
  		});
  		$("#da-ex-dialog-form").bind("click", function(event) {
  			$("#da-ex-dialog-form-div").dialog("option", {modal: true}).dialog("open");
  			event.preventDefault();
  		});
  		
  	});
  }) (jQuery);