
var w_popup;

function mail(url){

	isAgent = 		(url.indexOf("Ag=") >=0)
	isCheckList =		(url.indexOf("Ch=") >=0)
	isFriend = 		(url.indexOf("Fr=") >=0)
	isNormal =		(url.indexOf("No=") >=0)
	isMAgent = 		(url.indexOf("Am=") >=0)
	isMCheckList =		(url.indexOf("Cm=") >=0)
	isMFriend = 		(url.indexOf("Fm=") >=0)
	isMNormal = 		(url.indexOf("Nm=") >=0)

	s = document.title;
	p = s.indexOf("&");
	if(p >= 0){
		s = s.substring(0,p) + "¶" + s.substring(p+1);
	}
	
	u = document.location;

	v = toString(u);
	p = v.indexOf("?");
	if(p < 0) {u = u + "?k=0"}


	url = "../common/mail.asp?Lang=" + lang + "&Lng=" + lng + "&Pg=" + s + "&url=" + u;

	hw = 		520;
	hg = 		450;

	if(isAgent) {
		hg = 485;
		url += "&Ag=y";
	}
	if(isCheckList) {
		hg = 480;
		url += "&Ch=y";
	}
	if(isFriend) {
		hg = 520;
		url += "&Fr=y";
	}
	if(isNormal) {
		hg = 450;
		url += "&No=y";
	}

	if(isMAgent) {
		hg = 380;
		url += "&Am=y";
	}
	if(isMCheckList) {
		hg = 480;
		url += "&Cm=y";
	}
	if(isMFriend) {
		hg = 415;
		url += "&Fm=y";
	}
	if(isMNormal) {
		hg = 450;
		url += "&Nm=y";
	}


	if (screen) {        	
	   	x = (screen.availWidth - hw)*0.5;
		y = (screen.availHeight - hg)*0.4;
    	}else {
		x = (800-hw)/2;
		y = (600-hg)/3;
	}

	if(x < 0) {x = 0}
	if(y < 0) {y = 0}

	var aref = 	"width=" + hw;
	aref +=		",height=" + hg;
	aref +=		",screenX=" + x;
	aref +=		",screenY=" + y;
	aref +=		",left=" + x;
	aref +=		",top=" + y;

	aref += 	",scrollbars=0";
	aref +=		",resizable=0";
	aref +=		",copyhistory=0";
	aref +=		",directories=0";
	aref +=		",location=0";
	aref +=		",menubar=0";
	aref +=		",status=0";
	aref +=		",toolbar=0";


	if(w_popup) {w_popup.close();}

	w_popup = window.open(url,"mail",aref);
	if (window.focus) {w_popup.focus();}
}

