
/****** Hide/Show a div by id *****/
function shdiv(divid,divstate){
    if (document.getElementById)
    {
        document.getElementById(divid).style.visibility = divstate;
    }
    else 
    {
        document[divid].visibility = divstate;
    }
}

/****** Hide/Show a div by id *****/
function clrcls(divid,divstate){
    if (document.getElementById)
    {
        document.getElementById(divid).style.visibility = divstate;
        document.getElementById(divid).innerHTML = "";
    }
    else 
    {
        document[divid].visibility = divstate;
        document[divid].innerHTML = "";
    }
    
}


// ****** fuction to make call to fill xmlHTTP *******/
var xmlHttp

// ****** fuction to check which type of browser is used *******/
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function showUser(str,pth)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	}
	var url="gal_lgimg.php"
	url=url+"?lgimg="+str+"&pth="+pth
	document.getElementById("lgimage").style.visibility="visible";
	
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

// ****** fuction to check when the readystate has been changed *******/
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("lgimage").innerHTML=xmlHttp.responseText 
 } 
}

function findPos(obj) {
        var curleft = curtop = 0;
        if (obj.offsetParent) {
                curleft = obj.offsetLeft
                curtop = obj.offsetTop
                while (obj = obj.offsetParent) {
                        curleft += obj.offsetLeft
                        curtop += obj.offsetTop
                }
        }
        return [curleft,curtop];
}


function box(boxname,menustate){
	if (document.getElementById)
	{document.getElementById(boxname).style.visibility = menustate;}
	else {document[boxname].visibility = menustate;}
}
