var sec = 3000;
function showProductEn() {
	alert("Products coming soon!");
}
function showProductNo() {
	alert("Produkter kommer snart!");
}
function showProducer() {
	alert("Produsenter kommer snart!");
}
function showHide(id){
	hideAll();
	if (document.getElementById){
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
			obj.style.display = "";
		}
	}
	for(a = 0; a < companies.length; a++) {
		if (companies[a] == id) {
			currentCompanyId = a;
			a = companies.length;
		}
	}
	timer = setTimeout("rotateCompany()",sec);
}
function hideAll(){
	clearTimeout(timer);
	if (document.getElementById){
		$('#engelstad').hide();
		$('#bestcellars').hide();
		$('#stenbergblom').hide();
		$('#eurowine').hide();
		$('#multibev').hide();
		$('#cuveco').hide();
		$('#primewine').hide();
		$('#soleraoy').hide();
	}
}
var currentCompanyId = 0;
var companies = new Array(
				  "engelstad",
				  "bestcellars",
				  "stenbergblom",
				  "eurowine",
				  "multibev",
				  "cuveco",
				  "primewine",
				  "soleraoy"
				  );
var timer = null;
function rotateCompany() {
	var curr = document.getElementById(companies[currentCompanyId]);
	curr.style.display = "none";
	currentCompanyId = (currentCompanyId+1) % 8;
	var next = document.getElementById(companies[currentCompanyId]);
	next.style.display = "block";
	timer = setTimeout("rotateCompany()",sec);
}

function startCompanyRotation(){
	timer = setTimeout("rotateCompany()",sec);
}

function readLess(id){
	$('#readless_'+id).hide();
	$('#content_'+id).hide("fast", function() {
		$('#readmore_'+id).show();
		$('#ingress_'+id).show("fast");
	});
}

function readMore(id){
	$('#readmore_'+id).hide();
	$('#ingress_'+id).hide("fast", function() {
		$('#readless_'+id).show();
		$('#content_'+id).show("fast");
	});
}

function getxmlHttp() {
	var xmlHttp=null;
	try {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  } catch (e) {
	  // Internet Explorer
		try {
		 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
			  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
			 alert("Your browser does not support AJAX!");
			 return false;
			}
		}
	  }
	  
	  
	  return xmlHttp;
}	
