/**
 * Post Success Parser 
 */
function postSuccessParser( json ) {
	if ( json.length == 3 ) {
		if ( json[1] == 'msg' ) {
			alert ( json[2] ) ;
			return true ;
		}
		if ( json[1] == 'script' ) {
			eval ( json[2] ) ;
			return true ;
		}
		if ( json[1] == 'location' ) {
			location = json[2] ;
			return true ;
		}
		return false ;
	}
    if ( json.length == 4 ) {
        if ( json[1] == 'div' ) {
            $('#'+json[2]).html(json[3]);
            return true ;
        }
    }
    if ( json.length == 5 ) {
        if ( json[1] == 'window' ) { // 2 - width, 3-height , 4-content
            $('#psp_window,#psp_window_in').remove();
            var $tmp = '' ;
            $tmp += '<Div id="psp_window" style="left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: black; z-index: 999991;"></Div>' ;
            $tmp += '<Div id="psp_window_in" style="left: 50%; top: 50%; width: '+json[2]+'px; height: '+json[3]+'px; margin-left: -'+parseInt(json[2]/2)+'px; margin-top: -'+parseInt(json[3]/2)+'px; position: fixed; background-color: #EEE; z-index: 999993; border: 2px solid #555; border-radius: 13px;">';
                $tmp += '<Div id="psp_window_content" style="display: none; left: 11px; top: 11px; right: 11px; bottom: 11px; padding: 7px; position: absolute; background-color: white; overflow: auto; font-family: Tahoma;"></Div>';
            $tmp += '</Div>';
            $('BODY').append($tmp);
            $('#psp_window_content').html(json[4]);
            $('#psp_window_content').fadeIn(555);
            $('#psp_window').css({'opacity':'0.3'});
            $('#psp_window').bind('click',function(){
                $('#psp_window_in').fadeOut(333,function(){
                    $('#psp_window').remove();
                    $('#psp_window_in').remove();
                    $('#psp_window_content').empty();
                    $('#psp_window_content').remove();
                });
            });
            return true;
        }
		return false ;
	}
	return false ;
}
