function viewChildNav(element)
{
		if(document.getElementById(element).style.display=="none")
			document.getElementById(element).style.display="block";
		else
			document.getElementById(element).style.display="none";	
	}
function offChildNav(element)
{
	document.getElementById(element).style.display="none";
	}
	
	
function ShowRegBox()
{
	document.getElementById("regbox").style.display = "block";
	document.getElementById("reg_mail").focus();
}

function joinM()
 {
 	
	var email = document.getElementById("reg_mail").value;
	
	if(email != ""){
		
 	
		var sUrl = "/insert.asp?email=" + email;
		
		    var sParam = null;
		    var oXml = sendXMLHTTP(sUrl,sParam, false, "GET");
		
		    if(oXml.status == 200 && oXml.responseText != -1)
		    {
		      var returnVal = oXml.responseText;
			  document.getElementById("Tdiv").innerHTML = returnVal;
		    }
		    else if(oXml.status != 200)
			{
			
			}
	}

	
 }
 
 
 function Print(dir)
{
	var win_w = 778;
	var win_h = screen.availHeight;
     var left_pos = ((screen.width - win_w) / 2);
	window.open("/print.asp?dir="+dir,"","width="+win_w+", height="+win_h+",left="+left_pos+",top=250,scrollbars=1"); 
	
}



function OpenS(info_id)
{
	var win_w = 330;
	var win_h = 240;
	var left_pos = ((screen.width - win_w) / 2);
	window.open("/send_m.asp?a_info_id="+info_id,"","width="+win_w+", height="+win_h+", left="+left_pos+", top=250"); 
	
}

function OpenClose(rowid)
{
	//alert(document.getElementById(rowid).height);
	var browserName=navigator.appName;
	if(browserName=="Netscape") my_dis="table-cell";
	else my_dis="block";
	
	
    if(document.getElementById(rowid).style.display=="none"){document.getElementById(rowid).style.display=my_dis;}
	else{document.getElementById(rowid).style.display="none";}
	
	
}

function OpenU(id,tbl)
{
	var win_w = 778;
	var win_h = 430;
	var left_pos = ((screen.width - win_w) / 2);
	window.open("/upload/usersmanager/isragen_update.asp?id="+id+"&tbl="+tbl,"","width="+win_w+", height="+win_h+", left="+left_pos+", top=250, scrollbars=yes"); 
	
}

function checkUser()
{
	var email = document.getElementById("email").value;
	var password = document.getElementById("password").value;
	
	if(email != ""){
		
 	
		var sUrl = "/xmlHTTP/val_user.asp?email=" + email + "&password=" + password;
		
		    var sParam = null;
		    var oXml = sendXMLHTTP(sUrl,sParam, false, "GET");
		
		    if(oXml.status == 200 && oXml.responseText != -1)
		    {
		      var returnVal = oXml.responseText;
			  if (returnVal != "false")
			  	  document.location.href= returnVal;
				else
					alert(returnVal);
		    }
		    else if(oXml.status != 200)
			{
				alert("error")
			}
	}

}
var last_item;
last_item="";
function open_pp_comment(info_id)
{
	var item_=document.getElementById("pp_comment"+info_id);
	if (item_.style.display=="none")
	{
		item_.style.display="block";
		
		if(last_item!="" && last_item!="pp_comment"+info_id)
		{
			document.getElementById(last_item).style.display="none";
		}
		
		last_item="pp_comment"+info_id;
	}
	else
	{
		item_.style.display="none";
	}
}

var relogin_count=0
function keep_alive(user_id)
{
	var xmlHttp;
	
		var sendStr = "user_id=" + user_id;
		try
		{  // Firefox, Opera 8.0+, Safari  
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{  // Internet Explorer  
			try
			{    
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}
			catch (e)
			{    
				try
				{      
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
				}
				catch (e)
				{      
					alert("Your browser does not support AJAX!");      
					return false;      
				}    
			}  
		}
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
			{
				returnVal=xmlHttp.responseText;
				//document.getElementById("alert_").innerHTML=returnVal
				if (relogin_count<=10)
					  set_keep_alive(user_id);
				else
					var set_f=setTimeout("logout()",6000);
				
			}
		}
		  xmlHttp.open("POST","/xmlHTTP/keep_alive_user.asp",true,"","");
		  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=windows-1255");
		
		  xmlHttp.send(sendStr);
		  

}
function set_keep_alive(user_id)
{
	relogin_count=relogin_count+1
	var set_f=setTimeout("keep_alive("+user_id+")",300000);
}

function logout()
{
	alert("Times out! You are about to logout!")
	document.location.href="/logout.asp";
}

function button_in(item)
{
	item.style.borderStyle='inset';
}

function button_out(item)
{
	item.style.borderStyle='outset';
}









