function msg(cmd,indx){
var textDiv = document.getElementById("prev");
var textDiv2 = document.getElementById("main");
	textDiv2.style.top=0;
	textDiv2.style.left=0;
	textDiv2.style.width=document.body.scrollWidth;
	textDiv2.style.height=document.body.scrollHeight;
	textDiv2.style.backgroundColor='#000000';
	textDiv.style.top=300;
	textDiv.style.left=0;
	textDiv.style.width=document.body.scrollWidth;
	textDiv.style.height=900;
	textDiv.style.display='inline';
	textDiv2.style.display='inline';
	exam(cmd,indx,textDiv);
    textDiv2.style.opacity = 50; 
    textDiv2.style.MozOpacity = 50; 
    textDiv2.style.KhtmlOpacity = 50; 
    textDiv2.style.filter = "alpha(opacity=50)";
	scroll(0,0);

	//shiftOpacity("main", 500);
}

function exam(cmd,indx,textDiv)
{
if (cmd==1)
{
	textDiv.innerHTML='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align="center" valign="center"><tr><td align="center" valign="top"><img src="images/'+indx+'" alt="click to close!"></td></tr></table>';
}
else if (cmd==2)
{
	textDiv.innerHTML='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align="center" valign="center"><tr><td align="center" valign="top"><img src="images/message1.gif" alt="click to close!"></td></tr></table>';
}
else if (cmd==3)
{
	textDiv.innerHTML='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align="center" valign="center"><tr><td align="center" valign="top"><img src="images/faqinfo.gif" alt="click to close!"></td></tr></table>';
}
}

function closeprev(){document.getElementById("prev").style.display='none';document.getElementById("main").style.display='none';}

function shiftOpacity(id, millisec) { 
    //if an element is invisible, make it visible, else make it ivisible 
    if(document.getElementById(id).style.opacity == 0) { 
        opacity(id, 0, 100, millisec); 
    } else { 
        opacity(id, 100, 0, millisec); 
    } 
} 

function opacity(id, opacStart, opacEnd, millisec) 
{ 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function change(id,amt)
{
var newAmount=document.getElementById("am_"+amt).value;
window.location = "basket.asp?id="+id+"&code=chg&amt="+newAmount;
}

function shopEval()
{
   if (document.form1.email.value.length == 0)
	{
		alert("Mandatory field missing; please enter a valid email address.");
		document.form1.email.focus();
		return false;
	}
   else if (document.form1.email.value.length < 6)
	{
		alert("Mandatory field missing; please enter a valid email address.");
		document.form1.email.select();
		return false;
	}
	
	else if (document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1)
	{
		alert("Mandatory field missing; please enter a valid email address.");
		document.form1.email.select();
		return false;
	}
   if (document.form1.fname.value.length == 0)
	{
		alert("Mandatory field missing; enter your first name.");
		document.form1.fname.focus();
		return false;
	}
   if (document.form1.lname.value.length == 0)
	{
		alert("Mandatory field missing; enter your sir name.");
		document.form1.lname.focus();
		return false;
	}
   if (document.form1.street.value.length == 0)
	{
		alert("Mandatory field missing; enter the delivery street address.");
		document.form1.street.focus();
		return false;
	}
   if (document.form1.zip.value.length < 5)
	{
		alert("Mandatory field missing; enter the delivery zip-code. (postnummer)");
		document.form1.zip.select();
		return false;
	}
   if (document.form1.city.value.length == 0)
	{
		alert("Mandatory field missing; enter delivery city.");
		document.form1.city.focus();
		return false;
	}
   if (document.form1.country.value.length == 0)
	{
		alert("Mandatory field missing; enter delivery country.");
		document.form1.country.focus();
		return false;
	}
	else
	{
	document.form1.submit();
	}
return true;
}
