function showTip(msg, timeout){
	var top = 10,left;
	$('#mobile_mini_tip').html(msg).fadeIn();
	left = $(window).width() / 2 - $('#mobile_mini_tip').width() / 2;
	$('#mobile_mini_tip').css({top:top, left:left});
	setTimeout(function(){
		$('#mobile_mini_tip').fadeOut()
	}, timeout?timeout:3000);
}
function onDeviceReady() {
    document.addEventListener("backbutton", onBackKeyDown, false);
}

function onBackKeyDown() {
	if(confirm('Exit?'))
		navigator.app.exitApp();
}
var isapp =Request('isapp');
if(isapp){
	SetCookie('isapp', 1);
}
if(isapp || getCookie('isapp'))
	document.write('<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>');

if($('meta[name="viewport"]').length<=0){
	$('title').before('<meta name="viewport" content="maximum-scale=5.0,minimum-scale=1.0,user-scalable=yes">');
}