

/*
 * FAQ - toggle
 * 
 */

var tmpFaq = "";
var tmpFaq_obj = "";
var tmpFaq_a = "";

function faq_toggle(_id){
	_tmpObj = document.getElementById(_id);
	_tmp_a = "";

	for(i=0; i<_tmpObj.childNodes.length; i++){
		x = _tmpObj.childNodes[i];
		if( x.tagName == "DIV" || x.tagName == "SPAN" ){
			if ( x.className == "a" ){
				_tmp_a = x;
			}
		}
	}
	
	if(tmpFaq != "" ){
		tmpFaq_a.style.display = "none";
		tmpFaq.className = "";
	}
	
	if (tmpFaq == _tmpObj){
		tmpFaq = "";
		tmpFaq_a = "";
	} else {
		tmpFaq = _tmpObj;
		tmpFaq_a = _tmp_a;
		tmpFaq.className = "active";
		tmpFaq_a.style.display = "block";
	}	
	tmpFaq.scrollIntoView();
	
	/*
	if(tmpFaq != "" ){
		tmpFaq.style.display = "none";
	}
	if (tmpFaq == document.getElementById(_id)){
		tmpFaq = "";
	} else {
		tmpFaq = document.getElementById(_id);
		tmpFaq.style.display = "block";
	}
	*/
}

/*
 * OFERTA - case
 *
 */

var tmp_obj = "";
var tmp_full = "";
var tmp_short = "";
var tmp_more = "";

function oferta_toggle(_id){
	//resetujemy klasę dla case'a
	tmp_obj.className = "case";
	_tmpObj = document.getElementById(_id);
	tmp_obj = _tmpObj;

		
	for(i=0; i<_tmpObj.childNodes.length; i++){
		x = _tmpObj.childNodes[i];
		//DIV
		if( x.tagName == "DIV" ){
			if ( x.className == "short" ){
				_tmp_short = x;
			} else if ( x.className == "full" ){
				_tmp_full = x;
			}
		}

		// more
		if( x.className == "more" ){
			_tmp_more = x;
		}
		
	}
	
	if( tmp_full !=  _tmp_full ){
		if( tmp_full !=  "" ){
			tmp_full.style.display = "none";
			tmp_short.style.display = "block";
			tmp_more.innerHTML = "więcej";
		}
		_tmp_full.style.display = "block";
		_tmp_short.style.display = "none";
		_tmp_more.innerHTML = "mniej";
		tmp_obj.className = "case case_active";
	
		tmp_full = _tmp_full;
		tmp_short = _tmp_short;
		tmp_more = _tmp_more;
	
	} else {
		_tmp_full.style.display = "none";
		_tmp_short.style.display = "block";
		_tmp_more.innerHTML = "więcej";
		tmp_full = "";
		tmp_short = "";
		tmp_more = "";
	}

	_tmp_more.blur();
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}


