// JavaScript Document

var message_deletepost="Are you sure to delete your post?";
var message_editpost="Are you sure to edit your post?";

function checkUserNameAvability(username){
	if(username=="") return false;
	x= window.open("isusernameavailable.php?v=" + username ,"checkUsername","width=400,height=200,scrollbars=no,status=no");
	x.focus();
	return true;
}

function init_checkUserNameAvability(field){
	if(field=="") return false;
	x=document.getElementById(field).value;
	if(x=="" || x.length<3 ) {
		alert("Username must be not empty and at least be 3 character long");
		return false;
	}else{
		checkUserNameAvability(x);	
	}
}

function addToFriendList(user_id){
	x = window.open("addtofriendlist.php?i="+user_id , "addTofriendlist","width=450,height=250,scrollbars=no,status=no");
	x.focus();
}

function removeFromFriendList(user_id){
	x = window.open("removefromfriendlist.php?i="+user_id , "removeFromfriendlist","width=450,height=250,scrollbars=no,status=no");
	x.focus();
}

function sendPersonalMessage(user_id){
	//alert(user_id);
	x = window.open("sendmessage.php?i="+user_id , "sendPersonalMessage","width=450,height=250,scrollbars=no,status=no");
	x.focus();
}

function setashomepage(){
	alert("asdasd");
	window.external.setHomePage('http://www.get-in.info');
}

