function overColor(id){
	selected=document.getElementById(id);
	selected.style.color='#f4ae00';
}
function outColor(id){
	selected=document.getElementById(id);
	selected.style.color='Black';
}
function showSubMenu(id){
        //clearInterval(dropdown);
	toShow=document.getElementById('subMenu'+id);
	toShowHeight=toShow.offsetHeight;
	
	toShow.style.overflow='hidden';
	toShow.style.height='0px';
	toShow.style.display='block';
	for(i=0;i<=50;i+=1){
		dropdown=setInterval(function(){toShow.style.height=i+'px';clearInterval(dropdown);},10);
	}	
}
function hideSubMenu(id){
	toHide=document.getElementById('subMenu'+id);
	window['intervalID'+id]=setInterval(function(){toHide.style.display='none';clearInterval(window['intervalID'+id]);},700);
}
function cancelHide(id){
    if(typeof(window['intervalID'+id])!='undefined'){
        clearInterval(window['intervalID'+id]);
    }
    toCancel=document.getElementById('subMenu'+id);
}

//clearbox bezárásakor meghívódik az oldal újratöltése
function CB_ExternalFunctionCBClose(){
	window.location=window.location;
}

//ország megváltaztatásánál a megfelelo szállítási ár megjelenítése
function countryChanged(country){
	switch (country.toUpperCase()){
		case 'HU':
			document.getElementById('shippingEu').style.display='none';
			document.getElementById('shippingHu').style.display='inline';
			document.getElementById('shippingOt').style.display='none';
		break;
		case'AL': case'AD': case'AA': case'AT': case'AZ': case'BY': case'BE': case'BA': case'BG': case'HR': case'CY': case'CZ': case'DK': case'EE': case'FI': case'FR': case'GE': case'DE': case'GR': case'IS': case'IR': case'IL': case'IT': case'KZ': case'LV': case'LI': case'LT': case'LU': case'MK': case'MT': case'MD': case'MC': case'ME': case'NL': case'NO': case'PL': case'PT': case'RO': case'RU': case'SM': case'RS': case'SK': case'SI': case'ES': case'SE': case'CH': case'TR': case'UA': case'GB': case'VS':
			document.getElementById('shippingEu').style.display='inline';
			document.getElementById('shippingHu').style.display='none';
			document.getElementById('shippingOt').style.display='none';
		break;
		default:
			document.getElementById('shippingEu').style.display='none';
			document.getElementById('shippingHu').style.display='none';
			document.getElementById('shippingOt').style.display='inline';
		break;
	}
}

//nyelvváltásnál url eloállítása
function switchLanguage(lang){
	if(lang=='en'){
		otherLang='hu';
	}
	else{
		otherLang='en';
	}
	
	newloc=window.location.href;
	
	if(newloc.search('index.php')==-1){
		newloc=newloc+'index.php?lang='+lang;
	}
	else{
		if(newloc.search(/\?/)==-1){
			newloc=newloc+'?lang='+lang;
		}
		else{
			if(newloc.search('lang='+otherLang)==-1){
				if(newloc.search('lang='+lang)==-1){
					newloc=newloc+'&lang='+lang;
				}
				else{
					newloc;
				}	
			}
			else{
				newloc=newloc.replace('lang='+otherLang,'lang='+lang);
			}	
		}
	}
	return newloc;
}

//
//Internet Explorer verzió check
//
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion(){
  var ver = getInternetExplorerVersion();
  if ( ver > -1 ){
    if ( ver >= 7.0 ){
		return true;
	}
    else{
      newLoc = "index.php?site=browserDownload";
	  if(window.location.href.search('browserDownload')==-1){
	  	window.location=newLoc;
	  }
	  return false
	}
  }
  else{
  	return true;
  }
}