
function popitup(url) {
	newwindow=window.open(url,'name','height=550,width=550');
	return false;
}

function bookmark() {
  var sUrl = "http://www.hoogspoor.nl";
  var sTitle= "Hoogspoor";
  if (window.sidebar) { window.sidebar.addPanel(sTitle, sUrl,""); }
  else if(window.external) { window.external.AddFavorite(sUrl, sTitle);}
  else { alert( "Gebruik de CTRL- en D toets tegelijkertijd om deze pagina te bookmarken"); return true; }}
 
function fSearch( ) {
 var sSearch=document.frmZoek.dfsSearch.value;
 if ( !sSearch ) { alert( "Voer het zoekveld in!" ); return false; }
 this.location="/ScriptsW/ttglue.exe?TTBasisProd+frmDeplProdMakeOvzPage+&dfsHTMLFile=hdl/H_ProdOverDynamic.htm&dfsSearch="+ sSearch; }
 
function fShopCartHeight( ) {
 var nHeight = 0;
 nHeight = document.getElementById("CartContents").contentWindow.document.body.scrollHeight;
 if ( nHeight < 50) nHeight = 50;
 document.getElementById("CartContents").style.height= nHeight + "px"; }
 
function fSetCookie ( lpsName, lpsValue ) {
 var sCookie = "";
 lpsValue = "@" + lpsValue + ",";
 var saResult = document.cookie.match ( '(^|;) ?' + lpsName + '=([^;]*)(;|$)' );
 if ( saResult ) sCookie = unescape ( saResult[2] );
 var nIdx = sCookie.indexOf( lpsValue );
 if ( nIdx == 0 ) { return true; }
 if ( nIdx > 0 ) {sCookie = sCookie.replace(RegExp(lpsValue), ""); }
 sCookie = lpsValue + sCookie;
 var saCookie = sCookie.split( "," );
 sCookie = "";
 for (var i = 0; i < 6; i++) {
  if ( saCookie[ i ] ) sCookie += saCookie[ i ] + ","; }
 document.cookie = lpsName + "=" + sCookie + "; expires=Mon, 01-Jan-2091 00:00:00 GMT; path=/;";
 return true; }

function submitAanbieding( sCode ) {
  window.open('http://scripts.webedit.nl/scripts/ttglue.exe?BasisApps+frmReserveer+&dfsMailTo=info@hoogspoor.nl&dfsSubject=Reservering Artikel&dfsProdCode=' + sCode + '&dfnSiteID=207&dfsShowPG=','viewWindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=380,height=575');
}

function changeimage(ImageID, Image) {
  if (document.images) {
    document.images[ImageID].src=Image; }
}

function bestelProd( sCode ) {
  var sHost = "";
  sHost=location.hostname.toLowerCase( );
  if (sHost.indexOf( "partner.webedit.nl") != -1 || sHost.indexOf( "klant.webedit.nl") != -1 || sHost.indexOf( "localhost") != -1 || ownscriptdir==1) { sHost=""; }
  else { sHost = ""; }
  window.open( sHost  + "/ScriptsW/ttglue.exe?BasisApps+frmDelpAddToCart+&dfsProdCode=" + sCode + "&dfnSiteID=207", "viewWindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=600,height=700"); 
}
  
function ShopCart(){
  var sHost = "";
  sHost=location.hostname.toLowerCase( );
  if (sHost.indexOf( "partner.webedit.nl") != -1 || sHost.indexOf( "klant.webedit.nl") != -1 || sHost.indexOf( "localhost") != -1 || ownscriptdir==1) { sHost=""; }
  else { sHost = ""; }
  window.open( sHost  + "/ScriptsW/ttglue.exe?BasisApps+frmShopOrder+&dfnSiteID=207","viewWindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=600,height=800");
}

function showhide(szDivID, iState) {
  var obj = document.getElementById(szDivID);
  if ( obj ) obj.style.display = (iState ? "inline" : "none");
}

function showDIV(nPicture) {
  showhide( 'divImage0', (nPicture == 0)?1:0 );
  showhide( 'divImage1', (nPicture == 1)?1:0 );
  showhide( 'divImage2', (nPicture == 2)?1:0 );
  showhide( 'divImage3', (nPicture == 3)?1:0 );
  showhide( 'divImage4', (nPicture == 4)?1:0 );
}

function changeimage(ImageID, Image) {
   if (document.images) { document.images[ImageID].src=Image; }
}

function showImage( nNewImage ) {  
  obj = document.getElementById("imgSpan").firstChild;
  obj.src = nNewImage ;
}

