    function makeRequest(id_target,url) {
        var http_request = false;
        //if (!parameters)
        //parameters='';

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/html');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
		 alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { alertContents(http_request,id_target); };
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents(http_request,id_target) {
    	if (http_request.readyState == 1)
    	{document.getElementById(id_target).innerHTML = "<img src='http://localhost/images/loader.gif' width='30' />";}

        if (http_request.readyState == 4) {
            if (http_request.status == 200)
            {
                document.getElementById(id_target).innerHTML = http_request.responseText;
            } else {
                alert('There was a problem with the request http_request.');
            }
        }

    }


function _rate (_sid,_updown)
{
///alert("rate:"+_updown+"/ID:"+_sid);
makeRequest('rate'+_sid,'http://localhost/stockspager/rate.php?_sid='+_sid+'&_ud='+_updown);
}

 function getsubmit(obj) {
      var getstr = "?";
      for (i=0; i<obj.childNodes.length; i++) {
         if (obj.childNodes[i].tagName == "INPUT") {
            if (obj.childNodes[i].type == "text") {
               getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            }
            ///if (obj.childNodes[i].type == "checkbox") {
            ///   if (obj.childNodes[i].checked) {
            ///      getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            ///   } else {
            ///      getstr += obj.childNodes[i].name + "=&";
            ///   }
            ///}
            ///if (obj.childNodes[i].type == "radio") {
            ///   if (obj.childNodes[i].checked) {
            ///      getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            ///   }
            }
         }   
         ///if (obj.childNodes[i].tagName == "SELECT") {
         ///   var sel = obj.childNodes[i];
         ///   getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
         ///}
         
      ///}
      var getstr = getstr.replace(/\\\'/g, "");
      alert(getstr);
      getstr += '_id=' + document.getElementById('_id').value;
      makeRequest('form_result','http://localhost/stockspager/help_calc.php'+getstr);

      ///makeRequest('help_calc.php', getstr);
   }
   function topimg (_imgnum, _down, _catId)
   {
   /////DOWN
   if (_down == 1)
   	{
   	var _varimg = _imgnum - 1;
   	document.getElementById('down').innerHTML = "<a href='#' onclick=\"topimg("+_varimg+",1,"+_catId+")\"><</a>";
   	document.getElementById('up').innerHTML = "<a href='#' onclick=\"topimg("+_varimg+",0,"+_catId+")\">></a>";
   	}
   /////UP
   else 
   	{
   	var _varimg = _imgnum + 1;
   	document.getElementById('down').innerHTML = "<a href='#' onclick=\"topimg("+_varimg+",1,"+_catId+")\"><</a>";
   	document.getElementById('up').innerHTML = "<a href='#' onclick=\"topimg("+_varimg+",0,"+_catId+")\">></a>";
   	}
   	
   	makeRequest('topimg','http://justastar.com/list_star.php?_imgnum='+_imgnum+'&_down='+_down+'&_catid='+_catId)
   }
function mouseover (str)
	{
	var end_icon = 1;
	for (end_icon;end_icon<=str;++end_icon)
		{
		document.getElementById('star'+end_icon).src='http://justastar.com/images/star_on.gif'
		}
	}

 function mouseout(str)
	{
	var end_icon = 1;
	for (end_icon;end_icon<=str;++end_icon)
		{
		document.getElementById('star'+end_icon).src='http://justastar.com/images/star_off.gif'
		}
	}
function pages(Pagez, Totalz, category_ID, Letter_ID)
{
 for (m=1;m<=Totalz;m++)
	{
	document.getElementById('pg'+ m +'').className='nono';
	}

document.getElementById('pg'+ Pagez +'').className='current';
var letterid = (Letter_ID) ? Letter_ID : "NULL";
makeRequest('stars','http://justastar.com/pages.php?_pg='+Pagez+'&_catid='+category_ID+'&_let='+Letter_ID);
}

function letter(Letter_ID, category_ID)
{
 for (m=0;m<=25;m++)
	{
	document.getElementById('lett'+ m +'').className='nono';
	}

document.getElementById('lett'+ Letter_ID +'').className='current';


document.getElementById('list1').innerHTML= '<a href="#" onClick=\"list(1, '+ Letter_ID +', '+category_ID+');return false;\"><img src="http://justastar.com/images/line_type.jpg" border="0"/></a>';
document.getElementById('list2').innerHTML= '<a href="#" onClick=\"list(2, '+ Letter_ID +', '+category_ID+');return false;\"><img src="http://justastar.com/images/square_type.jpg" border="0"/></a>';

var _type = document.getElementById('list_type').value;

makeRequest('stars','http://justastar.com/letter.php?_let='+Letter_ID+'&_catid='+category_ID+'&_type='+_type);
}

function list (Typez, Letter_ID, category_ID)
{
document.getElementById('list_type').value = Typez;
makeRequest('stars','http://justastar.com/list.php?_type='+Typez+'&_let='+Letter_ID+'&_catid='+category_ID);
}
function showhide (divid)
{
   whichdiv = document.getElementById(divid); 

   if (whichdiv.className=="show") { 
      whichdiv.className="hidd"; 
   } 
   else { 
      whichdiv.className="show"; 
   } 
}

function pic_video (current,total,starId,typez)
{
 for (m=1;m<=total;m++)
	{
	document.getElementById('label'+ m +'').className='lab_grey';
	}
	
document.getElementById('label'+ current +'').className='lab_green';

if (current != total)
document.getElementById('next_label').innerHTML='<a href="#" onClick="pic_video('+(current+1)+','+total+','+starId+','+typez+')" id="next_label">&nbsp;&raquo;&nbsp;</a>';
if (current != 1)
document.getElementById('prev_label').innerHTML='<a href="#" onClick="pic_video('+(current-1)+','+total+','+starId+','+typez+')" id="prev_label">&nbsp;&laquo;&nbsp;</a>';

document.getElementById('img_id').value = current;
makeRequest('star_item','http://justastar.com/list_item.php?_id='+current+'&_star_id='+starId+'&_type='+typez+'&_total='+total);
}

function star_pnt (vote, star_Id, old_pnt)
{
makeRequest('star_rate','http://justastar.com/starrate.php?_sid='+star_Id+'&_vote='+vote+'&_pnt='+old_pnt);
}

function add_tag ()
{
var _tag = document.getElementById('tag_name').value;
var star_id = document.getElementById('star_id').value;
var cat_id = document.getElementById('cat_id').value;
alert (_tag);
document.getElementById('tag_add').className="hidd"; 
makeRequest('tags','http://justastar.com/add_tag.php?_sid='+star_id+'&_tag_name='+_tag+'&_cat_id='+cat_id);

}

   function star_vote (_quizid, _qsid)
   {
   /////DOWN
      	makeRequest('quiz_result','http://justastar.com/quiz_vote.php?_quizid='+_quizid+'&_qsid='+_qsid)
   }
   
   function star_more_show (starId)
   {
	   document.getElementById('more'+starId).style.visibility = 'visible';
   }

   function star_more_hide (starId)
   {
	   document.getElementById('more'+starId).style.visibility = 'hidden';  
   }
