Site =
{
	$ :
	function( obj ) {
		if( document.getElementById( obj ) ) {
			return document.getElementById( obj );
		} else {
			return 0;
		}
	},
	
	init :
	function() {
		document.body.style.overflow = 'hidden';
		var iHeight = (document.all) ? document.body.offsetHeight : window.innerHeight;
		var iSum =  Site.getInnerHeight() - 84;
		Site.$( 'cont' ).style.height = iSum + 'px';
	},
	
	getInnerHeight:
	function () 
	{
		var myHeight = 0;

		if( typeof( window.innerWidth ) == 'number' ) 
		{
			myHeight = window.innerHeight;
		} 
		else if( document.documentElement && document.documentElement.clientHeight ) 
		{
			myHeight = document.documentElement.clientHeight;
		} 
		else if( document.body && document.body.clientHeight) 
		{
			myHeight = document.body.clientHeight;
		}

		return myHeight;
	},
	
	setSubmitType : 
	function( sPostAction ) {
		this.$( 'tekst_form' ).action = sPostAction+'/1';
	},
	
	vaidate :
	function() {
		var sRegExpString = /[^ ].*$/;
		var sRegExpMail = /^[0-9a-z]+([\.\-_][0-9a-z]+)*\@[0-9a-z]+([\.\-][0-9a-z]+)*\.([a-z]{2,4})/;

		
		if( !sRegExpString.test( this.$( 'Company' ).value ) )
		{
			alert( 'Wpisz nazwe firmy' );
			return 0;
		}

		if( !sRegExpString.test( this.$( 'Name1' ).value ) )
		{
			alert( 'Wpisz osobę kontaktową' );
			return 0;
		}
		
		if( !sRegExpMail.test( this.$( 'Email' ).value ) )
		{
			alert( 'Wpisz poprawny adres e-mail' );
			return 0;
		}
		
		if( !sRegExpString.test( this.$( 'Phone' ).value ) )
		{
			alert( 'Wpisz telefon' );
			return 0;
		}
		
		this.$( 'form1' ).submit();
	},
	
	setGfx : 
	function ( obj, img )
	{
		obj.src = img;
	},
	
	setPadding : 
	function ( objName, iPadding )
	{
		//this.$( 'poph' ).style.marginLeft = '16px';
	}
}

if ( window.addEventListener ) {
  window.addEventListener( 'resize', Site.init, false); 
} else if ( window.attachEvent ) {
  window.attachEvent( 'onresize', Site.init );
}

