// JavaScript For Butik.it By Tommy Ingberg, tommy@butik.it
function changeProdPic(picname){
	
document.getElementById("productHeaderImage_n").style.backgroundImage = 'url(http://img.specifikation.se/mediumlarge/'+picname+')';
}
function submitcheckoutform()
{
  document.checkoutForm.submit();
}
function erroralert()
{
	alert('Du måste välja ett leveransalternativ först!');
}
function changeShoppingCartheight(){
	e=document.getElementById("shoppingCartMain");
	if (e.style.height=='auto'){
		e.style.height = 27+'px';		
	} else{
		e.style.height = 'auto';
	}
}

function ShowMenuGroup(Id){
	e=document.getElementById(Id);
	if (e.style.height=='auto'){
		e.style.height = '0px';		
	} else{
		e.style.height = 'auto';
	}
}
function checkAllInputs(formType){
if (formType=='regCompany'){	
	checkInput('password');
	checkInput('email');
	checkInput('company');
	checkInput('l_name');
	checkInput('f_name');
	checkInput('phone');
	checkInput('deReceiver');
	checkInput('deAddress');
	checkInput('dePostalcode');
	checkInput('deCity');
	checkInput('inReceiver');
	checkInput('inAddress');
	checkInput('inPostalcode');
	checkInput('inCity');	
}
if (formType=='regPrivate'){	
	checkInput('password');
	checkInput('email');
	checkInput('l_name');
	checkInput('f_name');
	checkInput('phone');
	checkInput('deReceiver');
	checkInput('deAddress');
	checkInput('dePostalcode');
	checkInput('deCity');
	checkInput('inReceiver');
	checkInput('inAddress');
	checkInput('inPostalcode');
	checkInput('inCity');	
}
if (formType=='returns'){	
	checkInput('Kontaktperson');
	checkInput('Mail');
	checkInput('Telefon');
	checkInput('Mottagare');
	checkInput('Gatuadress');
	checkInput('Postnummer');
	checkInput('Postort');
	checkInput('Ordernummer');
	checkInput('Artikelnummer');
	checkInput('Serienummer');
	checkInput('Felbeskrivning');
}
	
}
function checkInput(Id){
	e=document.getElementById(Id);
	ee=document.getElementById(Id+'i');	
	if (e.value.length < 3) {
		ee.style.backgroundImage ='url(/template/images/icons/red_star.png)';		
	} else{
		ee.style.backgroundImage ='url(/template/images/icons/green_checkmark.png)';	
	}
}
function changeDeState(Id){
	e=document.getElementById(Id);
	deDiv=document.getElementById('deliveryAddress');	
	if (e.checked == true) {
				document.registerCustomerForm.deReceiver.disabled=true;	
				document.registerCustomerForm.deAtt.disabled=true;	
				document.registerCustomerForm.deAddress.disabled=true;		
				document.registerCustomerForm.deAddressSec.disabled=true;	
				document.registerCustomerForm.dePostalcode.disabled=true;	
				document.registerCustomerForm.deCity.disabled=true;	
				deDiv.style.height='75px';
				deDiv.style.overflow='hidden';				
	} else{
				document.registerCustomerForm.deReceiver.disabled=false;	
				document.registerCustomerForm.deAtt.disabled=false;	
				document.registerCustomerForm.deAddress.disabled=false;		
				document.registerCustomerForm.deAddressSec.disabled=false;	
				document.registerCustomerForm.dePostalcode.disabled=false;	
				document.registerCustomerForm.deCity.disabled=false;	
				deDiv.style.height='auto';	
				deDiv.style.overflow='visible';					
	}
}
function expandMenu(FirstId,SecondId,ThirdId){
	if (!(FirstId<2)){
		c=document.getElementById(FirstId);
		c.style.height = 'auto';
	}
	if (!(SecondId<2)){
		f=document.getElementById(SecondId);
		f.style.height = 'auto';
	}
	if (!(ThirdId<2)){
		g=document.getElementById(ThirdId);
		g.style.height = 'auto';
	}
}