function ar_decrypt( orgciphertext )
{
	//
	var ciphertext = orgciphertext.substring( 5 ); //do not use the first 5 chars
	var origtext = hex2bin(ciphertext);
	
	//alert( orgciphertext + '   '+ ciphertext + '   ' +  origtext );
	
	return origtext;
}

$(document).ready(function() {
    $(".moreinfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    $(".moreinfo").mouseover(function()
    {
    	//
    	$(this).addClass("moreinfo_underline");
    	this.title=this.innerHTML + " review";
    	//alert( "here");
    });
    
    $(".moreinfo").mouseout(function()
    {
    	//
    	$(this).removeClass("moreinfo_underline");
    	//alert( "here");
    });
    
    $(".moreinfonotitle").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    $(".categoryinfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    $(".categoryinfo").mouseover(function()
    {
    	//
    	$(this).addClass("categoryinfo_underline");
    	this.title=this.innerHTML + " review";
    	//alert( "here");
    });
    
    $(".categoryinfo").mouseout(function()
    {
    	//
    	$(this).removeClass("categoryinfo_underline");
    	//alert( "here");
    });
    
    $(".categoryimageinfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    
    
    $(".sidebarinfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    $(".sidebarinfo").mouseover(function()
    {
    	//
    	$(this).addClass("sidebarinfo_underline");
    	this.title=this.innerHTML + " review";
    	//alert( "here");
    });
    
    $(".sidebarinfo").mouseout(function()
    {
    	//
    	$(this).removeClass("sidebarinfo_underline");
    	//alert( "here");
    });
    
    $(".sidebarimageinfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	//alert( cleartext );
    	window.location = cleartext;
    });
    
    
    
    $(".bottominfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	var dataarray = cleartext.split(">")
    	var thedestination = dataarray[0];
    	
    	//alert( cleartext );
    	window.location = thedestination;
    });
    
    $(".bottominfo").mouseover(function()
    {
    	//
    	$(this).addClass("moreinfo_underline");
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	var dataarray = cleartext.split(">")
    	var thetitle = dataarray[1];
    	
    	this.title=thetitle;
    	//alert( atitlearray[1] );
    });
    
    $(".bottominfo").mouseout(function()
    {
    	//
    	$(this).removeClass("moreinfo_underline");
    	//alert( "here");
    });
    
    
    $(".extrainfo").click(function()
    {
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	var dataarray = cleartext.split(">")
    	var thedestination = dataarray[0];
    	
    	//alert( cleartext );
    	window.location = thedestination;
    });
    
    $(".extrainfo").mouseover(function()
    {
    	//
    	$(this).addClass("extrainfo_underline");
    	var ciphertext = this.id;
    	var cleartext = ar_decrypt( ciphertext );
    	var dataarray = cleartext.split(">")
    	var thetitle = dataarray[1];
    	
    	this.title=thetitle;
    	//alert( atitlearray[1] );
    });
    
    $(".extrainfo").mouseout(function()
    {
    	//
    	$(this).removeClass("extrainfo_underline");
    	//alert( "here");
    });
    
    
    $(".underlineonhover").mouseover(function()
    {
    	$(this).addClass("underlinethis");
    });
    
    $(".underlineonhover").mouseout(function()
    {
    	$(this).removeClass("underlinethis");
    });
    
});


// $CVSHeader: _freebeer/www/lib/bin2hex.js,v 1.2 2004/03/07 17:51:35 ross Exp $

// Copyright (c) 2002-2004, Ross Smith.  All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.

var _bin2hex = [
    '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
];

var _hex2bin = [
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, // 0-9
     0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A-F
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, // a-f
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];

function bin2hex(str) {
    var len = str.length;
    var rv = '';
    var i = 0;
    var c;
    
    while (len-- > 0) {
        c = str.charCodeAt(i++);

        rv += _bin2hex[(c & 0xf0) >> 4];
        rv += _bin2hex[(c & 0x0f)];
    }

    return rv;
}

function hex2bin(str) {
    var len = str.length;
    var rv = '';
    var i = 0;

    var c1;
    var c2;

    while (len > 1) {
        h1 = str.charAt(i++);
        c1 = h1.charCodeAt(0);
        h2 = str.charAt(i++);
        c2 = h2.charCodeAt(0);
        
        rv += String.fromCharCode((_hex2bin[c1] << 4) + _hex2bin[c2]);
        len -= 2;
    }

    return rv;
}


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
