﻿
function addToCart(productId, productVariantId, qty)
{
    var panelcart = document.getElementById('ctl00_PanelLeft1_leftBrowse');
    var panelbrowse = document.getElementById('ctl00_PanelLeft1_listPrints');
        panelcart.style.display = "block";
    panelbrowse.style.display = "none";
    
    MettleSystems.dashCommerce.Web.WebServices.cartUtils.AddItem(productId, productVariantId, qty);
    
    ReadyToGo();
}

function checkItemCount(result)
{
    if (result == 0)
        document.location.reload(true);
}

function bringSrcToImg(imgid, src)
{
    var myimg = document.getElementById(imgid);
    myimg.setAttribute('src', src);
}
function copyInputText(copy, paste)
{
    var first = document.getElementById(copy);
    var second = document.getElementById(paste);
    second.value = first.value;
}
function copySelectText(copy, paste)
{
    var first = document.getElementById(copy);
    var second = document.getElementById(paste);
    var myvar = first.value;
   
   for(var i=first.options.length-1;i>=0;i--)
   {
        if(first.options[i].value == myvar)
        {
            second.options[i].selected = true;    
        }   
   }
}

function chkBackgroundFields()
{
    if(document.getElementById('ctl00_Newslettersignup1_txtNLName') != null)
    {
        if(document.getElementById('ctl00_Newslettersignup1_txtNLName').value != "")
        {
            var field = document.getElementById('ctl00_Newslettersignup1_txtNLName');
            clickclearImg(field, 'bckrnull');
        }
    }
    if(document.getElementById('ctl00_Newslettersignup1_txtNLEmail') != null)
    {
        if(document.getElementById('ctl00_Newslettersignup1_txtNLEmail').value != "")
        {
            var field = document.getElementById('ctl00_Newslettersignup1_txtNLEmail');
            clickclearImg(field, 'bckrnull');
        }
    }
    if(document.getElementById('ctl00_TopLogin1_Login1_txtUserBox') != null)
    {
        if(document.getElementById('ctl00_TopLogin1_Login1_txtUserBox').value != "")
        {
            var field = document.getElementById('ctl00_TopLogin1_Login1_txtUserBox');
            clickclearImg(field, 'logemailnull');
        }
    }
    
    if(document.getElementById('ctl00_TopLogin1_Login1_UserName') != null)
    {
        if(document.getElementById('ctl00_TopLogin1_Login1_UserName').value != "")
        {
            var field = document.getElementById('ctl00_TopLogin1_Login1_UserName');
            clickclearImg(field, 'logemailnull');
        }
    }
    if(document.getElementById('ctl00_TopLogin1_txtfEmail') != null)
    {
        if(document.getElementById('ctl00_TopLogin1_txtfEmail').value != "")
        {
            var field = document.getElementById('ctl00_TopLogin1_txtfEmail');
            clickclearImg(field, 'logemailnull');
        }    
    }
    
    if(document.getElementById('ctl00_dcSearch_txtSearchTerms') != null)
    {
        if(document.getElementById('ctl00_dcSearch_txtSearchTerms').value != "")
        {
            var field = document.getElementById('ctl00_dcSearch_txtSearchTerms');
            clickclearImg(field, 'bckrnull');
        }
    }
    if(document.getElementById('ctl00_ContentPlaceHolder1_txtSearchTerms') != null)
    {
        if(document.getElementById('ctl00_ContentPlaceHolder1_txtSearchTerms').value != "")
        {
            var field = document.getElementById('ctl00_ContentPlaceHolder1_txtSearchTerms');
            clickclearImg(field, 'bckrnull');
        }
    }
}
function bringSpot(field1, field2)
{
     var field1 = document.getElementById(field1);
     var field2 = document.getElementById(field2);
     
     field1.style.display = "block";
     field2.style.display = "none";
}
function clickclearImg(thisfield, clas)
{
      thisfield.setAttribute("class", clas);
      thisfield.setAttribute("className", clas);
}
function clickrecallImg(thisfield, clas)
{
    if (thisfield.value == '')
    {
      thisfield.setAttribute("class",clas);
      thisfield.setAttribute("className",clas);
      
      thisfield.style.borderColor = "#cccccc";
    }
}   



function changeOpacity(el,opacity) {
  var image = document.getElementById(el);
  // For Mozilla
  image.style.MozOpacity = (opacity / 100);
  // For IE
  image.style.filter = "alpha(opacity=" + opacity + ")";
  // For others
  image.style.opacity = (opacity / 100);
}
function fade(el,milli,start,end) {
  var fadeTime = Math.round(milli/100);
		
  var i = 0;  // Fade Timer
  // Fade in
  if(start < end) {
    for(j = start; j <= end; j++) {
      // define the expression to be called in setTimeout()
      var expr = "changeOpacity('" + el + "'," + j + ")";
      var timeout = i * fadeTime;
      // setTimeout will call 'expr' after 'timeout' milliseconds
      setTimeout(expr,timeout);
      i++;
    }
  }
  // Fade out
  else if(start > end) {
    for(j = start; j >= end; j--) {
      var expr = "changeOpacity('" + el + "'," + j + ")";
      var timeout = i * fadeTime;
      setTimeout(expr,timeout);
      i++;
    }
  }
}
/* toggle() checks to see if the images has already been faded
   or not and sends the appropriate variables to opacity(); */
function toggleIn(el,milli) {
      fade(el, milli, 0, 100);
 } 
function toggleOut(el,milli) {
  // Get the opacity style parameter from the image
     fade(el, milli, 100, 0);

} 




/* Sort product info transitions */
function clickSFriend()
{
fixProductTabs();
    var ftab = document.getElementById('ftab');
    var atab = document.getElementById('atab');
    var stab = document.getElementById('stab');
   
    var sfriend = document.getElementById('s-profile');
    var squestionmark = document.getElementById('s-questionmark');
   
    ftab.style.zIndex = 0;
    
    atab.style.zIndex = 0;
    
    changeOpacity('atab', 0);
    changeOpacity('ftab', 0);
    changeOpacity('stab', 0);

    sfriend.setAttribute("class", "current");
    sfriend.setAttribute("className", "current");
    squestionmark.setAttribute("class", "");
    squestionmark.setAttribute("className", "");
    
    stab.style.zIndex = 10;
    toggleIn('stab', 800)
}
function clickAQuest()
{
fixProductTabs();
    var ftab = document.getElementById('ftab');
    var atab = document.getElementById('atab');
    var stab = document.getElementById('stab');
    
    var sfriend = document.getElementById('s-profile');
    var squestionmark = document.getElementById('s-questionmark');
    
    ftab.style.zIndex = 0;
    stab.style.zIndex = 0;
    
    changeOpacity('stab', 0);
    changeOpacity('ftab', 0);
    changeOpacity('atab', 0);
    
    sfriend.setAttribute("class", "");
    sfriend.setAttribute("className", "");
    squestionmark.setAttribute("class", "current");
    squestionmark.setAttribute("className", "current");
    
    atab.style.zIndex = 10;
    toggleIn('atab', 800)
}
function clickFTab()
{
    var ftab = document.getElementById('ftab');
    var atab = document.getElementById('atab');
    var stab = document.getElementById('stab');
   
    var sfriend = document.getElementById('s-profile');
    var squestionmark = document.getElementById('s-questionmark');
    
    atab.style.zIndex = 0;
    stab.style.zIndex = 0;
    
    changeOpacity('stab', 0);
    changeOpacity('atab', 0);
    changeOpacity('ftab', 0);
    
    sfriend.setAttribute("class", "");
    sfriend.setAttribute("className", "");
    squestionmark.setAttribute("class", "");
    squestionmark.setAttribute("className", "");
    
    ftab.style.zIndex = 10;
    toggleIn('ftab', 800)
}

function getHost() {
    var a = document.URL.split("//"); // split at protocol
    a = (a[1] ? a[1] : a[0]).split("/");
    // use last element of a; split at /
    // host is a[0]; path is a[1..(n-1)]; a[n] is page
    return "http://" + a[0];
}

// EMAIL
function regCheckEmail()
{
var value = document.getElementById("ctl00_TopLogin1_Login1_UserName").value;
MettleSystems.dashCommerce.Web.WebServices.login.returnChkEmail(value,
        SucceededCallbackChkEmail);
}


// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkEmail(result)
{
  var RsltElem = document.getElementById("ctl00_TopLogin1_Login1_UserName");
  var RsltElem1 = document.getElementById("ctl00_TopLogin1_Login1_txtUserBox");
  var valElem = document.getElementById("valUserName");
 
  var linkbutton = document.getElementById('ctl00_TopLogin1_Login1_LoginButton1');
//  var imgbutton = document.getElementById('imgLogbutton');
 
  if(result == "true")
  {
        valElem.style.display = "none";
        
      //  linkbutton.style.display = "block";
     //   imgbutton.style.display = "none";
  }
  if(result == "null")
  {    
        valElem.innerHTML = "*Please enter you email address";
        valElem.style.display = "block";
        
       
        RsltElem1.setAttribute("class","logemailrednull");
        RsltElem1.setAttribute("className","logemailrednull");
        
      //  linkbutton.style.display = "block";
      //  imgbutton.style.display = "none";
  }
  if(result == "notexists")
  {
    
        valElem.innerHTML = "*Email address not found, please try again";
        valElem.style.display = "block";
        
        RsltElem1.setAttribute("class","logemailred");
        RsltElem1.setAttribute("className","logemailred");
        
      //  linkbutton.style.display = "none";
      //  imgbutton.style.display = "block";
  }
  if(result == "false")
  {
        valElem.innerHTML = "*Invalid email address";
        valElem.style.display = "block";
        
        RsltElem1.setAttribute("class","logemailred");
        RsltElem1.setAttribute("className","logemailred");
        
      //  linkbutton.style.display = "block";
      //  imgbutton.style.display = "none";
  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
}
function regCheckEmailc()
{
var value = document.getElementById("ctl00_ContentPlaceHolder1_loginregister1_Login1_UserName").value;
MettleSystems.dashCommerce.Web.WebServices.login.returnChkEmail(value,
        SucceededCallbackChkEmailc);
}
function SucceededCallbackChkEmailc(result)
{
  var RsltElem = document.getElementById("ctl00_ContentPlaceHolder1_loginregister1_Login1_UserName");
  var valElem = document.getElementById("valUserNamec");
 
  var linkbutton = document.getElementById('ctl00_ContentPlaceHolder1_loginregister1_Login1_LoginButton1');
  var linkbutton2 = document.getElementById('ctl00_ContentPlaceHolder1_loginregister1_Login1_LoginButton2');
  var imgbutton = document.getElementById('imgLogbuttonc');
  var imgbutton2 = document.getElementById('imgLogbuttonRollc');
 
  if(result == "true")
  {
        valElem.style.display = "none";
        
        linkbutton.style.display = "block";
        imgbutton.style.display = "none";
  }
  if(result == "null")
  {    
        valElem.innerHTML = "*Please enter you email address";
        valElem.style.display = "block";        
       
        RsltElem.setAttribute("class","txtPlainField bckrred");
        RsltElem.setAttribute("className","txtPlainField bckrred");
        
        linkbutton.style.display = "block";
        linkbutton2.style.display = "block";
        imgbutton.style.display = "none";
        imgbutton2.style.display = "none";
  }
  if(result == "notexists")
  {    
        valElem.innerHTML = "*Email address not found, try again";
        valElem.style.display = "block";
        
        RsltElem.setAttribute("class","txtPlainField bckrred");
        RsltElem.setAttribute("className","txtPlainField bckrred");
        
        linkbutton.style.display = "none";
        linkbutton2.style.display = "none";
        imgbutton.style.display = "block";
        imgbutton2.style.display = "block";
  }
  if(result == "false")
  {
        valElem.innerHTML = "*Invalid email address";
        valElem.style.display = "block";
        
        RsltElem.setAttribute("class","txtPlainField bckrred");
        RsltElem.setAttribute("className","txtPlainField bckrred");
        
        linkbutton.style.display = "block";
        linkbutton2.style.display = "block";
        imgbutton.style.display = "none";
        imgbutton2.style.display = "none";
  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
}

// EMAIL
function regfCheckEmail()
{
var value = document.getElementById("ctl00_TopLogin1_txtfEmail").value;
MettleSystems.dashCommerce.Web.WebServices.login.returnChkfEmail(value,
        SucceededCallbackChkfEmail);
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkfEmail(result)
{
  var RsltElem = document.getElementById("ctl00_TopLogin1_txtfEmail");
  var valElem = document.getElementById("valfEmail");
  
    var linkbutton = document.getElementById('ctl00_TopLogin1_fpButton1');
  
  if(result == "true")
  {
        valElem.style.display = "none";
  }
  if(result == "null")
  {    
        valElem.innerHTML = "*Please enter you email address";
        valElem.style.display = "block";
        
        
        RsltElem.setAttribute("class","logemailrednull");
        RsltElem.setAttribute("className","logemailrednull");
  }
  if(result == "notexists")
  {    
        valElem.innerHTML = "*Email address not found, please try again";
        valElem.style.display = "block";
        
        RsltElem.setAttribute("class","logemailred");
        RsltElem.setAttribute("className","logemailred");
  }
  if(result == "false")
  {
        valElem.innerHTML = "*Invalid email address";
        valElem.style.display = "block";
        
        RsltElem.setAttribute("class","logemailred");
        RsltElem.setAttribute("className","logemailred");
       
  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
}


function regCheckPassword()
{
var value = document.getElementById("ctl00_TopLogin1_Login1_Password").value;
MettleSystems.dashCommerce.Web.WebServices.login.returnChkPassword(value,
        SucceededCallbackChkPassword);
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkPassword(result)
{
  var valElem = document.getElementById("valPassword");
  var valElem2 = document.getElementById("valPassword2");

  var RsltElem = document.getElementById("ctl00_TopLogin1_Login1_Password");
  if(result == "true")
  {
        valElem.style.display = "none";
        if(valElem2 != null)
        {
           valElem2.style.display = "none";
        }
  }
  else
  {
        valElem.innerHTML = "*Please enter your password";
        valElem.style.display = "block";
        if(valElem2 != null)
        {
            valElem2.style.display = "none";
        }
        RsltElem.setAttribute("class","logpassrednull");
        RsltElem.setAttribute("className","logpassrednull");

  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
}

function regCheckPasswordc()
{
var value = document.getElementById("ctl00_ContentPlaceHolder1_loginregister1_Login1_Password").value;
MettleSystems.dashCommerce.Web.WebServices.login.returnChkPassword(value,
        SucceededCallbackChkPasswordc);
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkPasswordc(result)
{
  var valElem = document.getElementById("valPassword11");

  var RsltElem = document.getElementById("ctl00_ContentPlaceHolder1_loginregister1_Login1_Password");
  if(result == "true")
  {
        valElem.style.display = "none";
  }
  else
  {
        valElem.innerHTML = "*Please enter your password";
        valElem.style.display = "block";
        RsltElem.setAttribute("class","txtPlainField bckrred");
        RsltElem.setAttribute("className","txtPlainField bckrred");

  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
}

function loginCheckup()
{
    regCheckEmail();
    regCheckPassword();
}
function loginCheckupc()
{
    regCheckEmailc();
    regCheckPasswordc();
}



function fixProductTabs()
{
    var ftab = document.getElementById('ftab');
    if(ftab != null)
    {
        var hei = ftab.offsetHeight;
        
        var stab = document.getElementById('stab').style.height = (hei-10) + "px";
        var atab = document.getElementById('atab').style.height = (hei-10) + "px";
    }
}





/* Product Spec Validation */
function chkFieldProd(field, classname, valfield)
{
    if(document.getElementById(field) != null)
    {
        var value = document.getElementById(field).value;
        MettleSystems.dashCommerce.Web.WebServices.login.returnChkFieldProd(field, classname, value, valfield,
                SucceededCallbackChkField);
    }
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkField(stringarray)
{

    var field = stringarray[0];
    var classname = stringarray[1];
    var result = stringarray[2];
    var valfield = stringarray[3];
    

  var RsltElem = document.getElementById(field);
  var val = document.getElementById(valfield);
  if(result == "true")
  {
        RsltElem.setAttribute("class", classname + " bckrnull");
       RsltElem.setAttribute("className", classname + " bckrnull");
       
        if(val != null)
        {
            val.style.display = "none";
        }
  }
  if(result == "null")
  {
        RsltElem.setAttribute("class", classname + " bckrnullred");
        RsltElem.setAttribute("className", classname + " bckrnullred");
        
        if(val != null)
        {
            val.style.display = "block";
        }
  }
  if(result == "false")
  {
        RsltElem.setAttribute("class", classname + " bckrred");
        RsltElem.setAttribute("className", classname + " bckrred");

        if(val != null)
        {
            val.style.display = "block";
        }        
  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
  
  fixProductTabs();
}


function chkEmailFieldProd(field, classname, valfield1, valfield2)
{
    if(document.getElementById(field) != null)
    {
    var value = document.getElementById(field).value;
    MettleSystems.dashCommerce.Web.WebServices.login.returnChkEmailFieldProd(field, classname, value, valfield1, valfield2,
            SucceededCallbackChkEmailField);
    }
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallbackChkEmailField(stringarray)
{
    var field = stringarray[0];
    var classname = stringarray[1];
    var result = stringarray[2];
    var valfield1 = stringarray[3];
    var valfield2 = stringarray[4];
    
    
  var RsltElem = document.getElementById(field);
  var val1 = document.getElementById(valfield1);
  var val2 = document.getElementById(valfield2);
  if(result == "true")
  {
        RsltElem.setAttribute("class", classname + " bckrnull");
        RsltElem.setAttribute("className", classname + " bckrnull");
        if(val1 != null)
        {
            val1.style.display = "none";
        }
        if(val2 != null)
        {
            val2.style.display = "none";
        }
  }
  if(result == "null")
  {
        RsltElem.setAttribute("class", classname + " bckrred");
        RsltElem.setAttribute("className", classname + " bckrred");
        if(val1 != null)
        {
            val1.style.display = "block";
        }
        if(val2 != null)
        {
            val2.style.display = "none";
        }
  }
  if(result == "false")
  {
        RsltElem.setAttribute("class", classname + " bckrnullred");
        RsltElem.setAttribute("className", classname + " bckrnullred");
        if(val1 != null)
        {
            val1.style.display = "none";
        }
        if(val2 != null)
        {
            val2.style.display = "block";
        }
  }
  if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
  
  fixProductTabs();
}


function checkFieldsMatch(firstfield, secondfield, firstclass, secondclass, valfield)
{
    if((document.getElementById(firstfield) != null) && (document.getElementById(secondfield) != null))
    {
        var value1 = document.getElementById(firstfield).value;
        var value2 = document.getElementById(secondfield).value;
        MettleSystems.dashCommerce.Web.WebServices.login.returnChkEmailFieldProdMatch(firstfield, secondfield, firstclass, secondclass, value1, value2, valfield,
                SucceededCallbackChkFieldsMatch);
    }
}
function SucceededCallbackChkFieldsMatch(stringarray)
{
    var firstfield = stringarray[0];
    var secondfield = stringarray[1];
    var firstclass = stringarray[2];
    var secondclass = stringarray[3];
    var result = stringarray[4];
    var valfield = stringarray[5];
    
  var ff = document.getElementById(firstfield);
  var sf = document.getElementById(secondfield);
  var val = document.getElementById(valfield);
  
  

  if(result == "true")
  {
        ff.setAttribute("class", firstclass + " bckrnull");
        ff.setAttribute("className", firstclass + " bckrnull");
        
        sf.setAttribute("class", secondclass + " bckrnull");
        sf.setAttribute("className", secondclass + " bckrnull");
        
        if(val != null)
        {
            val.style.display = "none";
        }     
  }

  if(result == "false")
  {
        if(ff.value == "")
        {
            ff.setAttribute("class", firstclass + " bckrred");
            ff.setAttribute("className", firstclass + " bckrred"); 
        }
        else
        {
            ff.setAttribute("class", firstclass + " bckrrednull");
            ff.setAttribute("className", firstclass + " bckrrednull"); 
        }
        if(sf.value == "")
        {
            sf.setAttribute("class", secondclass + " bckrred");
            sf.setAttribute("className", secondclass + " bckrred");
        }
        else
        {
            sf.setAttribute("class", secondclass + " bckrrednull");
            sf.setAttribute("className", secondclass + " bckrrednull");
        }
        if(val != null)
        {
                val.style.display = "block";
        }             
  }
  if(result == "null")
  {
       if(ff.value == "")
       {
            ff.setAttribute("class", firstclass + " bckrred");
            ff.setAttribute("className", firstclass + " bckrred"); 
       }
       else
       {     
            ff.setAttribute("class", firstclass + " bckrrednull");
            ff.setAttribute("className", firstclass + " bckrrednull"); 
       }
       if(sf.value == "")
       {
            sf.setAttribute("class", secondclass + " bckrred");
            sf.setAttribute("className", secondclass + " bckrred"); 
       }
       else
       {     
            sf.setAttribute("class", secondclass + " bckrrednull");
            sf.setAttribute("className", secondclass + " bckrrednull"); 
       }
       if(val != null)
        {
            if((ff.value != "") && (sf.value != ""))
            {        
                val.style.display = "block";
            }
        }     
    }
}
function chkFieldLength(field, fieldclass, valfield, nochars)
{
    if(document.getElementById(field) != null)
    {
        var value = document.getElementById(field).value;
        MettleSystems.dashCommerce.Web.WebServices.login.returnChkFieldLength(field, fieldclass, valfield, nochars, value,
            SucceededCallbackChkFieldLength);
    }
}
function SucceededCallbackChkFieldLength(stringarray)
{
      var field = stringarray[0];
      var valfield = stringarray[1];
      var fieldclass = stringarray[2];
      var result = stringarray[3];
    
      var valElem = document.getElementById(field);
      var val = document.getElementById(valfield);
      if(result == "false")
      {
            valElem.setAttribute("class", fieldclass + " bckrrednull");
            valElem.setAttribute("className", fieldclass + " bckrrednull"); 
            val.style.display = "block";
      }
      else
      {
            val.style.display = "none";
      }
}
  function checkRegistration()
  {
  
  chkFieldProd('ctl00_ContentPlaceHolder1_txtTitle', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator13');
  
      chkFieldProd('ctl00_ContentPlaceHolder1_txtFirstName', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator1');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtSurname', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator2');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtBirthday', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator3');

      chkFieldProd('ctl00_ContentPlaceHolder1_txtAddress1', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator8');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtTownCity', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator9');
     
      chkFieldProd('ctl00_ContentPlaceHolder1_txtPostcode', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator10');
     
      chkFieldProd('ctl00_ContentPlaceHolder1_txtCounty', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator4');
      
      chkFieldProd('ctl00_ContentPlaceHolder1_txtCountry', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator11');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtPhone', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator12');
      
      chkFieldProd('ctl00_ContentPlaceHolder1_txtHowDidUHear', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator5');
      
      chkEmailFieldProd('ctl00_ContentPlaceHolder1_loginregister1_txtEmail', 'txtPlainField', 'ctl00_ContentPlaceHolder1_loginregister1_RequiredFieldValidator4', 'ctl00_ContentPlaceHolder1_loginregister1_RegularExpressionValidator4');
      chkFieldProd('ctl00_ContentPlaceHolder1_loginregister1_txtPassword', 'txtPlainField', 'ctl00_ContentPlaceHolder1_loginregister1_RequiredFieldValidator6');
      chkFieldLength('ctl00_ContentPlaceHolder1_loginregister1_txtPassword', 'txtPlainField', 'complecnk', 6);
      chkFieldProd('ctl00_ContentPlaceHolder1_loginregister1_txtPasswordConfirm', 'txtPlainField', 'ctl00_ContentPlaceHolder1_loginregister1_RequiredFieldValidator7');
      checkFieldsMatch('ctl00_ContentPlaceHolder1_loginregister1_txtPassword', 'ctl00_ContentPlaceHolder1_loginregister1_txtPasswordConfirm', 'txtPlainField', 'txtPlainField', 'ctl00_ContentPlaceHolder1_loginregister1_CompareValidator1');
  }
    function checkPDRegistration()
  {
chkFieldProd('ctl00_ContentPlaceHolder1_txtFirstName', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator1');
chkFieldProd('ctl00_ContentPlaceHolder1_txtSurname', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator2');
chkFieldProd('ctl00_ContentPlaceHolder1_txtAddress1', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator8');
chkFieldProd('ctl00_ContentPlaceHolder1_txtCounty', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator4');
chkFieldProd('ctl00_ContentPlaceHolder1_txtPostcode', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator10');
chkFieldProd('ctl00_ContentPlaceHolder1_txtCountry', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator11');

chkFieldProd('ctl00_ContentPlaceHolder1_txtCardholder', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator5');
chkFieldProd('ctl00_ContentPlaceHolder1_txtCardNumber', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator6');

if(document.getElementById('ctl00_ContentPlaceHolder1_txtStartDate') != null)
{
    chkFieldProd('ctl00_ContentPlaceHolder1_txtStartDate', 'txtsmPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator3');
}
if(document.getElementById('ctl00_ContentPlaceHolder1_txtIssueNumber') != null)
{
    chkFieldProd('ctl00_ContentPlaceHolder1_txtIssueNumber', 'txtsmPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator12');
}
chkFieldProd('ctl00_ContentPlaceHolder1_txtExpiryDate', 'txtsmPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator9');
chkFieldProd('ctl00_ContentPlaceHolder1_txtCVVcode', 'txtsmPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator13');
  }
    function checkProfRegistration()
  {
      chkFieldProd('ctl00_ContentPlaceHolder1_txtFirstName', 'txtFirstName', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator1');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtSurname', 'txtSurname', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator2');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtBirthday', 'txtBirthday', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator3');
      
      chkFieldProd('ctl00_ContentPlaceHolder1_txtAddress1', 'txtAddress1', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator8');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtTownCity', 'txtTownCity', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator9');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtPostcode', 'txtPostcode', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator10');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtCountry', 'txtCountry', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator11');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtPhone', 'txtPhone', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator12');
  }
  function checkAsqQuest()
  {
      chkFieldProd('ctl00_ContentPlaceHolder1_txtYName', 'txtYName', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator3');
      chkEmailFieldProd('ctl00_ContentPlaceHolder1_txtYEmail', 'txtYEmail', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator2', 'ctl00_ContentPlaceHolder1_RegularExpressionValidator4');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtYMessage', 'txtYQuestion', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator1');
  }
  
  function checkSendFriendQuest()
  {
      chkFieldProd('ctl00_ContentPlaceHolder1_txtSYName', 'txtYName','ctl00_ContentPlaceHolder1_RequiredFieldValidator4');
      chkEmailFieldProd('ctl00_ContentPlaceHolder1_txtSYEmail', 'txtYEmail','ctl00_ContentPlaceHolder1_RequiredFieldValidator5','ctl00_ContentPlaceHolder1_RegularExpressionValidator1');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtfFName', 'txtfFName','ctl00_ContentPlaceHolder1_RequiredFieldValidator6');
      chkEmailFieldProd('ctl00_ContentPlaceHolder1_txtfFEmail', 'txtfFEmail','ctl00_ContentPlaceHolder1_RequiredFieldValidator7','ctl00_ContentPlaceHolder1_RegularExpressionValidator2');
      chkFieldProd('ctl00_ContentPlaceHolder1_txtSYMessage', 'txtYMessage','ctl00_ContentPlaceHolder1_RequiredFieldValidator8');
  }
  function checkNLs()
  {
    chkFieldProd('ctl00_Newslettersignup1_txtNLName', '', '');
    chkEmailFieldProd('ctl00_Newslettersignup1_txtNLEmail', '', '', '');
  }
  
  function checkcpRegistration()
  {
    clickrecallImg(this, 'txtPlainField bckr');
    chkFieldProd('ctl00_ContentPlaceHolder1_txtOldPassword', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator44');
    chkFieldLength('ctl00_ContentPlaceHolder1_txtOldPassword', 'txtPlainField', 'complecnk', 6);
    
    clickrecallImg(this, 'txtPlainField bckr');
    chkFieldProd('ctl00_ContentPlaceHolder1_txtPassword', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator6');
    
    clickrecallImg(this, 'txtPlainField bckr');
    chkFieldProd('ctl00_ContentPlaceHolder1_txtPasswordConfirm', 'txtPlainField', 'ctl00_ContentPlaceHolder1_RequiredFieldValidator7');
    checkFieldsMatch('ctl00_ContentPlaceHolder1_txtPassword', 'ctl00_ContentPlaceHolder1_txtPasswordConfirm', 'txtPlainField', 'txtPlainField', 'ctl00_ContentPlaceHolder1_CompareValidator1');
  }
  
$(document).ready(function()
{ 
    addRollOvers();
});

function addRollOvers()
{
    $('div.image-holder').children(".productText").hide();
    $('div.image-holder').mouseover(function (e) 
    {
        $(this).children(".productText").show();
        $(this).children(".overlay").removeClass("overlay").addClass("opacityOverlay");
    });

    $('div.image-holder').mouseout(function (e) {
        $(this).children(".productText").hide();
        $(this).children(".opacityOverlay").removeClass("opacityOverlay").addClass("overlay");
    });
}