/* SVN FILE: $Id: show-error.js 285 2008-08-26 09:38:25Z k.rakowski $ */

// JavaScript Document

/* skrypt dodający błędy do formularzy */

jQuery(document).ready(function(){ 
		
		/* domyslnie ukrywamy wszystkie komunikaty */
		jQuery('div#authMessage').hide();						
		jQuery('div.error-message').hide();
		
								
});

		/* funkcja pokazująca błądy na stronie */
		function show_error(id)
		{		
			if (id == null)
			{
				id = 'CustomerLoginForm';
			}
			
			/* pokazujemy komunikat błędu */
		
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion>=7)
			jQuery('div.error-message').show("slow");	
		} else if (ieversion>=6){
			null;
		}else{
			jQuery('div.error-message').show("slow");
		}
		
			//$('#error-message-ie').show("slow");
			//document.getElementById('error-message-ie').style.display = 'block';
			/* formularz zmiany hasła 
			jQuery('#CustomerEditPasswordForm div.password label').addClass('error-label');
			jQuery('#CustomerEditPasswordForm div.password input').addClass('error-pass');
			*/
			
			/* formularz zmiany e-amila 
			/jQuery('#CustomerEditEmailForm div.text:odd label').addClass('error-label');
			jQuery('#CustomerEditEmailForm div.text:odd input').addClass('error-pass');
			*/
			
			/* formularz logowania */
			jQuery('#'+id+' div.text label').addClass('error-label');
			jQuery('#'+id+' div.text input').addClass('error-text');
			jQuery('#'+id+' div.password label').addClass('error-label');
			jQuery('#'+id+' div.password input').addClass('error-pass');

		};