﻿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) {
if (window.name == "iframeOnline") {
  top.location = document.location.href; 
}



function ShowFullProductDescription() {
    ctl00_Main_Product1_ShortDescription.style.display = "none";
    ctl00_Main_Product1_Beschrijving.style.display = "block";
    ctl00_Main_Product1_productbeschrijvingvolgende.style.display = "block";
    ctl00_Main_Product1_LinkButton5.style.display = "none";
}



function SetMinValue(sender, eventArgs) {
    var MinBox = document.getElementById("ctl00_Main_TextMin");
    MinBox.value = sender.get_value();

}

function SetMaxValue(sender, eventArgs) {
    var MaxBox = document.getElementById("ctl00_Main_TextMax");
    MaxBox.value = sender.get_value();
}
function submitform() {
    //document.forms[0].action = "";
     return true;
}
 
 function EndRequestHandler()
{
    addWkColumn();
}

function ShowActions(actie, link) {
    var elements = document.getElementsByTagName("div");
    for (i = 0; i < elements.length; i++) {
        if (elements[i].name == actie) {
            elements[i].style.display = "block";
        }
    }
    var hulp = document.getElementById(link);
    hulp.parentNode.parentNode.parentNode.style.display = "none";
}
  
var olddiv = null;
var oldplayer = null;

      function addWkColumn(tblId, wkStart)
        {
            var tbl = document.getElementById(tblId);

            var tblBodyObj = tbl.tBodies[0];
            var newCell = null;
	        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
		            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
		            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'  )
		            {
		                if (wkStart == 54) {
		                    wkStart = 1;
		                }
		                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 UpdateCheckBoxListMerk(CBL, values, length) {
    for (i = 0; i < length; i++) {
        var item = document.getElementById(CBL + '_' + i);
        if (values.indexOf(';' + i + ';') >= 0) {
            item.checked = true
        } else {
            item.checked = false;
        }
    }
}

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 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";
}

function HoverTab(Tab) {
    Tab.className = "ProductTabsActiveTab"
}

function show(div, Tab) {
    var hulp = document.getElementById(div);
    hulp.style.display = "block";
    var myTab = document.getElementById(Tab);
    ActiveProductTab = Tab;
 //   alert(ActiveProductTab.id);
    HoverTab(myTab)
    /* ctl00_Main_Product1_Menu1n1.childNodes[0].className = "ProductTabsActiveTab";
    ctl00_Main_Product1_Menu1n0.childNodes[0].className = "ProductTabsInactivetab";*/
}

function showallReviews(Datalist, HLink) {
    var dl3 = document.getElementById(Datalist);
    if (dl3) {
        dl3.style.display = "block";
    }
    var link = document.getElementById(HLink);
    if (link) {
        link.style.display = "none";
    }
}

function hide(div, Tab) {
    var hulp = document.getElementById(div);
    hulp.style.display = "none";
    var myTab = document.getElementById(Tab);
    UnHoverTab(myTab);
}

function ShowModalPopup(ModalPopup) {
    $find(ModalPopup).show();
}

function HideModalPopup(ModalPopup) {
    $find(ModalPopup).hide();
}

function UnHoverTab(Tab) {
    if (Tab) {
        if (Tab.id != ActiveProductTab) {
            Tab.className = "ProductTabsInactivetab"
        }
    }
}

var ActiveProductTab = "ctl00_Main_Product1_tabBeschrijving";

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('http://www.modern.nl/winkel/Productinfo/productinfo.aspx?Print=1&ProdId='+ artikel, 'Print', 'width=564, height=610, left=25, top=15')
}
function Pictogram(image)
{
    myWin = window.open('http://www.modern.nl/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";  
  }
}


 var VergelijkArr = [];

function LoadCheck()
{
   VergelijkArr = [];
   var frm = document.aspnetForm;
   var el = frm.elements;
   for(i=0;i<el.length;i++) {
    if(el[i].type == "checkbox" ) {
     if ( (el[i].checked) && (el[i].getAttribute('ArtNr') != null) ) {
        VergelijkArr[VergelijkArr.length]= el[i].getAttribute('ArtNr');
     }
    }
  }
}

          

function VergelijkCheck(box,waarde)
{
 LoadCheck();
 if (VergelijkArr.length>3) 
 {
    alert('U kunt maximaal 3 producten vergelijken');
    document.getElementById(box).checked= false;
 }
}


function DoVergelijk() {
  LoadCheck();
  if (VergelijkArr.length>1) {
        ret = VergelijkSrv.Switch(VergelijkArr, OnCompleteDojo, OnTimeOutDojo, OnErrorDojo);
  }
    else
  {
    alert('U moet minimaal 2 producten aanvinken om te vergelijken');
  }
}



function Click(RadioID, Link) {
    document.getElementById(RadioID).checked = true;
    label = document.getElementById('ctl00_Main_Label5');
    attr = document.getElementById(Link).getAttribute('extra');
    if (attr != '')
    { label.innerHTML = attr }
}
function checkme2(box) {
    Radios = ['ctl00_Main_RadioPin', 'ctl00_Main_RadioContant', 'ctl00_Main_HyperLinkPin', 'ctl00_Main_RadioCredit', 'ctl00_Main_RadioModern',
     'ctl00_Main_RadioAbn', 'ctl00_Main_RadioPostbank', 'ctl00_Main_RadioRabo', 'ctl00_Main_RadioSns', 'ctl00_Main_RadioFortis',
     'ctl00_Main_RadioVisa', 'ctl00_Main_RadioMaster', 'ctl00_Main_RadioAmerican', 'ctl00_Main_ctl01_Radio10plan', 'ctl00_Main_ctl03_RadioZomer',
     'ctl00_Main_ctl03_RadioUitstel3', 'ctl00_Main_ctl03_RadioUitstel6', 'ctl00_Main_ctl03_RadioUitstel18', 'ctl00_Main_ctl05_RadioTermijnen12',
     'ctl00_Main_ctl05_RadioTermijnen24', 'ctl00_Main_RadioTermijnen36', 'ctl00_Main_ctl07_RadioVast'];
    for (i = 0; i < Radios.length; i++) {
        if (document.getElementById(Radios[i]) != null) {
            document.getElementById(Radios[i]).checked = false;
        }
    }
    //if (document.getElementById('ctl00_Main_ctl03_RadioUitstel12') != null){
    // document.getElementById('ctl00_Main_ctl03_RadioUitstel12').checked=false};
    checkme(box);
}