//jquery thingies

$(document).ready(function() {
  
  $(".closeMe").click(function () {
    $(".systemMessage").hide("slide", '', 500);
  });
  
  $("#sqlText").toggle();
    
  $("#sqlTextToggle").click(function() {
    $("#sqlText").toggle(100);
  })  
  $("#sqlText").click(function() {
    this.select();
  })  
});


//highslide
hs.graphicsDir = 'inc/highslide/graphics/';      
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.6;
hs.wrapperClassName = 'borderless floating-caption';
hs.captionEval = 'this.thumb.alt';
hs.marginLeft = 100; // make room for the thumbstrip
hs.marginBottom = 80 // make room for the controls and the floating caption
hs.numberPosition = 'caption';
hs.lang.number = '%1/%2';      
// Add the slideshow providing the controlbar and the thumbstrip
hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 4000,
	repeat: false,
	useControls: true,
	overlayOptions: {
		className: 'text-controls',
		position: 'bottom center',
		relativeTo: 'viewport',
		offsetX: 50,
		offsetY: -5      
	},
	thumbstrip: {
		position: 'middle left',
		mode: 'vertical',
		relativeTo: 'viewport'
	}
});
// Add the simple close button
hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top right',
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});

$(document).ready(function() {
  
  //language switch onchange
  langForm = $('#langSet');
  langForm.children('select').bind('change', function() {
    langForm.submit();
  });
  
  //add setting
  $('.addSetting').click(function() {
    this.cnt = $('.paternRow').clone(true);
    $(this.cnt).attr('class', '');
    //alert(this.cnt);    
    $('table.settingsEdit tr:first-child').after(this.cnt);
    return false;
  });
  
  $('.removeRow').click(function() {
    $(this).parent().parent().empty();
    $(this).parent().parent().remove();
  });
    
});

