function mLink(str){ //Hide mailto link
	var decodedStr = "";
	for(var i=0;i<str.length;i+=2){
		var hexStr = str.substr(i,2).split("");
		decodedStr += String.fromCharCode(parseInt("0x"+hexStr[1]+hexStr[0]));
	}
	return decodedStr;
}

/* Get encoded string */
function encodeStr(str){
	var encodedStr = "";
	function dechex(number){
		if(number<0)number = 0xFFFFFFFF + number + 1;
		return parseInt(number, 10).toString(16);
	}
	for(var i=0;i<str.length;i++){
		var hexStr = dechex(str.charCodeAt(i)).split("");
		encodedStr += hexStr[1] + hexStr[0];
	}
	return encodedStr;
}

//Email check
function emailTest(str) {
	return /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(str);
}

//Browser alert modal
function showBrowserAlert(msg){
	$('#browserAlert').modal({
		overlayId: 'modal1-overlay',
		overlayClose: true,
		opacity: 60,
		overlayCss: {backgroundColor:"#000"},
		containerId: 'modal1-container', 
		position: ["18%"],
		onOpen: function (dialog) {
			dialog.overlay.fadeIn('fast', function(){
				dialog.container.show();
				dialog.data.show();
				dialog.container.animate({top:"30%"},'fast','easeOutBack');
			});
		}
	});
}

