
function quickJoin(groupLiveId) {
	window.open("msnim:add?contact=" + groupLiveId, "win");
}
function quickLaunch(groupLiveId) {
	window.open("msnim:chat?contact=" + groupLiveId, "win");
}
function creatGroup() {
	window.open("http://groups.im/index.html?t=cg", "win");
}
function search() {
	var v = $("input[@id=serchContent]").val();
	window.open("http://groups.im//group.jsp?key=" + v, "win");
}
function createGroupAgree() {
	var v = $("input[@id=agree][@checked]").val();
	if (v == "agree") {
		window.open("http://groups.im/index.html?t=cg", "win");
	} else {
		alert("You have to agree with the Registration Agreement to create a group");
	}
}
function getFilePath() {
	pathname = window.location.href;
	pathname = pathname.replace(/%20/, "   ");
	var pos;
	pos = pathname.lastIndexOf("/");
	if (pos == -1) {
		pathname.lastIndexOf("\\");
	}
	return pathname.substring(0, pos);
}

function showLoading() {
	//alert("come!");
	//alert("$(\"loadingDIV\")=" + $("loadingDIV.style.position"));

	document.getElementById("loadingDIV").style.position = "absolute";
	document.getElementById("loadingDIV").style.top = 300;
	document.getElementById("loadingDIV").style.left = 610;
	document.getElementById("loadingDIV").style.display = "block";
	document.getElementById("loadingDIV").style.zIndex = "100";

//	$("#loadingDIV").style.position = "absolute";
//	$("#loadingDIV").style.top = 300;
//	$("#loadingDIV").style.left = 400;
//	$("#loadingDIV").style.display = "block";
//	$("#loadingDIV").style.zIndex = "100";
}
function closeLoading() {
	document.getElementById("loadingDIV").style.display = "none";
}

function loadMyGroups(){
	showLoading();
	
	var url = getFilePath() + "/mygroup.do?action=listAll"; 

	$.get(url ,function(xml){
		closeLoading();
		document.write(xml);
		document.close();
	})
}

function loadFriends(){
	showLoading();
	
	var url = getFilePath() + "/frigroup.do?action=listAll"; 
	
	//alert("url=" + url);
	$.get(url ,function(xml){
		closeLoading();
		document.write(xml);
		document.close();
	})
}

function loading1(url){
	showLoading();
	
	alert("url=" + url);
	
	//window.location.href="http://groups.im/";
	
	$(document).ready(function(){
			//closeLoading();

  			$(this).attr("href",url);

	});
	
}

function loading(url){
	showLoading();
	
	//alert("url=" + url);
	
	window.location.href=url;
}

function logincheck(){
	var fp = getFilePath();

	$.post(fp+"/logincheck.do", {time:new Date()},
		function(msg){		    
		    if($.trim(msg)=='false'){
		    	window.location.href=fp+"/login.jsp";
		    }else{
		    	
		    }
	}); 
}

function load(urlRed){

	var url = getFilePath() + "/loadremote.do?"; 
	
	$.ajax({
	  type: "POST",
	  
	  url: url,
	  data: "url=" + urlRed,
	  success: function(msg){
	    alert( "Data Saved: " + msg );
	  }
	});
}

function getGetail(passport){
	//window.open("http://my.groups.im/groupdetail.do?groupLiveId="+passport+"&userLiveId=");
	window.open("http://zone.groups.im/i/m/"+passport+".html");
}

