loadLogin:function(){
if ($.pdialog && DWZ._set.loginTitle) {
$.pdialog.open(DWZ._set.loginUrl, "login", DWZ._set.loginTitle, {mask:true,width:520,height:260});
} else {
window.location = DWZ._set.loginUrl;
}
},
jsonEval:function(data) {
try{
if ($.type(data) == 'string')
return eval('(' + data + ')');
else return data;
} catch (e){
return {};
}
},
ajaxError:function(xhr, ajaxOptions, thrownError){
if (alertMsg) {
alertMsg.error("<div>Http status: " + xhr.status + " " + xhr.statusText + "</div>"
+ "<div>ajaxOptions: "+ajaxOptions + "</div>"
+ "<div>thrownError: "+thrownError + "</div>"
+ "<div>"+xhr.responseText+"</div>");
} else {
alert("Http status: " + xhr.status + " " + xhr.statusText + "\najaxOptions: " + ajaxOptions + "\nthrownError:"+thrownError + "\n" +xhr.responseText);
}
},
ajaxDone:function(json){
if (json.statusCode === undefined && json.message === undefined) { // for iframeCallback
if (alertMsg) return alertMsg.error(json);
else return alert(json);
}
if(json.statusCode == DWZ.statusCode.error) {
if(json.message && alertMsg) alertMsg.error(json.message);
} else if (json.statusCode == DWZ.statusCode.timeout) {
if(alertMsg) alertMsg.error(json.message || DWZ.msg("sessionTimout"), {okCall:DWZ.loadLogin});
else DWZ.loadLogin();
} else {
if(json.message && alertMsg) alertMsg.correct(json.message);
};
},