function showWin(topic_id,forum_id,pg,st,en)
{
         
      		
	$.ajax(
	{
             
		url: 'http://www.techtree.com/techtree/jsp/forum/quickReply.jsp?section=Forum&tm='+new Date().getTime()+'&mode=reply&topic_id='+topic_id+'&forum_id='+forum_id+'&pg='+pg+'&st='+st+'&en='+en+' ',
		error: function()
		{
			alert('Error : please try again  ');
		},
		success: function(data)
		{        
                          
			$('div#quickreply').html(data).css(
			{
				display:'none', left:250, top:570, position:'absolute'
			}).slideDown('slow');
                   
		}
	});

}

function showWinM(opt)
{
    
	$.ajax(
	{
		url: 'http://www.techtree.com/techtree/jsp/login/Jlogin.jsp?opt='+opt+'&tm='+new Date().getTime(),
		error: function()
		{
			alert('Error : please try again  ');
		},
		success: function(data)
		{
			if (opt.indexOf('Profile') != -1)
			{
				$('div#dvTopCFish2').html(data).hide().slideDown('slow');
			}
			else
			{
				$('div#dvlogon').html(data).css(
				{
					display:'none',	left:300, top:400, position:'absolute'
				}).slideDown('slow');
			}
		}
	});
}



function closeTopWin(id)
{
$("#"+id).slideUp('slow');
}

//login validations

function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}


function Validate()
{  
email = document.getElementById("email").value;
password = document.getElementById("password").value;

if (trim(email) == "")
{
 alert("Please enter  Email id");
 document.getElementById("email").value="";
 document.getElementById("email").focus();
 	
 return false;
}
if (document.getElementById("password").value != "")
  {
  var str=document.getElementById("email").value
  var filter=/^.+@.+\..{2,3}$/

 	 if (!filter.test(str))
  	{
	  alert("Please enter valid emailId");
 	 document.getElementById("email").focus();
 	 return false;
        }
  }
if(trim(password) =="")
{
 alert("Please enter your Password");
 document.getElementById("password").value="";
 document.getElementById("password").focus();
  return false;
}
  
 return true;
}




