$(document).ready(function(){
						   $(".latest_img").fadeTo("fast", 1.0);
						   $(".latest_img").hover(function(){
						   $(this).fadeTo("fast", 0.85);
						   },function(){
						   $(this).fadeTo("fast", 1.0);
						   });
						   });

$(document).ready(function(){
						   $(".jfade").fadeTo("fast", 1.0);
						   $(".jfade").hover(function(){
						   $(this).fadeTo("fast", 0.6);
						   },function(){
						   $(this).fadeTo("fast", 1.0);
						   });
						   });

$(document).ready(function(){
						   $(".brandbar").fadeTo("fast", 1.0);
						   $(".brandbar").hover(function(){
						   $(this).fadeTo("fast", 0.5);
						   },function(){
						   $(this).fadeTo("fast", 1.0);
						   });
						   });


$(document).ready(function(){
						   $(".upsell_best").fadeTo("fast", 1.0);
						   $(".upsell_best").hover(function(){
						   $(this).fadeTo("fast", 0.5);
						   },function(){
						   $(this).fadeTo("fast", 1.0);
						   });
						   });


$(document).ready(function(){
						   $(".upsell_new").fadeTo("fast", 1.0);
						   $(".upsell_new").hover(function(){
						   $(this).fadeTo("fast", 0.5);
						   },function(){
						   $(this).fadeTo("fast", 1.0);
						   });
						   });



function simple_tooltip(target_items, name){
 $(target_items).each(function(i){
		$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
		var my_tooltip = $("#"+name+i);
		
		if($(this).attr("title") != "" && $(this).attr("title") != "undefined" ){
		
		$(this).removeAttr("title").mouseover(function(){
					my_tooltip.css({opacity:0.9, display:"none"}).fadeIn(500);
		}).mousemove(function(kmouse){
				var border_top = $(window).scrollTop(); 
				var border_right = $(window).width();
				var left_pos;
				var top_pos;
				var offset = 30;
				if(border_right - (offset *2) >= my_tooltip.width() + kmouse.pageX){
					left_pos = kmouse.pageX+offset;
					} else{
					left_pos = border_right-my_tooltip.width()-offset;
					}
					
				if(border_top + (offset *2)>= kmouse.pageY - my_tooltip.height()){
					top_pos = border_top +offset;
					} else{
					top_pos = kmouse.pageY-my_tooltip.height()-offset;
					}	
				
				
				my_tooltip.css({left:left_pos, top:top_pos});
		}).mouseout(function(){
				my_tooltip.css({left:"-9999px"});				  
		});
		
		}
		
		
		
	});
}

	
	
$(document).ready(function(){
	 simple_tooltip("a","tooltip");
});


//--------------- Actinic Javascript for Soapbox from WWW.CODEPATH.CO.UK

var soapboxapp = "http://www.soapbox-reviews.net/cgi-bin/iwsoapbox.dll"; // the url of the application server.  Only change if advised by Codepath.
//Gets the Image Filename from a rating
function soapboxgetimagefilename(nrating){
  return "sbrating" + nrating + ".bmp";
}

// Gets the image file width
function getimagewidth(nfullimagewidth,nrating){
var nwidth = nfullimagewidth;
  return "\"" + nwidth + "\" "
}

function wopen(url, w, h){
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  if (wleft < 0) {w = screen.width; wleft = 0;}
  if (wtop < 0)  {h = screen.height;wtop = 0;}
  var optionslist = 'width=' + w + ', height=' + h + ', location=no, menubar=no,status=no, toolbar=no, scrollbars=yes, resizable=yes';
  var win = window.open(url, null, optionslist);
}
function d2h(d) {return d.toString(16);}
function safeurlstring(thestring){
  var srtn = "";
  var charascii = 0;
  for (var i=0;i<=thestring.length-1;i++){
    charascii = thestring.charCodeAt(i);
    if ((charascii>=48 && charascii<=57) ||
       (charascii>=65 && charascii<=90) ||
       (charascii>=97 && charascii<=122))
      {srtn = srtn + thestring.charAt(i);}
    else 
      {srtn=srtn+"%"+d2h(charascii);}
  }
  return srtn;
}
function soapboxgetreviewhtml2(srating,sreviewcount,sproductref,sproductname,nrtnmode,nmajorver){
var soapboxvendorkey = "L295GR70J";                                     // Your Site identification key.  Only change if advised by Codepath.
var notreviewed = "";             
var writereview = "";  
var writefirstreview = "(0 reviews)";        
var nfullimagewidth = 83;                      
var splu = "s";                                
var srtn  = "<table border=\"0\" cellspacing = \"0\" cellpadding = \"0\" align = \"left\"><tr>";
var nrating = 0;
var nreviewcount = 0;
if (srating != ""){ nrating = parseInt(srating)};		          	// v7 will pass null for unreviewed products
if (sreviewcount != ""){ nreviewcount = parseInt(sreviewcount)};
if (nmajorver == 7){
  sproductref = sproductref.substring(1); // strip anchor reference
  var excl1 = sproductref.indexOf("!");   // strip duplicate prefix
  var excl2 = sproductref.indexOf("_21");
  if (excl1 >= 0)
    {sproductref = sproductref.substring(excl1+1);}
  else if (excl2 >= 0) 
    {sproductref = sproductref.substring(excl2+3);}
}
sproductref = safeurlstring(sproductref);
sproductname = safeurlstring(sproductname);
if (nreviewcount > 0){
  if (nreviewcount == 1){splu=""}
  srtn = srtn + "<td align=\"left\" valign=\"middle\">";
  srtn = srtn + "<img width=" + getimagewidth(nfullimagewidth,nrating) + "alt=\""       + nrating + "/10\" src=\"./" + soapboxgetimagefilename(nrating) + "\">"; 
  srtn = srtn + "&nbsp;&nbsp;<a class=\"soapbox\" href=\"#\" rel=\"nofollow\" onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=3&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\">(" + nreviewcount + "&nbsp;review" + splu + ")</a>";
  if (nrtnmode != 2){
    srtn = srtn + " <a class=\"soapbox\" href=\"#\" rel=\"nofollow\" onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=2&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\">" + writereview + " </a></td>";
  } 
} 
else {
  srtn = srtn + "<td align=\"left\" valign=\"middle\">";
  srtn = srtn + "<img src=\"sbratingnone.bmp\">&nbsp;";
  srtn = srtn + notreviewed;
  srtn = srtn + "&nbsp;&nbsp; <a class=\"soapbox\" href=\"#\" title=\"<B>Write A Review?</B></br>This item currently has no reviews. Be the first to write one telling us your  experiences & opinion with the overall product.\" rel=\"nofollow\" onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=1&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\">" + writefirstreview + " \</a></td>";
}
srtn = srtn + "</tr></table>"
return srtn;
}









//--------------- Actinic Javascript for Soapbox from WWW.CODEPATH.CO.UK

var soapboxapp = "http://www.soapbox-reviews.net/cgi-bin/iwsoapbox.dll"; // the url of the application server.  Only change if advised by Codepath.
//Gets the Image Filename from a rating
function soapboxgetimagefilename(nrating){
  return "sbrating" + nrating + ".bmp";
}

// Gets the image file width
function getimagewidth(nfullimagewidth,nrating){
var nwidth = nfullimagewidth;
  return "\"" + nwidth + "\" "
}

function wopen(url, w, h){
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  if (wleft < 0) {w = screen.width; wleft = 0;}
  if (wtop < 0)  {h = screen.height;wtop = 0;}
  var optionslist = 'width=' + w + ', height=' + h + ', location=no, menubar=no,status=no, toolbar=no, scrollbars=yes, resizable=yes';
  var win = window.open(url, null, optionslist);
}
function d2h(d) {return d.toString(16);}
function safeurlstring(thestring){
  var srtn = "";
  var charascii = 0;
  for (var i=0;i<=thestring.length-1;i++){
    charascii = thestring.charCodeAt(i);
    if ((charascii>=48 && charascii<=57) ||
       (charascii>=65 && charascii<=90) ||
       (charascii>=97 && charascii<=122))
      {srtn = srtn + thestring.charAt(i);}
    else 
      {srtn=srtn+"%"+d2h(charascii);}
  }
  return srtn;
}
function soapboxgetreviewhtml3(srating,sreviewcount,sproductref,sproductname,nrtnmode,nmajorver){
var soapboxvendorkey = "L295GR70J";                                     // Your Site identification key.  Only change if advised by Codepath.
var notreviewed = "";             
var writereview = "";  
var writefirstreview = "";        
var nfullimagewidth = 83;                      
var splu = "s";                                
var srtn  = "<table border=\"0\" cellspacing = \"0\" cellpadding = \"0\" align = \"right\"><tr>";
var nrating = 0;
var nreviewcount = 0;
if (srating != ""){ nrating = parseInt(srating)};		          	// v7 will pass null for unreviewed products
if (sreviewcount != ""){ nreviewcount = parseInt(sreviewcount)};
if (nmajorver == 7){
  sproductref = sproductref.substring(1); // strip anchor reference
  var excl1 = sproductref.indexOf("!");   // strip duplicate prefix
  var excl2 = sproductref.indexOf("_21");
  if (excl1 >= 0)
    {sproductref = sproductref.substring(excl1+1);}
  else if (excl2 >= 0) 
    {sproductref = sproductref.substring(excl2+3);}
}
sproductref = safeurlstring(sproductref);
sproductname = safeurlstring(sproductname);
if (nreviewcount > 0){
  if (nreviewcount == 1){splu=""}
  srtn = srtn + "<td align=\"\" valign=\"middle\">";
  srtn = srtn + "<img width=" + getimagewidth(nfullimagewidth,nrating) + "alt=\"" + nrating + "/10\" src=\"./" + soapboxgetimagefilename(nrating) + "\">"; 
  srtn = srtn + "&nbsp;&nbsp;<a class=\"soapbox\" href=\"#\" rel=\"nofollow\" .\"onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=3&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\"></a>";
  if (nrtnmode != 2){
    srtn = srtn + " <a class=\"soapbox\" href=\"#\" rel=\"nofollow\" onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=2&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\">" + writereview + "</a></td>";
  } 
} 
else {
  srtn = srtn + "<td align=\"\" valign=\"middle\">";
  srtn = srtn + "<img src=\"sbratingnone.bmp\">";
  srtn = srtn + notreviewed;
  srtn = srtn + "&nbsp;&nbsp;<a class=\"soapbox\" href=\"#\" rel=\"nofollow\" onClick=\"javascript:wopen('" + soapboxapp + "?s=" + soapboxvendorkey + "&a=1&i=" + sproductref + "&d=" + sproductname + "&c=" + nreviewcount + "&r=" + nrating + "','570','570'); return false;\">" + writefirstreview + " \</a></td>";
}
srtn = srtn + "</tr></table>"
return srtn;
}


//--------------- Popup Information Box Javascript

var tmr;
var t;
var obj;

function sFa() {
	obj = gObj();
	sLft();
	shw(true);
	t = 0;
	sTmr();
}

function hFa() {
	t = -100;
	sTmr();
	return false;
}

function sTmr() {
	tmr = setInterval("fd()",20);
}

function fd() {
	var amt = Math.abs(t+=10);
	if(amt == 0 || amt == 100) clearInterval(tmr);
	amt = (amt == 100)?99.999:amt;
  	
	obj.style.filter = "alpha(opacity:"+amt+")";
	obj.style.KHTMLOpacity = amt/100;
	obj.style.MozOpacity = amt/100;
	obj.style.opacity = amt/100;
	
	if(amt == 0) shw(false);
}

function sLft() {
	var w = 170;	// set this to 1/2 the width of the faw div defined in the style sheet 
			// there's not a reliable way to retrieve an element's width via javascript!!
					
	var l = (document.body.innerWidth)? document.body.innerWidth / 2:document.body.offsetWidth / 2;

	obj.style.left = (l - w)+"px";
}

function gObj() {
	return document.getElementById("faw");	
}

function shw(b) {
	(b)? obj.className = 'show':obj.className = '';	
}


//--------------- Popup Information Box Javascript
