function processGetPost(){

	$('#menuBody').hide();



	document.getElementById("results").style.display = 'block'
	document.getElementById("result_text").innerHTML = 'Searching...<img src="/images/spinner.gif" width="16" height="16" alt="Spinner" />'
	document.getElementById("searchText").value = '';
	var myajax=ajax.ajaxobj
	if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){
			document.getElementById("result_text").innerHTML = myajax.responseText
			
			try {
				var objDiv = document.getElementById('result');objDiv.scrollTop =0;
				$(".albums").colorbox({width:"50%", inline:true, href:"#albums_inline"});

			}
			catch (e){ }

			$(".link_results").colorbox({width:"50%", inline:true, href:"#link_results_inline"});




			if ($("#resultstablecd").html()) {
			$.tablesorter.defaults.widgets = ['zebra']; 	
        			$("#resultstable").tablesorter({headers: { 
					0: { 
						sorter: false 
					},
					1: { 
						sorter: "currency"
					},
					2: { 
						sorter: "currency"
					}
					}, sortList: [[1,0]] }); 

	
			}

$("#resultstable tbody td.hoverable").hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);

				
		}
		else {
			document.getElementById("result_text").innerHTML = '		<div class="menuBack">\
\
	<a href="javascript:void(0)" onclick="javascript:$(\'#results\').hide();$(\'#menuBody\').show();">\
\
				<span class="leftTriangle"></span>\
				Back\
			</a>\
\
		</div><br /><b>We\'re sorry, but an error has occurred.<br />Please try again.</b>';
		}
	}



	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disableLink();
		}
	});


}



function processGetPostLive() {

	$('#menuBody').hide();

	document.getElementById("results").style.display = 'block'
	document.getElementById("result_text").innerHTML = 'Searching...<img src="/images/spinner.gif" width="16" height="16" alt="Spinner" />'
	document.getElementById("searchText").value = '';
	var myajax=ajax.ajaxobj
	if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){
			document.getElementById("result_text").innerHTML = myajax.responseText
			loadResults(asin);

			try {
				var objDiv = document.getElementById('result');objDiv.scrollTop =0;
				$(".albums").colorbox({width:"50%", inline:true, href:"#albums_inline"});

			}
			catch (e){ }
		}
		else {
			document.getElementById("result_text").innerHTML = '		<div class="menuBack">\
\
	<a href="javascript:void(0)" onclick="javascript:$(\'#results\').hide();$(\'#menuBody\').show();">\
\
				<span class="leftTriangle"></span>\
				Back\
			</a>\
\
		</div><br /><b>We\'re sorry, but an error has occurred.<br />Please try again.</b>';
		}
	}



	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disableLink();
		}
	});


}









function processGetSearch(){

	document.getElementById("results").style.display = 'block'
	document.getElementById("result_text").innerHTML = 'Searching...<img src="/images/spinner.gif" width="16" height="16" alt="Spinner" />'
	var myajax=ajax.ajaxobj
	if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){
			document.getElementById("result_text").innerHTML = myajax.responseText
			try {
				var objDiv = document.getElementById('result');objDiv.scrollTop =0;





			}
			catch (e){ }

		
		}
		else {
			document.getElementById("result_text").innerHTML = '		<div class="menuBack">\
\
	<a href="javascript:void(0)" onclick="javascript:$(\'#results\').hide();$(\'#menuBody\').show();">\
\
				<span class="leftTriangle"></span>\
				Back\
			</a>\
\
		</div><br /><b>We\'re sorry, but an error has occurred.<br />Please try again.</b>';
		}
	}
}


function processSendEmail(){

var myajax=ajax.ajaxobj
	if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){
			$('#sendResponse').html(myajax.responseText);


			if (myajax.responseText=='<b>E-mail Sent</b> ') {
				setTimeout('disableLink()', 1000);
			}
		}
		else {
			$('#sendResponse').html('<b>We \'re sorry, but an error has occurred.<br />Please try again.</b>');
		}
}
}



function createAjaxObj(){
	var httprequest=false
	if (window.XMLHttpRequest){
		httprequest=new XMLHttpRequest()
		}
		else if (window.ActiveXObject){ // if IE
			try {
				httprequest=new ActiveXObject("Msxml2.XMLHTTP");
			} 
		catch (e){
			try{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			}
		catch (e){}
		}
	}
	return httprequest
}

var ajax=new Object()
	ajax.basedomain="http://"+window.location.hostname
	ajax.ajaxobj=createAjaxObj()

	ajax.getAjaxRequest=function(url, parameters, callbackfunc){
	ajax.ajaxobj=createAjaxObj()
	if (this.ajaxobj){
		this.ajaxobj.onreadystatechange=callbackfunc
		this.ajaxobj.open('POST', url, true)
		this.ajaxobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		this.ajaxobj.send(parameters)
	}
}



	ajax.getAjaxRequestSync=function(url, parameters){
	ajax.ajaxobj=createAjaxObj()
	if (this.ajaxobj){
		this.ajaxobj.open('POST', url, false)
		this.ajaxobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		this.ajaxobj.send(parameters)
	}

	return this.ajaxobj.responseText
}



var ajaxmenu=new Object()
	ajaxmenu.basedomain="http://"+window.location.hostname
	ajaxmenu.ajaxobj=createAjaxObj()

	ajaxmenu.getAjaxRequestMenu=function(url, parameters, callbackfunc){
	ajaxmenu.ajaxobj=createAjaxObj()
	if (this.ajaxobj){
		this.ajaxobj.onreadystatechange=function() {

          if (this.readyState==4 && this.status==200) {
               eval(this.responseText);
		 getMenuAsync();
          }
	}

		this.ajaxobj.open('POST', url, true)
		this.ajaxobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		this.ajaxobj.send(parameters)
	}
}










//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadLink(){

	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundLink").css({
			"opacity": "0.7"
		});
		$("#backgroundLink").fadeIn("slow");
		$("#linkForm").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disableLink(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundLink").fadeOut("slow");
		$("#linkForm").fadeOut("slow");
		popupStatus = 0;
	}
}

//centering popup
function centerLink(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#linkForm").height();
	var popupWidth = $("#linkForm").width();
	//centering
	$("#linkForm").css({
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#linkForm").css({
		"height": popupHeight 
	});
	
}


