jQuery(document).ready(function() {

jQuery("a.fancybox").fancybox({
				'opacity'		: true,
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'none'
			});
			
fontsize()
});



//zmiana czcionek
//***************
 function fontsize() {
   var start=document.cookie.indexOf('fontsize'+"=");
   if(start==-1){
   return null;
   }
   else{
   var len=start+name.length;

   var cook=document.cookie.substring(len);
    fontresize(cook.charAt(9));
   }
}
 function fontresize(size) {
 var idresize = document.getElementById("main");
 if(!idresize)return ;
		if(size==1)
		{
		idresize.style.fontSize='1.25em';
 		document.cookie="fontsize=1 ; path=/";
		}
		else if (size==0){
		idresize.style.fontSize='1em';
		document.cookie="fontsize=0; path=/"
		}
}


//walidacja_rejestracji
//***************
function validate_form(thisform){
  var add  = true;
  with (thisform){
  
  if(thisform.author){
	 if(author.value==null || author.value==""){
      document.getElementById('author').className='text error';
      add  = false;
    } else{ 
		document.getElementById('author').className='text';
		}
	}	
	if(thisform.email){	
		if (email.value==null || email.value==""){ 
		  document.getElementById('email').className='text error';
		  add  = false;
			}else{
		  document.getElementById('email').className='text';
			}

    a_pozycja = email.value.indexOf("@");
    dot_pozycja = email.value.lastIndexOf(".");
    if (a_pozycja<1 || dot_pozycja-a_pozycja<2){ 
			document.getElementById('email').className='text error';
			add = false; 
		}else{ document.getElementById('email').className='text'; 
		}
 	}	
	if(document.getElementById('comment').value=="")
	{
	 document.getElementById('comment').className='error';
	 add  = false;
	}
	else
	{ 
	  document.getElementById('comment').className=''; 
	}
  }
  return add ;
}


function swfObj(src,name,width,height,bgcolor)
{
	var swfObject = ""+
		"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+width+"\" height=\""+height+"\"  align=\"middle\">\n"+
			"<param name=\"movie\" value=\""+src+"\"  />\n"+
			"<param name=\"quality\" value=\"high\" />\n"+
			"<param name=\"bgcolor\" value=\""+bgcolor+"\" />\n"+
			"<param name=\"wmode\" value=\"transparent\">"+

			"<embed   src=\""+src+"\" quality=\"high\" bgcolor=\""+bgcolor+"\" width=\""+width+"\" height=\""+height+"\" name=\""+name+"\" wmode=\"transparent\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n"+
		"</object>\n"+
		"";
	document.write(swfObject);
}





function new_freecap_1()
{
// loads new freeCap image
 if(document.getElementById)
 {
 // extract image name from image source (i.e. cut off ?randomness)
 thesrc = document.getElementById("freecap_1").src;
 // add ?(random) to prevent browser/isp caching
 document.getElementById("freecap_1").src = thesrc+"?"+Math.round(Math.random()*100000);
 } else {
 alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
 }
}



