	$(function() {
		
		$("input[type='text'], input[type='password'], textarea").each(function(){
			$(this).attr('def_val', $(this).val());
			if ($(this).attr('def_val') !== undefined)
			{
				$(this).val($(this).attr('def_val')).focus(function(){
					if($(this).val()==$(this).attr('def_val')){
						$(this).val('');
					}
				}).blur(function(){
					if($(this).val()==''){
						$(this).val($(this).attr('def_val'));
					}
				});
			}
		})
		
       $('div.inside a img').each(function(){
       	       		
       		$(this).parent().append($(this).parent().html());
       		
       		$(this).parent().css('position', 'relative').css('display', 'block').find("img:last").css('position', 'absolute').css('top', '0').css('left', '0').hide();
       		
       		this.src = this.src.replace(/\.jpg$/, '_gs.jpg');	        
	        
       	});
       	
        $('div.inside a img').mouseover(function(){
    		$(this).next().fadeIn(500);
     	});
     	
        $('div.inside a img').next().mouseout(function(){
    		$(this).parent().find('img:last').fadeOut(500);
     	});
		
		$("#domtab_menu").show();
		
		$(".all_content").hide();
		
		$(".all_content:first").show();
		
		$("#domtab_menu li a").each(function (index) {
			if (index % 2 != 0) {
				$(this).click(function () {
					$("#topic").attr('value',$("#"+$("#domtab_menu li a").eq(index-1).attr('rel')+" .on_top").text());
					$(".all_content").hide();
					$("#kontakt").show();
				});
			}
		});
		
		$("a.domt.all").click(function () {
			$(".all_content").hide();
			$("#"+$(this).attr('rel')).show();
		});
		
		switch (location.hash) {
			case '#strona':	$(".all_content").hide();
							$("#oferta_1").show();
							break;
			case '#sklep':	$(".all_content").hide();
							$("#oferta_2").show();
							break;
			case '#kreacja':$(".all_content").hide();
							$("#oferta_3").show();
							break;
			case '#copy': 	$(".all_content").hide();
							$("#oferta_4").show();
							break;
			case '#cms': 	$(".all_content").hide();
							$("#oferta_5").show();
		}

	});
	
	$(function() {
		$("a[title=lightbox]").lightBox();
	});
	function CreateXMLHttp () {

		if (typeof XMLHttpRequest != "undefined")
			return new XMLHttpRequest();
		else {
			if (window.ActiveXObject) {
				var Versions = ["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
				for (var i = 0;i<Versions.length;i++) {
					try {
						var XmlHttp = new ActiveXObject(Versions[i]);
						return XmlHttp;
					} catch (oError) {}
				}
			}
		}
		
		throw new Error ("Zmien przegladarke!");

	}
	
	function SendEmail () {

		var XMLHTTP = CreateXMLHttp ();
		XMLHTTP.open("POST","ajax/sendemail",true);
		XMLHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		XMLHTTP.onreadystatechange = function () {
			if (XMLHTTP.readyState == 4 && XMLHTTP.status == 200) {				
				document.getElementById('response').style.display = 'block';
				document.getElementById('response').innerHTML = XMLHTTP.responseText;
			}
		}

		XMLHTTP.send('name='+document.getElementById('name').value+'&email='+document.getElementById('email').value+'&phone='+document.getElementById('phone').value+'&topic='+document.getElementById('topic').value+'&body='+document.getElementById('body').value);
	}
	
	