

function validering_email()
{
if (document.nyhedsbrev_tilmeld.email.value=='')
{
    alert ("Der skal stå en e-mail adresse i tekst feltet");
 document.nyhedsbrev_tilmeld.email.focus();
return false;
}
 var t = "\\wáàãââæåçéèêëìíîïñòóôõöøùúûüýÿ";
var regexp = new RegExp("^["+t+"]["+t+"\\.\\-\\+]*@["+t+"]["+t+"\\.\\-]*\\.["+t+"]{2}["+t+"\\.\\-\\/]*$","i");
tekst=document.nyhedsbrev_tilmeld.email.value.toLowerCase();
if (!regexp.test(tekst)){
        alert ("Der er ulovlige tegn i e-mail adressen");
  document.nyhedsbrev_tilmeld.email.focus();
  return false;
 }


        else { return true; }
    }

function CheckNumber(vare_antal_1,msgbox)
{
var x =vare_antal_1.value
var anum=/(^\d+$)|(^\-\d+$)/
var msgbox = msgbox
if (x == ''){
alert("Husk at angive antal !");

}
else{ 
if (anum.test(x)){
   var message2 = document.getElementById(msgbox);
     message2.style.color = '#CC0000';
     message2.style.size = '1';
     message2.innerHTML = '<font color="#99CC33" size="1">Dit køb er tilføjet <a href="#" onClick="javascript:menu_side_2(\'id=&id2=2\');"><font color="#99CC33" size="1"> <b>INDKØBSKURVEN</b></font></a> </font>';
// alert("Indtast venligst et heltal 2 front sprog " + msgbox);
// show_buy(msgbox);

}
else{
alert("Indtast venligst et heltal");
vare_antal_1.focus()

}

} 
}

function CheckNumber3(vare_antal_1)
{
var x =vare_antal_1.value
var anum=/(^\d+$)|(^\-\d+$)/
if (x == ''){
alert("Husk at angive antal \n\r \n\rØnsker du at SLETTE købet angiv 0 i antal");
}
else
if (!anum.test(x)){
alert("Indtast venligst et heltal !");
}
}
Count = 0

function checkCheckBoxes(hvad) {

  if (Count>=1){
  return true
  }else{
  alert('<%=sp_val_betalingsform%>')
  return false
  }
}

Count2 = 0

function checkCheckBoxes2(hvad) {

  if (Count2>=1) {
  return true
  }else{
  alert('Du skal godkende handelsbetingelserne !')
  return false
  }
}


function IsDataValid()
    {
  if (document.form1.vare_antal_1.value=='') 
        {
            alert("Du skal indtastet antal.");
            document.form1.vare_antal_1.focus();
            return false;
        }

if (!document.form1.vare_antal_1.value.match(/^\d+(\\d{1})?$/)){
    alert('Det indtastede skal være tal');
    document.form1.vare_antal_1.focus();
    return false;
  }
        else { return true; }

    }

function IsDataValid2()
    {


if (document.form_oplysninger.kunde_navn_1.value=='')
{
 alert(document.form_oplysninger.val_navn.value);
 document.form_oplysninger.kunde_navn_1.focus();
return false;
}
if (document.form_oplysninger.kunde_adresse_1.value=='')
{
 alert(document.form_oplysninger.val_adresse.value);
 document.form_oplysninger.kunde_adresse_1.focus();
return false;
}
if (document.form_oplysninger.kunde_postnr_1.value=='')
{
 alert(document.form_oplysninger.val_postnr.value);
 document.form_oplysninger.kunde_postnr_1.focus();
return false;
}


if (document.form_oplysninger.kunde_bue_1.value=='')
{
 alert(document.form_oplysninger.val_bue.value);
 document.form_oplysninger.kunde_bue_1.focus();
return false;
}
if (document.form_oplysninger.kunde_tlf_1.value=='')
{
 alert(document.form_oplysninger.val_bue.value);
 document.form_oplysninger.kunde_tlf_1.focus();
return false;
}

if (document.form_oplysninger.kunde_land_1.value=='')
{
 alert("<%=sp_val_land%>");
 document.form_oplysninger.kunde_land_1.focus();
return false;
}

if (document.form_oplysninger.kunde_email_1.value=='')
{
 alert(document.form_oplysninger.val_email.value);
 document.form_oplysninger.kunde_email_1.focus();
return false;
}
 var t = "\\wáàãââæåçéèêëìíîïñòóôõöøùúûüýÿ";
var regexp = new RegExp("^["+t+"]["+t+"\\.\\-\\+]*@["+t+"]["+t+"\\.\\-]*\\.["+t+"]{2}["+t+"\\.\\-\\/]*$","i");
tekst=document.form_oplysninger.kunde_email_1.value.toLowerCase();
if (!regexp.test(tekst)){
 alert (document.form_oplysninger.val_email.value);
  document.form_oplysninger.kunde_email_1.focus();
  return false;
 }
 
// if(!document.betingelser.checked)  
 //  {		
//     alert('Du skal godkende handelsbetingelserne !');
//   }

        else { return true; }
    }

ContentInfo = "";

topColor = "#ffffff"
subColor = "#ffffff"
var mouse_X;
var mouse_Y;
var tip_active = 0;

function update_tip_pos(){

		document.getElementById('ToolTip').style.left = mouse_X - 75;
		document.getElementById('ToolTip').style.top  = mouse_Y +25;
}

var ie = document.all?true:false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e) {
if (ie) { // grab the x-y pos.s if browser is IE
mouse_X = event.clientX + document.body.scrollLeft;
mouse_Y = event.clientY + document.body.scrollTop;
}
else { // grab the x-y pos.s if browser is NS
mouse_X = e.pageX;
mouse_Y = e.pageY;
}
if (mouse_X < 0){mouse_X = 0;}
if (mouse_Y < 0){mouse_Y = 0;}

if(tip_active){update_tip_pos();}
}

function EnterContent(TTitle, TContent){

ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+
'<table border="0" width="100%" cellspacing="1" cellpadding="3">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+
'<table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltiptitle">'+TTitle+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';

}

function tip_it(which, TTitle, TContent){
	if(which){
		update_tip_pos();
		tip_active = 1;
		document.getElementById('ToolTip').style.visibility = "visible";
		EnterContent(TTitle, TContent);
		document.getElementById('ToolTip').innerHTML = ContentInfo;
	}else{
		tip_active = 0;
		document.getElementById('ToolTip').style.visibility = "hidden";
	}
}
