function PopupMe(locx,locy){
//alert(locx + "  " + locy);

locy = 100;

if (!dom&&!ie&&!ns4){
window.open("", "scrollbars=1")}else{
bouncelimit=32 //(must be divisible by 8)
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin

crossframe=(dom)?document.getElementById("cframe") : ie? document.all.cframe : document.cframe
//crossframe.src=null;

if(usedropin){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits}
crossobj.left = 555 + "px";
crossobj.visibility=(dom||ie)? "visible" : "show"
if(usedropin){
dropstart=setInterval("dropin()",50)}}}
function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<locy+scroll_top){
crossobj.top=parseInt(crossobj.top)+40+calunits
if (parseInt(crossobj.top)>locy+scroll_top){crossobj.top=locy+scroll_top}}else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)}}
function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)}}
function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}


function getScrollingPosition()
{
  //array for X and Y scroll position
  var position = [0, 0];

  //if the window.pageYOffset property is supported
  if(typeof window.pageYOffset != 'undefined')
  {
    //store position values
    position = [
        window.pageXOffset,
        window.pageYOffset
    ];
  }

  //if the documentElement.scrollTop property is supported
  //and the value is greater than zero
  if(typeof document.documentElement.scrollTop != 'undefined'
    && document.documentElement.scrollTop > 0)
  {
    //store position values
    position = [
        document.documentElement.scrollLeft,
        document.documentElement.scrollTop
    ];
  }

  //if the body.scrollTop property is supported
  else if(typeof document.body.scrollTop != 'undefined')
  {
    //store position values
    position = [
        document.body.scrollLeft,
        document.body.scrollTop
    ];
  }

  //return the array
  return position;
}

function displayCursorPosition(event)
{


  if (typeof event == "undefined")
  {
    event = window.event;
  }

  var scrollingPosition = getScrollingPosition();
  var cursorPosition = [0, 0];

  if (typeof event.pageX != "undefined" && typeof event.x != "undefined")
  {
    cursorPosition[0] = event.pageX;
    cursorPosition[1] = event.pageY;
  }
  else
  {
    cursorPosition[0] = event.clientX + scrollingPosition[0];
    cursorPosition[1] = event.clientY + scrollingPosition[1];
  }

  return cursorPosition;

  //var paragraph = document.getElementsByTagName("p")[0];

  //paragraph.replaceChild(document.createTextNode("Your mouse is currently located at:
//" + cursorPosition[0] + "," + cursorPosition[1]), paragraph.firstChild);


}

function sendCategoryRequest(browsenode)
{
    document.forms['browselookup']['subbrowsenode'].value = browsenode;
    document.forms['browselookup'].submit();
}

function insertAtCursor(myId, myValue) 
{
    
    elem = document.getElementById(myId);
    myField = elem;
    
    //myField = document.postform.boldit.name
//IE support
    if (document.selection) {
        myField.focus(); // keep it here    
        sel = document.selection.createRange();
        sel.text = myValue;
    }
//MOZILLA/NETSCAPE support
    else if (myField.selectionStart)// || myField.selectionStart == 0) 
    {
        var startPos = myField.selectionStart;
        var endPos = myField.selectionEnd;
        myField.value = myField.value.substring(0, startPos)
        + myValue
        + myField.value.substring(endPos, myField.value.length);
    } else {
        myField.value += myValue;
   }
   //myField.focus();
}



function changeMenuText(sText)
{
   var el=document.getElementById("selectorText");
   el.innerHTML = sText;
   //alert("testss");

}


function validateFields()
{
    myForm=document.forms["listresults"];
    var chkd=0
    
    for (i = 0; i < myForm.length; i++) 
    {
        if (myForm.elements[i].type == "checkbox" && myForm.elements[i].checked==true)
        {
            chkd=1;
            break;
        }
    }
    
    if(chkd==1)
    {
        return true;
    }
    else
    {
        alert("There is no checkbox selected");
        return false;
    }

}


function changeImage(name,status)
{
   /*var contractsymbol="http://localhost/junglehappy/app/images/minus.gif";
   var expandsymbol="http://localhost/junglehappy/app/images/plus.gif";*/
   
   if ( document.images[name] )
   {
      if (status == "close")
         document.images[name].src = "http://www.moviefreakage.com/images/plus.gif";
      else
         document.images[name].src = "http://www.moviefreakage.com/images/minus.gif";
   }
   
}



function expandcontent(curobj, cid)
{
	if (ccollect.length>0)
	{
	    var el=document.getElementById(cid)
	    el.style.display=el.style.display!="none"? "none" : ""
	    curobj.src=(el.style.display=="none")? expandsymbol : contractsymbol
	}

}



function launchPage( pagename )
{
    
    //status1.firstChild.nodeValue = "this is a test";
    //alert("http://localhost/junglehappy/index.php/" + pagename);
    document.forms.formDispatch.action = "http://localhost/junglehappy/index.php/" + pagename;
    document.forms.formDispatch.submit();
    var status1 = document.getElementById("statustext");
    status1.innerHTML = "this is a test";
    //"Books, Music, Movies, Video Games, Household, Software, Kitchen, and more.";
}
