	

	function pokaz(l)
	{		
		schowaj();
		document.getElementById(l).style.display='';
	}
		
	function schowaj()
	{		
		document.getElementById('l1').style.display='none';
		document.getElementById('l2').style.display='none';
		document.getElementById('l3').style.display='none';
	}
	function initFcn(){		
		var oObj = document.getElementById('sezonowa_wymiana');
		
		if(oObj!=null){ initLayer('sezonowa_wymiana','sezonowa_wymiana')} 
	}
	
	initLayer = function(cookieName,id){
		var sCookie = getCookie(cookieName);
		
		if(sCookie == 1){
			var oObj = document.getElementById('sezonowa_wymiana');
				showLayer(id,'block','sezonowa_wymiana');
		}
	}
	
 function showLayer(id,disp,cookie){
		var oElem = document.getElementById(id);	
	
		if(oElem==null) 
			return false;
	
		if(disp==null){
			if(oElem.style.display=='block'){
				disp = 'none';
				if(cookie){ setCookie(cookie,0); }
			}else {
				disp = 'block';
				if(cookie){ setCookie(cookie,1); }
			}
		}	
		
		oElem.style.display = disp;
		return false;
	}
				
	function switchLayer(ob){
		var aZest = new Array('cont_one','cont_two','cont_three');
		var oElem = document.getElementById(ob.id+'_show');
					
		if(oElem == null){ return false; }
	
		var len = aZest.length;
		for(i = 0; i < len; i++){
			document.getElementById(aZest[i]+'_show').style.display = 'none';
			RemoveClassName(document.getElementById(aZest[i]),'active');
			
			var sSrc =  document.getElementById(aZest[i]).getElementsByTagName('img')[0].src;
			var sPath = sSrc.substring(0, sSrc.lastIndexOf('/')+1);
			var sFileName = sSrc.substring(sSrc.lastIndexOf('/')+1, sSrc.length);
			sFileName = sFileName.replace("_active", "");
			document.getElementById(aZest[i]).getElementsByTagName('img')[0].src = sPath+sFileName;			
		}
		
		AddClassName(document.getElementById(ob.id),'active');
		var sSrc = document.getElementById(ob.id).getElementsByTagName('img')[0].src;
		document.getElementById(ob.id).getElementsByTagName('img')[0].src = sSrc.replace(".jpg", "_active.jpg");

		oElem.style.display = 'block';		
	}
				
/**
 * Ciasteczka
 */
clearCookie = function() {
	var now = new Date();
	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
	this.setCookie('co'+this.obj, 'cookieValue', yesterday);
	this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
};

setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
	document.cookie =
		escape(cookieName) + '=' + escape(cookieValue)
		+ (expires ? '; expires=' + expires.toGMTString() : '')
		+ (path ? '; path=' + path : '')
		+ (domain ? '; domain=' + domain : '')
		+ (secure ? '; secure' : '');
};

// [Cookie] Gets a value from a cookie
getCookie = function(cookieName) {
	var cookieValue = '';
	var posName = document.cookie.indexOf(escape(cookieName) + '=');
	if (posName != -1) {
		var posValue = posName + (escape(cookieName) + '=').length;
		var endPos = document.cookie.indexOf(';', posValue);
		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
		else cookieValue = unescape(document.cookie.substring(posValue));
	}
	return (cookieValue);
};	

// ----------------------------------------------------------------------------
// AddClassName
//
// Description : adds a class to the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function AddClassName(objElement, strClass, blnMayAlreadyExist)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // if the new class name may already exist in list
      if ( blnMayAlreadyExist )
         {

         // get uppercase class for comparison purposes
         var strClassUpper = strClass.toUpperCase();

         // find all instances and remove them
         for ( var i = 0; i < arrList.length; i++ )
            {

            // if class found
            if ( arrList[i].toUpperCase() == strClassUpper )
               {

               // remove array item
               arrList.splice(i, 1);

               // decrement loop counter as we have adjusted the array's contents
               i--;

               }

            }

         }

      // add the new class to end of list
      arrList[arrList.length] = strClass;

      // add the new class to beginning of list
      //arrList.splice(0, 0, strClass);
      
      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   else
      {

      // assign modified class name attribute      
      objElement.className = strClass;
   
      }

   }
// 
// AddClassName
// ----------------------------------------------------------------------------


// ----------------------------------------------------------------------------
// RemoveClassName
//
// Description : removes a class from the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to remove
//
function RemoveClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // remove array item
            arrList.splice(i, 1);

            // decrement loop counter as we have adjusted the array's contents
            i--;

            }

         }

      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   // there is nothing to remove

   }
   function HasClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // we found it
            return true;

            }

         }

      }

   // if we got here then the class name is not there
   return false;

   }
