
var $j = jQuery.noConflict();

$j(document).ready(function()
{
  var width;
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  //width = document.body.offsetWidth;
 }
else
{
  //width = window.innerWidth;
  }

  SetBodyMidDivHeight();
  SetFlowerWavePosition();
  //SetContentWrapperPosition();
  
  SearchTextBoxFocusLostFocus();
  
  $j(window).resize(function() {
      SetContentWrapperPosition();
});
_typeface_js.renderDocument()
});


 function  SearchTextBoxFocusLostFocus()
    {
      
       $j(".search-mid-input").focus(function(){
    // Check for the change
    if(this.value == "zoeken..."){
        this.value = '';
    }
       });
    
               $j(".search-mid-input").focusout(function(){
    // Check for the change
    if(this.value ==''){
         this.value = "zoeken...";
       }
           });
    }


function getInternetExplorerVersion() {

    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer') {

        var ua = navigator.userAgent;

        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

        if (re.exec(ua) != null)

            rv = parseFloat(RegExp.$1);

    }

    return rv;

}

function SetBodyMidDivHeight()
{
  if($j('.content-wrapper-container').height()+170 > 675)
  {
  var h = $j('.content-wrapper-container').height() - 450 ;//(675-110 + 70);
  $j('.middle-container').css('height',h + 'px');
  }
}

function SetFlowerWavePosition()
{
    var waveTop = $j('.body-footer-container').position().top-455;
    $j('.wave-fan-container').css('top',waveTop);

}

function SetContentWrapperPosition()
{
  var contentLeft = $j('.logo-container').position().left;
  //$j('.content-wrapper').css('left',contentLeft);
  //$j('.content-wrapper').css('margin-left',contentLeft);
   // if ($j('#ContentPlaceHolderDefault_body_HeaderControl1_txtItemNo') != null) {
    //  $j('#ContentPlaceHolderDefault_body_HeaderControl1_txtItemNo').css('left', $j('.cart-container').position().left + 32);
  //}
}

var Cookies = {
    // Initialize by splitting the array of Cookies
    init: function () {
        var allCookies = document.cookie.split('; ');
        for (var i = 0; i < allCookies.length; i++) {
            var cookiePair = allCookies[i].split('=');
            this[cookiePair[0]] = cookiePair[1];
        }
    },
    // Create Function: Pass name of cookie, value, and days to expire
    create: function (name, value, days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            var expires = "; expires=" + date.toGMTString();
        }
        else var expires = "";
        document.cookie = name + "=" + value + expires + "; path=/";
        this[name] = value;
    },
    // Erase cookie by name
    erase: function (name) {
        this.create(name, '', -1);
        this[name] = undefined;
    }
};
Cookies.init();
