var Contact = {
	objData: {},
	Init: function(){
		for(var i in Contact.objData){
			$('#'+i).focus(Contact.Focus).blur(Contact.Blur);
		}
	},
	SetData: function(obj){ Contact.objData = obj; },
	Focus: function(){
		$(this).parent().parent().addClass('focus');
		strId = $(this).attr('id');
		if(false==Contact['objData'][strId]['blnError']){
			if($(this).val()==Contact['objData'][strId]['strValue']){
				$(this).val('');
			}
		}else{
			if($(this).val()==Contact['objData'][strId]['strError']){
				$(this).val(Contact['objData'][strId]['strValue']);
			}
		}
	},
	Blur: function(){
		$(this).parent().parent().removeClass('focus');
		if(false==Contact['objData'][strId]['blnError']){
			if($(this).val()==''){
				$(this).val(Contact['objData'][strId]['strValue']);
			}
		}else{
			if($(this).val()==Contact['objData'][strId]['strValue']){
				$(this).val(Contact['objData'][strId]['strError']);
			}
		}
	},
	After: function(){
		Contact.objData = {
			contactname: { blnError:false, strError:'', strValue:'Imię' },
			contactemail: { blnError:false, strError:'', strValue:'Adres e-mail' },
			contactsubject: { blnError:false, strError:'', strValue:'Temat' },
			contactcontent: { blnError:false, strError:'', strValue:'Wiadomość' }
		};
		for(var i in Contact.objData){
			$('#'+i).val(Contact['objData'][i]['strValue']);
		}
	}
};
/*
var Clients = {
	objLogoHover: null,
	objLogoActive: null,
	objContentActive: null,
	Init: function(){
		var objLogoFirst = $('.c-logos li:first');
		Clients.objContentActive = $('.c-description .client:first');
		$('.c-logos li')
		.click(Clients.LogoClick)
		.mouseenter(Clients.LogoHover)
		.mouseleave(Clients.LogoHoverOut);
		objLogoFirst.addClass('active');
		Clients.LogoFadeIn(objLogoFirst);
		Clients.ContentFadeIn(Clients.objContentActive);
		Clients.objLogoActive = objLogoFirst;
		Clients.objLogoHover = objLogoFirst;
	},
	LogoHover: function(){
		Clients.LogoFadeIn(this);
		Clients.objLogoHover = $(this);
	},
	LogoHoverOut: function(){
		if(Clients.objLogoHover.hasClass('active')==false){
			Clients.LogoFadeOut(Clients.objLogoHover);
		}
	},
	LogoClick: function(){
		if(Clients.objLogoActive.attr('class') != $(this).attr('class')){
			Clients.objLogoActive.removeClass('active');
			Clients.LogoFadeOut(Clients.objLogoActive);
			Clients.objLogoActive = $(this);
			var objContent = $('.c-description .'+$(this).attr('class').substr(5));
			$(this).addClass('active');
			Clients.ContentFadeIn(objContent);
			Clients.objContentActive = objContent;
		}
	},
	LogoFadeIn:function(target){
		$(target).find('.grey').fadeOut(500);
		$(target).find('.color').fadeIn(500);
	},
	LogoFadeOut:function(target){
		$(target).find('.grey').fadeIn(500);
		$(target).find('.color').fadeOut(500);
	},
	ContentFadeIn:function(target){
		Clients.objContentActive.fadeOut(500);
		$(target).delay(200).fadeIn(500);
	}
}*/
/*
var Clients = {
	strLogoActive: '',
	strLogoHover: '',
	strContentActive: '',
	strContentNew: '',
	Init: function(){
		Clients.strLogoActive = /logo-(\w*)/.exec($('.logo').eq(0).attr('class'))[1];
		Clients.LoadContent(Clients.strLogoActive);
	},
	LoadContent: function(strId){
		var objTarget = $('client .'+strId);
		if(false==objTarget.is(':empty')){
			$.getJSON(
				'/ajax/',
				{module:'clients', clientid:strId},
				function(data){
					console.log(objTarget);
					objTarget.html(data['content']);
					Clients.SwapContent(strId);
			});
		}else{
			Clients.SwapContent(strId);
		}
	},
	SwapContent: function(strId){
		console.log('swap');
	}
};*/

$(document).ready(function(){
	Contact.Init();
	//Clients.Init();
});
