/* Username Input */
function userstart(obj){
	if(obj.value=='Username'){
			obj.value='';
		}
	}
function userstop(obj){
		if(obj.value==''){
			obj.value='Username';
		}
	}
/* Password Input */
function activePwd(obj){
		obj.style.display='none';
		document.getElementById("pwd").style.display='inline';
		document.getElementById("pwd").focus();
	}
function chkPwd(){
		if(document.getElementById("pwd").value==''){
			document.getElementById("pwd").style.display='none';
			document.getElementById("pwds").style.display='inline';
		}
	}
window.onload = function () { 
	$("#pwd").hide()
	}
/* Search Input */	
function searchstart(obj){
	if(obj.value=='Search...'){
			obj.value='';
		}
	}
function searchstop(obj){
		if(obj.value==''){
			obj.value='Search...';
		}
	}

/* tag input */
function tagstart(obj){
	if(obj.value=='Enter a tag'){
			obj.value='';
		}
	}
function tagstop(obj){
		if(obj.value==''){
			obj.value='Enter a tag';
		}
	}

/* author search input */
function authorstart(obj,default_value){
	if(obj.value==default_value){
			obj.value='';
		}
	}
function authorstop(obj,default_value){
		if(obj.value==''){
			obj.value=default_value;
		}
	}
	
	
function SetCookie(name, value)
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
	document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
	+((secure == true) ? "; secure" : "");
}

function getCookie(cookie_name)
	{
	var allcookies = document.cookie;
	var cookie_pos = allcookies.indexOf(cookie_name);
	
	if (cookie_pos != -1)
	{
	cookie_pos += cookie_name.length + 1;
	var cookie_end = allcookies.indexOf(";", cookie_pos);
	
	if (cookie_end == -1)
	{
	cookie_end = allcookies.length;
	}
	
	var value = unescape(allcookies.substring(cookie_pos, cookie_end));
	}
	
	return value;
}

function hideNotice(user_id){
	SetCookie('hidenote_'+user_id, '1',86400);
	document.getElementById('usernote').style.display='none'
}
