// Paraspar Ajax Controls Written By Paraspar, Dev Day 2008-2010
var ajaxDirection = '';
// Generic invoke function, can be used for all ajax commands on this page.
// Based on their target, they may have different behaviour
function getScroll(obj) {
	if (document.documentElement.scrollTop == 0 || document.documentElement.scrollTop < getTop('shBsketImage')+25 ) {
		return getTop('shBsketImage')+25;
	}
	else { 
		return eval(document.documentElement.scrollTop + 10);
	}
}

function returnAjaxBasket() {
    if (document.addtobasketFORM.sku.length == undefined) {
        var rad_val = document.addtobasketFORM.sku.value;
    }
    else {
        for (var i = 0; i < document.addtobasketFORM.sku.length; i++) {
            if (document.addtobasketFORM.sku[i].checked) {
                var rad_val = document.addtobasketFORM.sku[i].value;
            }
        }
    }
    var ajaxURL = document.addtobasketFORM.action + '&target=ajx_basket.asp' + '&sku=' + rad_val + '&qty=' + document.addtobasketFORM.quantity.value
    getMyHTMLElement('addToBasketImageOnPPage' + buttonID).src = '/images/core/ajaxloader.gif'
    ajaxGET(ajaxURL, 'basketSummaryMenu', ajaxBoxLoaded)
}

function invokeAJAX(url, target, positionT,delay,leftAdjust,ajaxBoxLoaded) {
  if (target=='ajaxPRODUCTBox'){
    getMyHTMLElement('ajaxPRODUCTBox').src = 'about:blank';
    if (leftAdjust != '' && typeof(leftAdjust) != 'undefined'){leftAdjustInt = leftAdjust/2;}
    else{leftAdjustInt=75}
    centerObject('ajaxPRODUCTBox',500,250,'',getTop(positionT),leftAdjustInt,0);
    centerObject('ajaxPRODUCTBoxShadow',500,250,'',getTop(positionT),leftAdjustInt,0);
    getMyHTMLElement('ajaxPRODUCTBox').src = '/loading.html';
    showDisplayTable('ajaxPRODUCTBoxShadow')
    showDisplayTable('ajaxPRODUCTBox')
    getMyHTMLElement('ajaxPRODUCTBox').src = url;
	initialised = false;
  }
  else{
      var req;
      if (ajaxBoxLoaded==true){parent.document.getElementById(target).innerHTML = '<div class="ajaxLoading"><img src="/images/core/ajaxloader.gif" alt="Please wait, the page is loading..."></div>';}
      else{document.getElementById(target).innerHTML = '<div class="ajaxLoading"><img src="/images/core/ajaxloader.gif" alt="Please wait, the page is loading..."></div>';}
      if (target=='ajaxBASKET'){
        if (ajaxBoxLoaded==true){centerObject('ajaxBASKET',500,250,parent.getLeft('shBsketImage'),parent.getScroll('shBsketImage'),0,0,ajaxBoxLoaded);}
        else{centerObject('ajaxBASKET',500,250,getLeft('shBsketImage'),getScroll('shBsketImage'),0,0,ajaxBoxLoaded);}
      }
      ajaxGET(url,target,ajaxBoxLoaded)
  }
}  

function ahahDone(req, url, target,positionT, delay) {
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = req.responseText;
      
      showDisplayTable(target)
      setAndExecute(getMyHTMLElement(target).innerHTML)
    } else {
      document.getElementById(target).innerHTML="ahah error:\n"+req.statusText;
    }
  }
}


function ajaxGET(pageName,divID,ajaxBoxLoaded){
    currentHeight = 0
    var xmlhttp=false;
    try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (E) {xmlhttp = false;}  }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {try {xmlhttp = new XMLHttpRequest();} catch (e) {xmlhttp=false;}}
    if (!xmlhttp && window.createRequest) {try {xmlhttp = window.createRequest();} catch (e) {xmlhttp=false;}}
    xmlhttp.open("GET", pageName, true); xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2005 00:00:00 GMT");
    xmlhttp.onreadystatechange = function() {
    	if (xmlhttp.readyState == 4) {
    		if (ajaxBoxLoaded == true) {
    			parent.getMyHTMLElement(divID).innerHTML = xmlhttp.responseText; parent.showDisplayTable(divID);
    			if (divID == 'basketSummaryMenu') {
    				parent.getMyHTMLElement('headerBASKETtext').innerHTML = parent.getMyHTMLElement('newBASKETsummary').innerHTML;
    				parent.getMyHTMLElement('basketSummaryMenu').innerHTML = parent.getMyHTMLElement('basketSummaryMenuNew').innerHTML;
    				parent.getMyHTMLElement('addToBasketImageOnPPage' + buttonID).src = '/images/buttons/buynow.gif'
    				parent.getMyHTMLElement('item_added_div_tag').style.display = '';
    			}
    		}
    		else {
    			if(divID == 'basketSummaryMenu'){getMyHTMLElement('basketSummaryMenu').style.left = '-900px';}
    			getMyHTMLElement(divID).innerHTML = xmlhttp.responseText; showDisplayTable(divID);
    			if (divID == 'ajaxCustomerComments') { hideDisplayTable('ajaxCustomerCommentsOverlay') }
    			if (divID == 'homedesc_1' || divID == 'homedesc_2' || divID == 'homedesc_3' || divID == 'homedesc_4' || divID == 'homedesc_5' || divID == 'homedesc_6') { getMyHTMLElement('productContentHomePage').innerHTML = getMyHTMLElement(divID).innerHTML; hideDisplayTable('ajaxHomeOverlay'); }
    			if (divID == 'basketSummaryMenu') {
    				getMyHTMLElement('headerBASKETtext').innerHTML = getMyHTMLElement('newBASKETsummary').innerHTML;
    				getMyHTMLElement('basketSummaryMenu').innerHTML = getMyHTMLElement('basketSummaryMenuNew').innerHTML;
    				getMyHTMLElement('addToBasketImageOnPPage' + buttonID).src = '/images/buttons/buynow.gif'
    				getMyHTMLElement('item_added_div_tag').style.display = 'block';
    			}
    			if (divID == 'filterOptionsOnLeft') {
    				if (ajaxDirection == 'right') {
    					getMyHTMLElement('productDataOnPageLeft').innerHTML = getMyHTMLElement('productDataOnPageViaAjax').innerHTML;
    					getMyHTMLElement('productDataOnPageViaAjax').innerHTML = '';
    					slideListingsGo('left', 50)
    					ajaxDirection = '';
    				}
    				else if (ajaxDirection == 'left') {
    					getMyHTMLElement('productDataOnPageRight').innerHTML = getMyHTMLElement('productDataOnPageViaAjax').innerHTML;
    					getMyHTMLElement('productDataOnPageViaAjax').innerHTML = '';
    					slideListingsGo('right', 50)
    					ajaxDirection = '';
    				}
    				else if (ajaxDirection == '') {
    					if (getMyHTMLElement('productDataOnPageViaAjax') == null) {
    						// No results, so undo facet choice and message
    						hideDisplayTable('productDataOnPageOverlay')
    						getMyHTMLElement('productDataOnPageOverlayMessage').innerHTML = getMyHTMLElement('ajaxNoResultsMessage').innerHTML;
    						showPopupForFacets('productDataOnPageOverlayMessage', 300, 150)
    						facetChoice(prev_facetName, prev_facetValue, prev_executeFacet)
    					}
    					else {
    						// Results exist so show them
    						getMyHTMLElement('productDataOnPage').innerHTML = getMyHTMLElement('productDataOnPageViaAjax').innerHTML;
    						getMyHTMLElement('productDataOnPageViaAjax').innerHTML = '';
    						hideDisplayTable('productDataOnPageOverlay')
    						getMyHTMLElement('productDataHeader').innerHTML = getMyHTMLElement('productDataHeaderAjax').innerHTML;
    						getMyHTMLElement('productDataFooter').innerHTML = getMyHTMLElement('productDataFooterAjax').innerHTML;
    						getMyHTMLElement('facetResultsOnListingsPage').innerHTML = getMyHTMLElement('facetResultsOnListingsPageAjax').innerHTML;
    					}
    				}
    				if (getMyHTMLElement('topSectionForCategories') != null) {
    					hideDisplayTable('topSectionForCategories')
    				}
    			}
    		}
    	}
    }
    xmlhttp.send(null)
}

function centerObject(divID,width,height,forceLeft,forceTop,adjustLeft, adjustTop,ajaxBoxLoaded){
    // if the ajax data is in a separate document then reference the parent document
    if (ajaxBoxLoaded==true){
	    if (forceLeft !=''){parent.getMyHTMLElement(divID).style.left  = forceLeft + 'px';}
	    else{parent.getMyHTMLElement(divID).style.left = (parent.document.body.offsetWidth - width) /2 + adjustLeft + 'px';}
	    if (forceTop !=''){parent.getMyHTMLElement(divID).style.top  = forceTop + 'px';}
	    else{parent.getMyHTMLElement(divID).style.top = ((parent.document.body.offsetHeight - height) /2) + adjustTop  + 'px'} //+ document.documentElement.scrollTop;}
    }
    // if the ajax data is in a same DOM object then reference the DOM
    else{
	    if (forceLeft !=''){getMyHTMLElement(divID).style.left  = forceLeft + 'px';}
	    else{getMyHTMLElement(divID).style.left = (parent.document.body.offsetWidth - width) /2 + adjustLeft + 'px';}
	    if (forceTop !=''){getMyHTMLElement(divID).style.top  = forceTop + 'px';}
	    else{getMyHTMLElement(divID).style.top = ((parent.document.body.offsetHeight - height) /2) + adjustTop  + 'px'} //+ document.documentElement.scrollTop;}
    }
}

function setAndExecute(divID){
    var div = document.getElementById(divID);
    var x = div.getElementsByTagName("script");   
    for(var i=0;i<x.length;i++){
        eval(x[i].text);
    }
}

function sendEmailAFriend(){
    var sURL = 'ajx_emailafriend.asp?pf_id=' + document.emailafriendform.pf_id.value + '&recipient_name='+document.emailafriendform.recipient_name.value+'&recipient_email='+document.emailafriendform.recipient_email.value+'&sender_name='+document.emailafriendform.sender_name.value + '&sender_email=' + document.emailafriendform.sender_email.value + '&email_message=' + document.emailafriendform.email_message.value
    previousContentEmail = getMyHTMLElement('emailAfriendTEXT').innerHTML
    invokeAJAX(sURL,'emailAfriendTEXT','','','','',false)
}

function ajaxEmailAFriendBack(){
   if (previousContentEmail !=''){
    getMyHTMLElement('emailAfriendTEXT').innerHTML = previousContentEmail 
    }
}


var currentSearchAutoCompleteSelection = 0;
var currentSearchAutoCompletePhrase = ""; 

function checkKeyAndActOnIt(e){
     var key;
     if(window.event){
          key = window.event.keyCode;     //IE
          }
     else{
          key = e.which;     //firefox
    }
    // Only attempt selection if results exist:
    if (getMyHTMLElement('SearchDrop').childNodes.length > 0){
        if (getMyHTMLElement('SearchDrop').childNodes[0].childNodes.length > 0){
            // If customer presses the down arrow then act on this.
            if (key == 40){
                // If there is nothing selected, then select the first node
                if (currentSearchAutoCompleteSelection  <= 0) {
                    // If the selected node is the header, determined by it's class, then skip it.
                    if (getMyHTMLElement('SearchDrop').childNodes[0].childNodes[0].className == "header"){
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[1].className = "selected_search";
                        currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection + 2;
                    }
                    else{
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[0].className = "selected_search";
                        currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection + 1;
                    }
                }
                // If there is something selected then select the next one
                else {
                    if (getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection].className == "header"){
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].className = ""
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection+1].className = "selected_search";
                        currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection + 2;
                    }
                    else{
                    if (currentSearchAutoCompleteSelection < getMyHTMLElement('SearchDrop').childNodes[0].childNodes.length){
                    getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].className = ""
                    getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection].className = "selected_search"
                    currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection + 1;
                    }
                    }
                }
            }
            // If the customer presses an up arrow, then act on this.
            else if (key == 38){
                if (currentSearchAutoCompleteSelection  > 1){
                    currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection - 1;
                    if (getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].className == "header"){
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection].className = ""
                        if (currentSearchAutoCompleteSelection != 1){
                            getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-2].className = "selected_search"
                            }
                        currentSearchAutoCompleteSelection = currentSearchAutoCompleteSelection - 1;
                    }
                    else{
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection].className = ""
                        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].className = "selected_search"
                    }
                }
            }
            // If the customer presses the enter key. act on this.
            else if (key == 13){
                if (currentSearchAutoCompleteSelection > 0 ){
                    getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].onclick();
                }
            }
            else{
                clearSearchDrop()
                currentSearchAutoCompleteSelection = 0
            }
        }
    }
}

function clearSearchDrop(){
    if (currentSearchAutoCompleteSelection > 0){
        getMyHTMLElement('SearchDrop').childNodes[0].childNodes[currentSearchAutoCompleteSelection-1].className = "";
        currentSearchAutoCompleteSelection = 0
    }
}

//THIS FUNCTION CREATED FOR SEARCH DROPDWON USE ONLY - Daeheon Kim - 29/10/2009//

var searchTimeOut;
function SearchDropTable(url,tableToShow,position,leftPos,topPos,leftAdj,topAdj,e){
    clearTimeout(searchTimeOut)
    if (currentSearchAutoCompletePhrase != getMyHTMLElement('searchINPUT').value){
        urlFriendlyPhrase = getMyHTMLElement('searchINPUT').value
        urlFriendlyPhrase = js_URLEncode(urlFriendlyPhrase)
        url = replaceString(url,'replace_searchterm',urlFriendlyPhrase)
        searchTimeOut = setTimeout("SearchDropTable_Main('" + url + "','" + tableToShow+"','" + position+"'," + leftAdj+"," + topAdj+")",500)
        currentSearchAutoCompletePhrase = getMyHTMLElement('searchINPUT').value
        currentSearchAutoCompleteSelection = 0
    }
    else if (currentSearchAutoCompletePhrase.length > 2 ) {
        showDisplayTable(tableToShow)
    }
    var key;
    if(window.event){key = window.event.keyCode;}else{key = e.which;}
	checkKeyAndActOnIt(key)
}

function validateKeyForSearch(e) {
    if(e.keyCode == 13 && currentSearchAutoCompleteSelection > 0){return false;}
}

function js_URLEncode(url){
    url = replaceString(url,"$","%24")
    url = replaceString(url,"&","%26")
    url = replaceString(url,"+","%2B")
    url = replaceString(url,",","%2C")
    url = replaceString(url,"/","%2F")
    url = replaceString(url,":","%3A")
    url = replaceString(url,";","%3B")
    url = replaceString(url,"=","%3D")
    url = replaceString(url,"?","%3F")
    url = replaceString(url,"@","%40")
    return url;
}

function SearchDropTable_Main(url,tableToShow,position,leftAdj,topAdj){
    ajaxGET(url,'SearchDrop',false)
    if (everythingLoaded == true){
	    showDisplayTable(tableToShow)
    }
}
// SEARCH DROPDOWN //


function changeReviewsOrder(url){
    ajaxGET(url,'ajaxCustomerComments',false);
}

// Validates form fields immediately
function ajaxValidate(fieldname,rule1,rule2){
    switch(rule1 + ',' + rule2){
    case "REGISTRATION,FIRSTNAME":checkQualifier(fieldname,1,35,"text");break;
    case "REGISTRATION,SURNAME":checkQualifier(fieldname,1,35,"text");break;
    case "REGISTRATION,EMAIL":checkQualifier(fieldname,6,50,"email");break;
    case "REGISTRATION,PHONE":checkQualifier(fieldname,8,15,"phone");break;
    case "REGISTRATION,MOBILE":checkQualifier(fieldname,0,15,"phone");break;
    //default:ajaxGET('/ajx_validate.asp?data=' + getMyHTMLElement(fieldname).value + '&rule1=' + rule1 + '&rule2=' + rule2,fieldname + '_icon',false);
    }
}

function checkQualifier(fieldname,min,max,rule){
    var finalValidation = true
    fieldnameLength = (getMyHTMLElement(fieldname).value).length
    if (fieldnameLength < min || fieldnameLength > max){finalValidation = false;}
    if (rule == 'email'){
        if (getMyHTMLElement(fieldname).value.indexOf('@') == -1){finalValidation = false;}
        if (getMyHTMLElement(fieldname).value.indexOf('.') == -1){finalValidation = false;}
    }
    if (rule == 'phone'){
        checkValue = getMyHTMLElement(fieldname).value
        checkValue
    }
    //Return a tick or cross
    if (finalValidation == true){
        //getMyHTMLElement(fieldname + '_icon').innerHTML = '<img src="/images/buttons/tick_yes.jpg">'
    }
    else{
        //getMyHTMLElement(fieldname + '_icon').innerHTML = '<img src="/images/buttons/tick_no.jpg">'
    }
    
}

// REM -- New function added by DD based on DM code for images
function slideListingsGo(direction,amount){
    currentContainerValue = parseInt(getMyHTMLElement('productDataOnPageContainer').style.marginLeft);
	if (direction == 'left') {
	    if (currentContainerValue <= -50){
	        getMyHTMLElement('productDataOnPageContainer').style.marginLeft = currentContainerValue + amount + 'px'
	        slideListingsGoTimeout = setTimeout("slideListingsGo('" + direction + "',50)", 15);
	    }
	    else {
    	    getMyHTMLElement('productDataOnPage').innerHTML = getMyHTMLElement('productDataOnPageLeft').innerHTML;
    	    getMyHTMLElement('productDataOnPageContainer').style.marginLeft = '-800px';
    	    getMyHTMLElement('productDataHeader').innerHTML = getMyHTMLElement('productDataHeaderAjax').innerHTML;
    	    getMyHTMLElement('productDataFooter').innerHTML = getMyHTMLElement('productDataFooterAjax').innerHTML;
            getMyHTMLElement('facetResultsOnListingsPage').innerHTML = getMyHTMLElement('facetResultsOnListingsPageAjax').innerHTML;
            getMyHTMLElement('facetResultsOnListingsPageAjax').innerHTML = '';
    	    hideDisplayTable('productDataOnPageOverlay')
    	    //clearTimeout(slideListingsGoTimeout)
	    }
	}
	if (direction == 'right') {
	    //alert(currentContainerValue)
	    //alert(currentContainerValue + " -- " + direction)
	    if (currentContainerValue >= -1550){
	        getMyHTMLElement('productDataOnPageContainer').style.marginLeft = currentContainerValue + (amount*-1) + 'px'
	        slideListingsGoTimeout = setTimeout("slideListingsGo('" + direction + "',50)", 15);
	    }
	    else {
    	    getMyHTMLElement('productDataOnPage').innerHTML = getMyHTMLElement('productDataOnPageRight').innerHTML;
    	    getMyHTMLElement('productDataOnPageContainer').style.marginLeft = '-800px';
    	    getMyHTMLElement('productDataHeader').innerHTML = getMyHTMLElement('productDataHeaderAjax').innerHTML;
    	    getMyHTMLElement('productDataFooter').innerHTML = getMyHTMLElement('productDataFooterAjax').innerHTML;
            getMyHTMLElement('facetResultsOnListingsPage').innerHTML = getMyHTMLElement('facetResultsOnListingsPageAjax').innerHTML;
    	    getMyHTMLElement('facetResultsOnListingsPageAjax').innerHTML = '';
    	    hideDisplayTable('productDataOnPageOverlay')
	        //clearTimeout(slideListingsGoTimeout)
	    }
	}
}

function showPopupForFacets(divTag,width,height){
	
	//set size
	getMyHTMLElement(divTag).style.width = width + 'px';
	getMyHTMLElement(divTag).style.height = height + 'px';
	
	//set position
    getMyHTMLElement(divTag).style.left = ((document.documentElement.clientWidth - width) /2) +75 + 'px';
    getMyHTMLElement(divTag).style.top = ((document.documentElement.clientHeight - height) /2) + document.documentElement.scrollTop + 'px';

	showPopup(divTag)
}

var oPAFAJAX;
function InitiatePAFAjax() {
    //alert(document.getElementById("chkPostcode").checked);
    if (document.getElementById("chkPostcode").checked) {        
        document.getElementById("postcode_ajax").style.display = '';
        document.getElementById("postcode_regular").style.display = 'none';
        oPAFAJAX = new PCAInternationalAutoComplete("GBR", "ENG", document.getElementById("postcode_ajax"), document.getElementById("address1"), getPAFDet);
        oPAFAJAX.UseRoyalMailPremiseData = true;               
    }
    else {
        
        document.getElementById("procImg").style.display = 'none'; 
        document.getElementById("address1").value = '';
        document.getElementById("address2").value = '';
        document.getElementById("address4").value = '';
        document.getElementById("address5").value = '';
        document.getElementById("postcode_ajax").style.display = 'none';
        document.getElementById("postcode_regular").style.display = '';
        oPAFAJAX.UseRoyalMailPremiseData = false;
                    
        /*var elements = document.getElementsByTagName("*");
        for (var i = 0; i < elements.length; i++) {
            if (elements[i].className == 'autocomplete') {
                //alert('Found ' + elements[i].className);
                //alert(elements[i]);                                
                //alert('Before = ' + elements[i].innerHTML);
                elements[i].innerHTML = '';
                //alert('After = ' + elements[i].innerHTML);
                elements[i].style.display = 'none';                          
                
            }                    
        }*/
    }
}

function getPAFDet() {
    document.getElementById("procImg").style.display = 'none';
    //Do something with the address
    document.getElementById("address1").value = oPAFAJAX.Street;
    document.getElementById("address2").value = oPAFAJAX.Locality;
    document.getElementById("address4").value = oPAFAJAX.City;
    document.getElementById("address5").value = oPAFAJAX.State;
    //document.write (objFinder.postcode);
    //document.write (objFinder.CountryName);
    //document.write (objFinder.Label);
    //document.write (objFinder.Line1);
    //document.write (objFinder.Line2);

    /*Building Buiding name or number 
    Street Street / road etc. 
    Locality Locality / district 
    City City or town name 
    State The state / province etc. 
    Postcode The postcode entered 
    CountryName The name of the country 
    Label The fully formatted mailing label 
    Line1 The first (premise) line of the address 
    Line2 The second (premise) line of the address 
        
    .addressform The container for the address form 
    .addressform .field The text boxes + drop downs on the form 
    .addressform .label The labels to the left of the text boxes 
    .autocomplete The container for the autocomplete box (which appears below the street field) 
    .autocomplete A The text inside the autocomplete box - the street name is in BOLD by default. 
    .autocomplete .item The box that holds each item in the autocomplete box. This is the style that's used by default. 
    .autocomplete .itemhover The box that holds each item in the autocomplete box when the moves moves over it, used for highlighting the item. 
        
    .autocomplete .lastitem The style used by the last item in the autocomplete box. 
    */
}
