// increase the default animation speed to exaggerate the effect
// NO CONFICLT HERE
jQuery.noConflict(); var jq = jQuery;
jq.fx.speeds._default = 1000;
		
jq(function(){
	//alert('d');
	// Accordion
	jq("#accordion").accordion({ header: "h3",collapsible: true, autoHeight: false});

    jq("#header").accordion({ header: "h3" });
    jq('#top-panel').hide();
    
    jq('#logccbutton').hide(); 
    jq('#regccbutton').hide();

    jq('#error_type').hide(); 
    jq('#error_name').hide();
    jq('#error_num').hide();
    jq('#error_num2').hide();
    jq('#error_cvv').hide();
    jq('#error_cvv2').hide();
    jq('#error_exp').hide();
    	            
	// Tabs
	jq('#tabs').tabs();

    jq('#osepayment').hide();
    jq('.done').hide();
    
	

	// Dialog			
	jq('#dialog').dialog({
		autoOpen: false,
		width: 600,
		modal: true,
		buttons: {
			"Ok": function() { 
				jq(this).dialog("close"); 
			}
		}
	});

	// Dialog			
	jq('#dialog2').dialog({
		autoOpen: false,
		width: 600,
		modal: true,
		buttons: {
			"Ok": function() { 
				jq(this).dialog("close"); 
			}
		}
	});

	// Dialog			
	jq('#dialog3').dialog({
		autoOpen: false,
		width: 600,
		modal: true,
		buttons: {
			"Ok": function() { 
				jq(this).dialog("close"); 
			}
		}
	});	
								
	jq('#dialog4').dialog({
		autoOpen: false,
		width: 600,
		modal: true
	});
	
	jq('#checkoutbutton').dialog({
		autoOpen: false,
		width: 600,
		height: 200,
		modal: true
		
	});
		   
   jq('#opener').hide();
		
   jq('#backbutton').click(function() 
    {
      jq('#osebilling').fadeIn('fast');
      jq('#osepayment').fadeOut('fast');
	 return false;
     });
	     		     
	// Dialog Link
	jq('#dialog_link').click(function(){
		jq('#dialog').dialog('open');
		return false;
	});

	// Datepicker
	jq('#datepicker').datepicker({
		inline: true
	});
	
	// Slider
	jq('#slider').slider({
		range: true,
		values: [17, 67]
	});
	
	// Progressbar
	jq("#progressbar").progressbar({
		value: 20 
	});
			
	//hover states on the static widgets
	jq('#dialog_link, ul#icons li').hover(
		function() { jq(this).addClass('ui-state-hover'); }, 
		function() { jq(this).removeClass('ui-state-hover'); }
	);
	
	/*
	jq("button, input:submit, a", ".search").button();
	jq("input, input:text, a", ".search").input();
	*/
			  
	
	jq('.buttons-set #submit').click(function()	{
		//alert(jq('input[name="osename"').val());
		
		if(regvalidate() == false)
		{
			return false;
		}
		
		 //show the loading sign  
		jq('.loading').show();
		
		//start the ajax
		jq('#regForm input[name="task"]').val('reg_save');
		var options = {
				//target:'#test',
				//beforeSubmit : showDetail,
				success: showResponse
			};	
		
		jq('#regForm').ajaxSubmit(options);  
		return false;
	});
	

	

	jq('.buttons-set #backbutton').click(function(){
		window.location.replace('index.php?option=com_osemsc&view=register&layout=ajax');
	});
	//alert('d');
});
			


			


