function expandArticle(point){



		uls = point.parentNode.getElementsByTagName('ul');
		bs = point.getElementsByTagName('b');
		if(bs.length==0){
			if(uls[0]){
			uls[0].style.display='block';	
			
			}
			point.innerHTML = '<b>'+point.innerHTML+'</b>';
		}else{
			if(uls[0]){
				uls[0].style.display='none';
			}	
			str = point.innerHTML;
			str = str.replace('<b>','');
			str = str.replace('</b>','');
			str = str.replace('<B>','');
			str = str.replace('</B>','');
			
			
			point.innerHTML = str;
			
		}
		
	
		return;

		}	

var currentlyDisplayedInfo=false;

function showDiscount(point,mes){
	if(currentlyDisplayedInfo)currentlyDisplayedInfo.style.display='none';
	//if(currentlyDisplayedInfo)currentlyDisplayedInfo.style.border='1px red solid';
	el = document.createElement('span');
	currentlyDisplayedInfo=el;
	el.className='discountPopup';
	el.innerHTML=mes;
	point.appendChild(el);	
	currentlyDisplayedInfo=el;
}
function hideDiscount(point){
	if(currentlyDisplayedInfo)currentlyDisplayedInfo.style.display='none';
	return;
	//code below is not working-mesing up opera 
	po = point.getElementsByTagName('span');
	
	if(po[0]){
		po[0].style.display='none';
		point.removeChild(po[0]);
			
	}
	else alert('ds');
	
}

var isShown=new Array();
function togleContent(point,idName,beginState,showMessage,hideMessage){
	if(!isShown[idName]){
		if(beginState)isShown[idName]=2;
		else isShown[idName]=1;
	}
	
	el=document.getElementById(idName);
	
	if(isShown[idName]==2){
		el.style.display='none';
		if(showMessage)point.innerHTML=showMessage;
		else point.innerHTML='zobrazit';
		isShown[idName]=1;
	}else{
		el.style.display='block';
		if(hideMessage)point.innerHTML=hideMessage;
		else point.innerHTML='skryt';		
		isShown[idName]=2;
	}
		
}
/********** for parametric search *****************/

function refreshSearchArea(fromWhere){
	urlAdd='';
	searchstring=document.getElementById('searchInputVal').value;
	box=document.getElementById('paramSearchBox');
	
	document.getElementById('prodSearchCount').innerHTML='<img src="'+rootdir+'img/loader2.gif" /> na&#269;&iacute;t&aacute;m';
	
	urlAdd+='&searchstring='+searchstring;
	if(box){
		
		inputs = box.getElementsByTagName('input');
		
		for(i=0;i<inputs.length;i++){
			
			try{
					if(inputs[i].type=='checkbox'&&inputs[i].checked){
							urlAdd+='&'+inputs[i].name+'='+inputs[i].value;
							
					}
			 	}catch(e){
					alert(e);
				}
		}
		
		if(fromWhere&&fromWhere!=1)document.getElementById('typeBag').innerHTML='<img src="'+rootdir+'img/search-loader.gif" />'
		if(fromWhere&&fromWhere!=2)document.getElementById('sizeBag').innerHTML='<img src="'+rootdir+'img/search-loader.gif" />'
		if(fromWhere&&fromWhere!=3)document.getElementById('colorBag').innerHTML='<img src="'+rootdir+'img/search-loader.gif" />'
		if(fromWhere&&fromWhere!=4)document.getElementById('temaBag').innerHTML='<img src="'+rootdir+'img/search-loader.gif" />'		
		
            var url = rootdir+'inc/4ajax/param_search.php?from='+fromWhere+urlAdd;
            xmlHttp=GetXmlHttpObject(paramSearchStateChanged,true);
            xmlHttp.open("GET", url , true);
            xmlHttp.send(null);
            return false;				
	}	
}

function paramSearchStateChanged() 
        { 
                if (xmlHttp.readyState==2){ 

                } 
                  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                  res = xmlHttp.responseText;
				  splited = res.split('|||');
				  if(splited[0])document.getElementById('typeBag').innerHTML=splited[0];
				  if(splited[1])document.getElementById('sizeBag').innerHTML=splited[1];
				  if(splited[2])document.getElementById('colorBag').innerHTML=splited[2];
				  if(splited[3])document.getElementById('temaBag').innerHTML=splited[3];				  
				  if(splited[4])document.getElementById('prodSearchCount').innerHTML=splited[4];
				  document.getElementById('prodDisplay').innerHTML=splited[5];
				  document.getElementById('search_pages').innerHTML=splited[6];				  

				  

                } 
        }

function mooveSearchPage(pg){
	searchstring=document.getElementById('searchInputVal').value;
	box=document.getElementById('paramSearchBox');
	
	document.getElementById('prodSearchCount').innerHTML='<img src="'+rootdir+'img/loader2.gif" /> na&#269;&iacute;t&aacute;v&aacute;m';
	
	urlAdd+='&searchstring='+searchstring;
	if(box){
		
		inputs = box.getElementsByTagName('input');
		
		for(i=0;i<inputs.length;i++){
			
			try{
					if(inputs[i].type=='checkbox'&&inputs[i].checked){
							urlAdd+='&'+inputs[i].name+'='+inputs[i].value;
							
					}
			 	}catch(e){
					alert(e);
				}
		}
	}
            var url = rootdir+'inc/4ajax/param_search.php?moovepage=true&pg='+(pg-1)+urlAdd;
//            var url = rootdir+'inc/4ajax/param_search.php?from='+fromWhere+urlAdd;
            xmlHttp=GetXmlHttpObject(paramSearchStateChanged,true);
            xmlHttp.open("GET", url , true);
            xmlHttp.send(null);
            return false;				

	
}	

var blinkCount=0;
var showBlinking = false;
function blinkCompareDisplay(light){
	blinkCount++;
	el = document.getElementById('showCompare');
	
	if(!light)el.style.backgroundColor='#6d6d6d';
	else el.style.backgroundColor='';
	if(blinkCount<6)setTimeout("blinkCompareDisplay("+!light+")",500);
	else blinkCount=0;
	
}

function addToCompare(idPro,point,message){
	if(point&&message){
		point.firstChild.innerHTML = message;
	}
	showBlinking = true;
	alterCompare(idPro,true);


}

function removeCompareAdvanced(idPro,point){
	point.parentElement.parentElement.removeChild(point.parentElement);
	alterCompare(idPro,false);
}

function removeCompare(idPro){
	alterCompare(idPro,false);
}

function alterCompare(idPro,opt)
        {                              
            var url = rootdir+'inc/4ajax/compare.php?id='+idPro;
			if(opt)url+='&action=add';
			else url+='&action=remove';
            xmlHttp=GetXmlHttpObject(alterCompareStateChanged,true);
            xmlHttp.open("GET", url , true);
            xmlHttp.send(null);
            return false;
        } 
        
//function for change of state
function alterCompareStateChanged() 
        { 
                if (xmlHttp.readyState==2){ 
                  //document.getElementById('login_callarea').innerHTML='...moment'; 
                } 
                  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                  document.getElementById('showCompare').innerHTML=xmlHttp.responseText;
				  	if(showBlinking)blinkCompareDisplay();
					showBlinking = false;
                } 
        }

var formSending=false;
		
function sendForm(mes){
	try{

	 
		nomEl = document.getElementById('formName');
		mailEl = document.getElementById('formMail');
		messEl = document.getElementById('formMessage');
		

		
		nom=nomEl.value;
		mail=mailEl.value;
		mess=messEl.value;
		
	  if(nom==''||mail==''||mess==''){
	  	alert(mes);
		return false;
	  }
		loadEl = document.getElementById('formLoader');
		loadEl.style.display='block';
	  if(formSending){
          return false;
          alert('sdf');
    }
	  else formSending=true;
		
		nomEl.disabled=true;
		mailEl.disabled=true;
		messEl.disabled=true;
				
      nom=nom.replace(/&/g,'%26');
      nom=nom.replace(/\+/g,'%2B');
	  
      mail=mail.replace(/&/g,'%26');
      mail=mail.replace(/\+/g,'%2B');

      mess=mess.replace(/&/g,'%26');
      mess=mess.replace(/\+/g,'%2B');
	  
			
			var postData="name="+nom+"&mail="+mail+"&mess="+mess;
			
			//showLoading();
			
            var url = rootdir+'inc/flow/sendform.php';
            xmlHttp=GetXmlHttpObject(sendFormStateChanged);
			xmlHttp.open("POST", url , true);
			//Send the proper header information along with the request
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", postData.length);
			xmlHttp.setRequestHeader("Connection", "close");                                               
            xmlHttp.send(postData);
            return false;
					
	}catch(e){
		alert(e);
	}
	
}	




function sendFormStateChanged() 
        { 
                  if (xmlHttp.readyState==2){ 
                  //document.getElementById('lostPassSubmitText').value=calls['checking']+'...';
                  //document.getElementById('lostPassSubmitLogin').value=calls['checking']+'...';
                } 
                  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                  res = "odeslano"; 
					
					
		nomEl = document.getElementById('formName');
		mailEl = document.getElementById('formMail');
		messEl = document.getElementById('formMessage');
		
		
		nomEl.disabled=false;
		nomEl.value='';
		mailEl.disabled=false;
		mailEl.value='';
		messEl.disabled=false;
    messEl.value='';		
		formSending=false;
		
		
		loadEl = document.getElementById('formLoader');
		loadEl.style.display='none';
		alert(res);					
                } 
        }			
