﻿$("[name='sa']").qtip({
	style: { 
      width: 125,
      padding: 5,
      fontSize: 11,
      textAlign: 'center',
      tip: 'topMiddle',
      name: 'cream' 
   },
	position: { corner: { target: 'bottomMiddle', tooltip: 'topMiddle'}},
	content: 'Google Site Search',
	show: 'mouseover',
	hide: 'mouseout'
})
$("#dell-lookup").qtip({
	style: { 
      width: 175,
      padding: 5,
      fontSize: 13,
      textAlign: 'center',
      tip: 'topLeft',
      name: 'cream' 
   },
	position: { corner: { target: 'bottomMiddle', tooltip: 'topLeft'}},
	content: 'Dell Power Lookup',
	show: 'mouseover',
	hide: 'mouseout'
})
$("#hp-lookup").qtip({
	style: { 
      width: 225,
      padding: 5,
      fontSize: 13,
      textAlign: 'center',
      tip: 'topMiddle',
      name: 'cream' 
   },
	position: { corner: { target: 'bottomMiddle', tooltip: 'topMiddle'}},
	content: 'HP & Compaq Power Lookup',
	show: 'mouseover',
	hide: 'mouseout'
})
$("#gateway-lookup").qtip({
	style: { 
      width: 250,
      padding: 5,
      fontSize: 13,
      textAlign: 'center',
      tip: 'topRight',
      name: 'cream' 
   },
	position: { corner: { target: 'bottomMiddle', tooltip: 'topRight'}},
	content: 'Gateway & eMachines Power Lookup',
	show: 'mouseover',
	hide: 'mouseout'
})
$(function(){
  $('#avail_click').click(function(){
    document.getElementById("availability").innerHTML="Availability: <img class='pdf' height='10' width='10' src='images/ajax-loader-small.gif' />";
    $.ajax({ 
      type: 'GET', 
      url: 'ajax/availability/availability.php', 
      //data: { 
        //key: "value" 
      //}, 
      dataType: 'xml', 
      cache: false,
      success: function(xml){ 
        var refresh=(xml).getElementsByTagName("refresh")[0].childNodes[0].nodeValue;           
        var msg=(xml).getElementsByTagName("msg")[0].childNodes[0].nodeValue;    
        var av="Availability: ";
        if (refresh==0) {
          av+=msg;
        }
        else {
          av+=msg;
          //av+=" <a id='avail_check' href='javascript:void(0)'>(update)</a>"      
        }
        document.getElementById("availability").innerHTML=av;   
      }    
    });    
  });
});
