﻿function valizoek(boxname){  
  var ele = document.getElementById(boxname)
  if (ele) {
    if (ele.value == '') {
       alert('U moet een zoekterm invullen svp.')
       return false
    } 
  } 
} 


if (top.location != location) {
    top.location = document.location.href; 
 }
 
 
 function EndRequestHandler()
{
    addWkColumn();
}


function UpdateCheckBoxListMerk(CBL, values, length) {
    for (i = 0; i < length; i++) {
        var item = document.getElementById(CBL + '_' + i);
        if (item != null) {
            if (values.indexOf(';' + i + ';') >= 0) {
                item.checked = true
            } else {
                item.checked = false;
            }
        }
    }
}  
  
var olddiv = null;
var oldplayer = null;

      function addWkColumn(tblId, wkStart)
        {
            var tbl = document.getElementById(tblId);

	        var tblBodyObj = tbl.tBodies[0];
	        for (var i=0; i<tblBodyObj.rows.length; i++) 
	        {
		        // Month Header
		        if (i==0)
		        {
		            // Add extra colspan column
		            tblBodyObj.rows[i].cells[0].colSpan=8;
		        }
		        // Week Header
		        if (i==1)
		        {
		            // Add week column headline
		            var newCell = tblBodyObj.rows[i].insertCell(0);
		            newCell.innerHTML = 'Wk';
		            newCell.style.fontSize= '8pt';
		            newCell.style.fontWeight= 'bold';
		            newCell.style.verticalAlign= 'bottom';
		            newCell.style.backgroundColor = '#ffffff';
		        }	
		        	
		        // Normal row
		        if (i >= 2 )
		        {
		            // Add the weeknumbers
		            var newCell = tblBodyObj.rows[i].insertCell(0);
		            if (tblBodyObj.rows[i].cells[1].style.color != 'white' || tblBodyObj.rows[i].cells[2].style.color != 'white' || tblBodyObj.rows[i].cells[3].style.color != 'white' || tblBodyObj.rows[i].cells[4].style.color != 'white' || tblBodyObj.rows[i].cells[5].style.color != 'white' || tblBodyObj.rows[i].cells[6].style.color != 'white' || tblBodyObj.rows[i].cells[7].style.color != 'white'  )
		            {
		                newCell.innerHTML = wkStart;
		                wkStart += 1;
		            }
	                newCell.style.fontSize= '8pt';
	                newCell.style.backgroundColor = '#ffffee';
		        }
	        }
        }

function fnClickOK(sender, e) { 
    __doPostBack(sender,e); 
} 
 
function swapImage(afbeelding, src) {
    var hulp = document.getElementById(afbeelding);
    hulp.src = src;
}

function hover(what, classname) {
    var hulp=document.getElementById(what);
    hulp.className = classname;
}

function checkme(checkbox) {
var hulp = document.getElementsByName("radio1")
hulp[checkbox].checked = true;
}

var interval;

function setScrolling(div,direction) {
 interval = setInterval("scrolldiv('" + div + "','" + direction + "')", 1);
}

function stopScrolling() {
clearInterval(interval);
}

function scrolldiv(div, direction) {
 var hulp = document.getElementById(div);
// alert(hulp.scrollHeight);
    if (direction == 'up') {
        if (hulp.scrollTop < hulp.scrollHeight) {
            hulp.scrollTop += 4;
        }
    }
    if (direction == 'down') {
        if (hulp.scrollTop > 0) {
            hulp.scrollTop += -4;
        }
    }    
}



function LoadMeerImages() {

}

function loadinfo(ContentId, Soort) {
 ret = getinfo.getinfo(ContentId, Soort, OnCompleteDojo, OnTimeOutDojo, OnErrorDojo);
}

function showbanners() {

    var hulp = document.getElementById('banner4');
    if (hulp != null) {
        hulp.style.visibility = 'visible';
    }
    hulp = document.getElementById('banner3');
    if (hulp != null) {
        hulp.style.visibility = 'visible';
    }
}
function DoHover(div,on) {

  var hulp = document.getElementById(div);
    if (on == 1) {
        hulp.style.border = 'solid 1px silver';
    } 
    else {
         hulp.style.border = 'solid 1px white';
         hulp.style.borderBottom = 'solid 1px silver';
    }
    
}
function OnCompleteDojo(arg) {    
/*    var hulp = document.getElementById('banner4');
    if (hulp != null) {
        hulp.style.visibility = 'hidden';
    }
    hulp = document.getElementById('banner3');
    if (hulp != null) {
        hulp.style.visibility = 'hidden';
    }*/
    document.getElementById('Overlay').innerHTML=arg;
    window.scrollTo(0,0);
}
        
function OnTimeOutDojo(arg) {
}

function OnErrorDojo(arg) {
}

function liftprodimg(img,div, productimage, url) {
    var hulp1 = document.getElementById(img);
    var prodimg = document.getElementById(productimage);
    prodimg.src = url;
    hulp1.style.width = "38px";
    hulp1.style.height = "38px";
    hulp1.style.top = "2px";
    var hulp2 = document.getElementById(div);
    hulp2.className = "imgdivhover";
}

function downprodimg(img,div) {
    var hulp1 = document.getElementById(img);
    hulp1.style.width = "28px";
    hulp1.style.height = "28px";
    hulp1.style.top = "6px";
    var hulp2 = document.getElementById(div);
    hulp2.className = "imgdiv";
}

ActiveTab='';
ActiveLeft=''
ActiveRight='';

function changeclassname(left,right,content,action) {
  var tableft=document.getElementById(left);
  var tabright = document.getElementById(right);
  var tabcontent = document.getElementById(content);
  if (ActiveTab != content){
    if (action=='hover') {
       tableft.className='tablefthover';
       tabright.className='tabrighthover';
       tabcontent.className='tabcontenthover'
    }
    else {
       tableft.className='tableft';
       tabright.className='tabright';
       tabcontent.className='tabcontent'
    }
  } 
}

function ClickTab(Id,Content,Left,Right){
  if (ActiveTab != ''){
     document.getElementById(ActiveTab).className='tabcontent';
     document.getElementById(ActiveLeft).className='tableft';
     document.getElementById(ActiveRight).className='tabright';
  }   
  ActiveTab=Content;
  ActiveLeft=Left;
  ActiveRight=Right;
  LoadMenu(Id);
}

function updateDisplay(event) {
  var ele = document.getElementById("ctl00_xpos");
  if (ele) {
    document.getElementById("ctl00_xpos").value = event.clientX ;
    document.getElementById("ctl00_ypos").value = event.clientY;
  }
}

var foto=0
var div_old = ""
function hideall() {
  var hulp
  for (i=0; i<= Layers.length; i++) {
    hulp = document.getElementById(Layers[i]);
    if (hulp == "undefined") {
        hulp.style.display = "none";
    }
  }
}
function togglediv(Div, display) {
  if (div_old != "") {
    var hulp2 = document.getElementById(div_old);
    hulp2.style.display= "none";
  }
  div_old = Div
  hideall();
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
  if (display=="block"){
    location.hash = 'Bijkoop';
  }
}


function popFotoZoom(pic)
{
    mywin = window.open('/winkel/productinfo/zoom.aspx?foto='+ pic, 'mycal', 'width=550, height=570, left=25, top=25')
}

function myprint(artikel)
{
   mywin = window.open('/winkel/Productinfo/productinfo.aspx?Print=1&ProdId='+ artikel, 'Print', 'width=564, height=610, left=25, top=15')
}
function Pictogram(image)
{
    myWin = window.open('/Informatie/Pictogrammen/?image='+ image, 'pictogram', 'width=625, height=400, scrollbars=Yes, left=25, top=25')
}

var div_old = ""

function hideall() {
  var hulp
  for (i=0; i<= Layers.length; i++) {
    hulp = document.getElementById(Layers[i]);
    if (hulp == "undefined") {
        hulp.style.display = "none";
    }
  }
}

function showmovie(filename, div, Artikelnr, _strhost) {
        var result = "";
        var hoogte = 260;
        result = "<p id=\"player\"" + Artikelnr + "\"><a href=\"http://www.macromedia.com/go/getflashplayer\">Get the Flash Player</a> to see this movie2.</p>\n";
        result += "<script type=\"text/javascript\">\n";
        result += " var so = new SWFObject('" + _strhost + "/lib/swf/flvplayer.swf','Player" + Artikelnr + "','300','" + hoogte + "','8');\n";
        result += " so.addParam(\"allowfullscreen\",\"false\");\n";
        result += " so.addParam(\"showfsbutton\",\"false\");\n";
        result += " so.addVariable(\"file\",\"" + filename + "\");";
        //'If start Then result += " so.addParam(\"autostart\",\"true\");" + vbCrLf
        result += " so.addParam(\"showdownload\",\"false\");\n";
        result += " so.addVariable(\"enablejs\",\"true\");\n";
        result += " so.addVariable(\"javascriptid\",'mpl');\n";
        result += " so.addVariable(\"width\",\"300\");\n";
        result += " so.addVariable(\"height\",\"" + hoogte + "\");\n";
        result += " so.addVariable(\"displaywidth\",\"300\");\n"
        result += " so.addVariable(\"displayheight\",\"240\");\n"
        result += " so.addVariable(\"backcolor\",\"0xFFFFFF\");\n" 
        result += " so.addVariable(\"frontcolor\",\"0x40506E\");\n"
        result += " so.addVariable(\"lightcolor\",\"0x40506E\");\n"
        result += " so.write('player" + Artikelnr + "');\n"
        result += "</script>2"
   // '    alert(result);
        var hulp = document.getElementById(div);
        hulp.innerHTML = result;
}
function togglediv(Div, display) {
  if (div_old != "") {
    var hulp2 = document.getElementById(div_old);
    hulp2.style.display= "none";
  }
  div_old = Div
  hideall();
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
  if (display=="block"){
    location.hash = 'Bijkoop';
  }
}

function showdiv(Div, display) {
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
}

function showdivhideold(Div, display) {
  if (olddiv != null) {
    olddiv.style.display = 'none';
  }
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
  olddiv = hulp;
 if (oldplayer != null) {
     document.getElementById(oldplayer).sendEvent('STOP');  
  }
  oldplayer=null;
 
}

function showdivhideoldreset(Div, display, element) {
  if (olddiv != null) {
    olddiv.style.display = 'none';
  }
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
  olddiv = hulp;
  if (oldplayer != null) {
     document.getElementById(oldplayer).sendEvent('STOP');  
  }
  oldplayer=element;
  var playr=document.getElementById(element);
  if (playr !=null){
   try {
	   playr.sendEvent('PLAY',true);
   } catch(err) {}
  }
}


function showmore(Div, display) {
  var hulp = document.getElementById(Div);
  hulp.style.display= display;
  //location.href='#BijArt';
}


function toggleinfo(id,tal,txt,na) {
 document.getElementById(id+"_TabText1"+na).style.display = "none";
 document.getElementById(id+"_TabText2"+na).style.display = "none";
 document.getElementById(id+"_TabText3"+na).style.display = "none";
 document.getElementById(id+"_TabText4"+na).style.display = "none";
 document.getElementById(id+"_TabText5"+na).style.display = "none";
 document.getElementById(id+"_TabTextG"+na).style.display = "none";
 document.getElementById(id+"_TabTextPA"+na).style.display = "none";
 document.getElementById(id+"_TabTextP1"+na).style.display = "none";
 document.getElementById(id+"_TabTextP2"+na).style.display = "none";
 document.getElementById(id+"_TabTextP3"+na).style.display = "none";
 document.getElementById(id+"_TabTextP4"+na).style.display = "none";
 document.getElementById(id+"_TabKop1"+na).style.zIndex = 130;
 document.getElementById(id+"_TabKop2"+na).style.zIndex = 130;
 document.getElementById(id+"_TabKop3"+na).style.zIndex = 130;
 document.getElementById(id+"_TabKop4"+na).style.zIndex = 130;
 document.getElementById(id+"_TabKop5"+na).style.zIndex = 130;

 document.getElementById(id+"_TabText"+txt+na).style.display= "block";
 document.getElementById(id+"_TabKop"+tal+na).style.zIndex = 140;
}

function doprint()
{
   mywin = window.open('/informatie/cadeaubon.aspx?Print=1', 'Print', 'width=644, height=370, left=25, top=25')
}

function ClearOverlay() {
  document.getElementById('Overlay').innerHTML='';
  var hulp = document.getElementById("banner4");
  if (hulp != null) {
  hulp.style.visibility = "visible";
  }
  hulp = document.getElementById("banner3");
  if (hulp != null) {
  hulp.style.visibility = "visible";  
  }
}



